Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add interface names into NSM metrics #768

Open
VitalyGushin opened this issue Nov 14, 2023 · 4 comments
Open

Add interface names into NSM metrics #768

VitalyGushin opened this issue Nov 14, 2023 · 4 comments
Assignees

Comments

@VitalyGushin
Copy link

In the forwarder's "metrics" field add 4 interfaces as key-value pairs with the key names: "interface_client", "interface_client_fwd", "interface_endpoint", "interface_endpoint_fwd", and with a value in the format "interface-type/interface-name".
Example of a Connection:
Image

@dualBreath
Copy link
Contributor

dualBreath commented Nov 24, 2023

I can't change the original description, so I'll post the actual state of the solution here.

The solution is presented schematically in this diagram:

metrixNew drawio (1)

  1. NSC metrics contains a single field "client_interface" with value in the format "interface-type/interface-name", for example:
    "client_interface": "MEMIF/nsm-1"
  2. NSE metrics contains a single field "server_interface" with value in the format "interface-type/interface-name", for example:
    "server_interface": "KERNEL/memif2kern-672c"
  3. Forwarder metrics contains a pair of fields "client_interface", "server_interface" with values in the format "interface-type/interface-name", for example:
    "server_interface": "MEMIF/memif1013904223/0"
    "client_interface": "VIRTIO/tap0"

Thus, metrics related to NSC, NSE and Forwarder are printed in separate sections of the path.

Some cases that may cause problems when reading this data:

  1. interface name may contain /, for example:
    memif1013904223/0
  2. interface type may contain spaces, for example:
    WIREGUARD TUNNEL

All information can be found in the NSC request-response, for example Kernel2Memif use-case NSC logs:

{
    "id": "alpine-395ed7f9-30fd-41aa-af2d-1c5d6ca8889b-0",
    "network_service": "kernel2memif",
    "mechanism": {
        ...
    },
    "context": {
        ...
    },
    "labels": {
        ...
    },
    "path": {
        "path_segments": [
            {
                "name": "alpine-395ed7f9-30fd-41aa-af2d-1c5d6ca8889b",
                ...
                "metrics": {
                    "client_interface": "KERNEL/nsm-1"
                }
            },
            {
                "name": "nsmgr-8ckqf",
                ...
            },
            {
                "name": "forwarder-vpp-5x4ck",
                ...
                "metrics": {
                    "client_drops": "0",
                    "client_interface": "MEMIF/memif1013904223/0",
                    "client_rx_bytes": "0",
                    "client_rx_packets": "0",
                    "client_tx_bytes": "516",
                    "client_tx_packets": "6",
                    "server_drops": "0",
                    "server_interface": "VIRTIO/tap0",
                    "server_rx_bytes": "516",
                    "server_rx_packets": "6",
                    "server_tx_bytes": "0",
                    "server_tx_packets": "0"
                }
            },
            {
                "name": "nse-memif-7948d8d869-mwnq8",
                ...
                "metrics": {
                    "server_interface": "MEMIF/memif1013904223/0"
                }
            }
        ]
    },
    "network_service_endpoint_name": "nse-memif-7948d8d869-mwnq8",
    "payload": "ETHERNET"
}

I've posted more output examples here: networkservicemesh/sdk#1560 (comment)

IMPORTANT NOTE
In case of Memif connection to Memif Forwarder is not used and we cannot see any metrics there, for example Memif2Memif use-case NSC output:

{
    "id": "nsc-memif-76699ccbc7-x9xhf-0",
    "network_service": "memif2memif",
    "mechanism": {
        ...
    },
    "context": {
        ...
    },
    "labels": {
        ...
    },
    "path": {
        "path_segments": [
            {
                "name": "nsc-memif-76699ccbc7-x9xhf",
                ...
                "metrics": {
                    "client_interface": "MEMIF/nsm-1"
                }
            },
            {
                "name": "nsmgr-t529n",
                ...
            },
            {
                "name": "forwarder-vpp-7tjb2",
                ...
            },
            {
                "name": "nse-memif-7ccff8bf8-2wghn",
                ...
                "metrics": {
                    "server_interface": "MEMIF/memif1013904223/0"
                }
            }
        ]
    },
    "network_service_endpoint_name": "nse-memif-7ccff8bf8-2wghn",
    "payload": "ETHERNET"
}

@dualBreath
Copy link
Contributor

@VitalyGushin please take a look and confirm if you agree with the new details of the solution

@VitalyGushin
Copy link
Author

LGTM

@NikitaSkrynnik
Copy link
Contributor

No interface names on memif clients (vl3 nses probably too)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Status: No status
Development

No branches or pull requests

3 participants