Skip to main content
Version: Next

InterLink Monitoring System

Description​

To monitor the InterLink stack, you can use an helm chart that deploys the entire stack and components needed for monitoring the Interlink components, in particular the Virtual Kubelet (VK) of the Interlink project. In the near future, the monitoring system will be extended to monitor other components of the Interlink project.

Monitoring System Components​

The monitoring system is composed of the following two components:

  1. Grafana Tempo
  2. Grafana

Grafana Tempo​

Grafana Tempo (or simply Tempo) is an open-source distributed tracing backend developed by Grafana Labs designed to handle high-scale and high-volume distributed tracing data. The choice of Tempo was made because of its key features:

  • Scalability: Tempo is designed to scale horizontally and handle millions of spans (a span is a single operation in a trace) per second. Moreover, it is capable of storing traces without requiring a database, instead leveraging object storage.
  • Simplicity: Tempo does not index traces because it relies Grafana for querying and visualizing traces. This approach reduces complexity and operational overhead.
  • Cost: Tempo is cost-effective because it uses object storage for storing traces, which is cheaper than traditional databases.
  • Integration: Tempo integrates with popular tracing protocols. One of them is OpenTelemetry, which is used by the Virtual Kubelet (VK) of the Interlink project.
  • Querying: Tempo provides a query language that allows users to filter and aggregate traces. It also supports distributed sampling, which allows users to sample traces across services. The powerful query language is a key feature that enables users to extract insights from traces and it is one of the main reasons why Tempo was chosen for the monitoring system.

Grafana​

Grafana is an open-source platform for monitoring and observability that allows users to query, visualize, alert on, and understand metrics no matter where they are stored. It is used to create, explore, and share dashboards with teams and stakeholders. Grafana supports a wide range of data sources, including Tempo.

Distributed tracing​

The Virtual Kubelet (VK) and interLink API server are instrumented with OpenTelemetry to generate traces. OpenTelemetry is an open-source observability framework that provides APIs, libraries, agents, and instrumentation to collect telemetry data from applications and services. The traces generated by the VK are sent to Tempo, where they are stored and queried. Traces are generated by the VK when a request is made to the VK, and they contain information about the request, such as the details of the operation, the duration of the operation, and the services involved in the operation. A trace is a collection of spans, where each span represents a single operation in the trace. Spans are linked together to form a trace, which provides a complete view of the flow and performance of the operation. A span contains metadata, such as the name of the operation, the start and end time of the operation, and the service that generated the span.

The flow is represented in the following image:

Monitoring flow

In the actual setup, Tempo is deployed in the same Kubernetes cluster as the VK. Thanks to a Kubernetes service, the VK can send traces to Tempo. No TLS is used for the communication between the VK and Tempo, as the communication is internal to the cluster. In the near future, the communication between the VK and Tempo will be secured using TLS if Tempo is deployed outside the cluster and a proxy will be used to authenticate the VK with Tempo.

The following table lists the main spans generated by the VK and API server:

Span NameDescriptionAttributes
CreateHttpCallSpan that represents the HTTP call made by the VK to the Interlink API to create a pod.pod.name, pod.namespace, start.timestamp, end.timestamp, duration, exit.code
DeleteHttpCallSpan that represents the HTTP call made by the VK to the Interlink API to delete a pod.pod.name pod.namespace, start.timestamp, end.timestamp, duration, exit.code
StatusHttpCallSpan that represents the HTTP call made by the VK to the Interlink API to get the status of a pod.pod.name pod.namespace, start.timestamp, end.timestamp, duration, exit.code
LogHttpCallSpan that represents the HTTP call made by the VK to the Interlink API to get the logs of a pod.pod.name pod.namespace, start.timestamp, end.timestamp, duration, exit.code
PingHttpCallSpan that represents the HTTP call made by the VK to the Interlink API check if the API is alive.start.timestamp, end.timestamp, duration, exit.code
CreatePodVKSpan that represents the call made by the VK to the Kubernetes API to create a pod.pod.name pod.namespace, start.timestamp, end.timestamp, duration
DeletePodVKSpan that represents the call made by the VK to the Kubernetes API to delete a pod.pod.name pod.namespace, start.timestamp, end.timestamp, duration
UpdatePodVKSpan that represents the call made by the VK to the Kubernetes API to update a pod.pod.name pod.namespace, start.timestamp, end.timestamp, duration
GetPodVKSpan that represents the call made by the VK to the Kubernetes API to get a pod.pod.name pod.namespace, start.timestamp, end.timestamp, duration
GetPodStatusVKSpan that represents the call made by the VK to the Kubernetes API to get the status of a pod.pod.name pod.namespace, start.timestamp, end.timestamp, duration
GetPodsVKSpan that represents the call made by the VK to the Kubernetes API to get all pods.start.timestamp, end.timestamp, duration
CreateAPIAPI server processing of a pod creation request.HTTP metadata, pod identity, workload/object counts, retrieval timings
DeleteAPIAPI server processing of a pod deletion request.HTTP metadata, pod identity
StatusAPIAPI server status lookup and cache processing.HTTP metadata, pod counts, cache hit/miss and plugin-query counts
GetLogsAPIAPI server log request validation and streaming.HTTP metadata, pod/container identity, log options
PingAPIAPI server health check against the plugin.HTTP metadata
UpdateCacheAPIAPI server cache invalidation.HTTP metadata, pod UID
HTTP GET/POSTChild client span for a plugin or job-script-builder request.destination, request/response sizes, upstream status

API server tracing can be configured in InterLinkConfig.yaml:

Tracing:
Enabled: true
Detailed: false

Set Detailed: true to add high-cardinality diagnostics such as container and image names, metadata keys, referenced object names, cache decisions, and client information. Client information includes the X-Forwarded-Email and X-Forwarded-User headers, which identify a person, so they are recorded only in detailed mode.

The trace does not include HTTP bodies, Secret/ConfigMap contents, environment variable values, container commands, or arguments, in either mode.

The legacy ENABLE_TRACING=1 environment variable remains supported, and ENABLE_DETAILED_TRACING=1 overrides the detailed setting. A value that is neither a boolean nor 1/0 turns the switch off and logs a warning, and so does a variable that is set to the empty string.

This block configures the interLink API server only. The Virtual Kubelet is enabled separately, with ENABLE_TRACING=1 on its own process, and accepts only that exact value. Enable both to get one trace per pod operation: the Virtual Kubelet starts the trace and the API server continues it, so with only the API server enabled its spans are the roots of their own traces.

Installation​

To Enable tracing for the Virtual Kubelet, you have to set the

Environment Variable ENABLE_TRACING to 1 :::

A requirement for the monitoring system is to have Helm installed in your Kubernetes cluster or in your local machine. If you don't have Helm installed, you can follow the instructions in the following link

This helm chart requires a NGINX Ingress Controller to be installed in the cluster in order to expose the services and access them from outside the cluster. In particular, the Grafana service is exposed using an Ingress resource.

To install the monitoring system, follow the steps below:

  1. Clone the repository:
git clone https://github.com/interlink-hq/interlink-monitoring-stack
  1. Change the values in the values.yaml file to match your environment.
  2. Create a namespace for the monitoring system using the following command:
kubectl create namespace interlink-mon
  1. Install the monitoring system using the following command:
helm upgrade --install helm-vk-monitoring-release interlink-monitoring-stack/ -n interlink-mon --debug
  1. Deploy (or re-deploy) your Virtual Kubelet stack setting the TELEMETRY_ENDPOINT Environment Variable to your actual endpoint. If not set, it defaults to localhost:4317. Remember to enable the monitoring by also setting ENABLE_TRACING to 1. If you are using an external Tempo instance which is not in the same cluster as the VK and mutual TLS is enabled, you have to set the TELEMETRY_CA_CRT_FILEPATH that points to the CA certificate file used by Tempo to sign the certificates, the TELEMETRY_CLIENT_KEY_FILEPATH that points to the client key file used by the VK to authenticate itself to Tempo and the TELEMETRY_CLIENT_CRT_FILEPATH that points to the client certificate file used by the VK to authenticate itself to Tempo. Finally, if the TLS certificate on Tempo are not verfied by unknown authorities, you can set the TELEMETRY_INSECURE_SKIP_VERIFY to true.

  2. Access Grafana dashboard through the domain you defined in the values.yaml file with the credentials you defined in the values.yaml file.

The following image shows the Grafana dashboard:

Grafana Dashboard