Monitoring GPU
You can monitor the GPU metrics on the Instana UI. To monitor GPUmetrics, install the NVIDIA GPU Operator and configure an OpenTelemetry-based data collector such as the Instana Distribution of OpenTelemetry Collector (IDOT) or an open source OpenTelemetry Collector.
NVIDIA GPU operator
You can install the NVIDIA GPU Operator on your GPU environment that helps manage and collect GPU metrics. Enable components such as NVIDIA drivers (to enable CUDA), Kubernetes device plugin for GPUs, and the NVIDIA Container Toolkit if you need them. For more information, see NVIDIA GPU Operator.
helm install gpu-operator \
--repo https://helm.ngc.nvidia.com/nvidia \
--namespace gpu-operator \
--create-namespace \
-set driver.enabled=false \
-set toolkit.enabled=false \
-set devicePlugin.enabled=false \
-set mig.strategy=single \
gpu-operator
The NVIDIA GPU Operator installs the NVIDIA Data Center GPU Manager (DCGM) by default. DCGM Exporter is a tool to NVIDIA DCGM that allows users to gather GPU metrics and understand workload behavior or monitor GPUs in clusters.
DCGM Exporter exposes GPU metrics at an HTTP endpoint (/metrics) for monitoring solutions. For more information, see DCGM Exporter.
Instana supports MIG (Multi-Instance GPU) through the DCGM Exporter that provides visibility into partitioned GPU usage. Metrics can be collected for each MIG instance independently, helping you monitor and allocate GPU resources more effectively in shared environments.
OpenTelemetry-based data collectors
You can forward the OpenTelemetry data of the GPU to an Instana agent or Instana backend by using the OpenTelemetry Collector.
- Instana Distribution of OpenTelemetry Collector (IDOT): IDOT is a preconfigured, optimized distribution that simplifies GPU monitoring setup. For more information, see IDOT and the OpenTelemetry project.
- An open source OpenTelemetry Collector: An OpenTelemetry Collector is the core component of the OpenTelemetry ecosystem, offering vendor-independent functions for telemetry data collection, processing, and export. Use it for custom deployments or environments where IDOT is not available. For more information, see OpenTelemetry Collector.
Instana supports the following models to collect the GPU data:
- Agent model: For this pattern, the GPU data is sent to the Instana agent first, and the agent helps aggregate the data and send to the Instana backend.
- Agentless model: For this pattern, the GPU data is sent to the Instana backend directly without going through the agent.
Forwarding Telemetry data to an Instana agent (agent pattern)
- The following snippet shows a typical configuration for the OpenTelemetry Collector to forward telemetry data to a local Instana host agent by using the
OTLP/gRPCprotocol.Create a YAML file, such as config.yaml, as follows:
receivers: otlp: protocols: grpc: prometheus/nvidia-dcgm: config: scrape_configs: - job_name: 'nvidia-dcgm' scrape_interval: 10s static_configs: - targets: - "$(DCGM_EXPORTOR_ENDPOINT)" processors: batch: resource: attributes: - key: server.address from_attribute: net.host.name action: insert - key: server.port from_attribute: net.host.port action: insert - key: service.name value: nvidia-dcgm action: update - key: INSTANA_PLUGIN value: dcgm action: insert exporters: otlp: endpoint: "$(INSTANA_AGENT_HOST):4317" tls: insecure: true service: pipelines: metrics/nvidia-dcgm: receivers: [prometheus/nvidia-dcgm] processors: [batch, resource] exporters: [otlp]Note:Data Center GPU Manager (DCGM) is an NVIDIA tool for GPU monitoring and management. The exporter exposes GPU metrics for Prometheus scraping. DCGM_EXPORTER_ENDPOINT represents the endpoint where the DCGM exporter runs. For example, the value of DCGM is 127.0.0.1:9400.The following example shows a typical configuration of the OpenTelemetry Collector for forwarding Telemetry data to a local Instana host agent with the
OTLP/HTTPprotocol.exporters: otlphttp: endpoint: "http://$(INSTANA_AGENT_HOST):4318" tls: insecure: true- Set the
DCGM_EXPORTOR_ENDPOINTfield with the DCGM Exporter endpoint. - Set the
INSTANA_AGENT_HOSTfield with the IP or the host of the Instana agent to connect to. - Instana uses OTLP standard port numbers, such as 4317 for
OTLP/gRPCand 4318 forOTLP/HTTP.
- Set the
- After you complete all configuration changes in the
config.yamlfile, run the following command to use the OpenTelemetry Collector:
docker run -d -p 4317:4317 -v $(pwd)/config.yaml:/etc/otelcol-contrib/config.yaml otel/opentelemetry-collector-contrib:latest
Forwarding Telemetry data to the Instana backend (agentless pattern)
To forward OpenTelemetry data to the Instana backend by using the OpenTelemetry Collector, complete the following steps:
-
Create a YAML file, such as config.yaml in the preceding section. Change the
endpointfrom Instana agent endpoint to Instana backend endpoint. The special endpoints of the backendotlp-acceptorcomponent are used when the OpenTelemetry data is sent. The Instana backend requires an Instana agent key for validation. The Instana backend also requires thehost.id,faas.id, ordevice.idresource attribute.exporters: otlp: endpoint: INSTANA_OTLP_GRPC_BACKEND:4317 headers: x-instana-key: xxxxxxx x-instana-host: xxxxNotes:
- Set the
INSTANA_OTLP_GRPC_BACKENDfield with the correct domain name of theotlp-acceptorcomponent of the Instana backend. For more information about the endpoint of the Instana backendotlp-acceptor, see Endpoints of Self-Hosted Instana backend otlp-acceptor or Endpoints of SaaS Instana backend otlp-acceptor - Set the
x-instana-keyfield with the agent key of the Instana agent for targeting the Instana backend. To find your agent key, you can click More > Agents in the navigation bar of the Instana UI and then click Install Agents > Windows. - Set the
x-instana-hostfield with the host ID if nohost.id,faas.id, ordevice.idresource attribute is defined in your application or system. - Instana uses OTLP standard port numbers, such as 4317 for
OTLP/gRPCand 4318 forOTLP/HTTP. Port 443 is also supported forOTLP/HTTP.
- Set the
- After you complete all configuration changes in the
config.yamlfile, run the following command to use the OpenTelemetry Collector:
docker run -d -p 4317:4317 -v $(pwd)/config.yaml:/etc/otelcol-contrib/config.yaml otel/opentelemetry-collector-contrib:latest
Automatic pod discovery configuration
Instead of specifying static DCGM exporter endpoints, you can configure the OpenTelemetry Collector to automatically discover DCGM exporter pods in your Kubernetes cluster by using kubernetes_sd_configs. This approach removes the need to hard-code individual pod addresses.
receivers:
otlp:
protocols:
grpc: {}
prometheus/nvidia-dcgm:
config:
scrape_configs:
- job_name: nvidia-dcgm
scrape_interval: 10s
kubernetes_sd_configs:
- role: pod
namespaces:
names: ['nvidia-gpu-operator']
relabel_configs:
- source_labels: [__meta_kubernetes_pod_label_app]
regex: nvidia-dcgm-exporter
action: keep
- source_labels: [__meta_kubernetes_pod_container_port_name]
regex: metrics
action: keep
- source_labels: [__meta_kubernetes_pod_node_name]
target_label: node_name
action: replace
metric_relabel_configs:
- source_labels: [__name__]
regex: 'DCGM_FI_DEV_(GPU_UTIL|MEM_COPY_UTIL|FB_USED|FB_FREE|GPU_TEMP|POWER_USAGE|SM_CLOCK)|DCGM_FI_PROF_GR_ENGINE_ACTIVE'
action: keep
processors:
batch: {}
transform:
metric_statements:
- context: datapoint
statements:
- set(resource.attributes["service.name"], Concat(["nvidia-dcgm@", resource.attributes["k8s.node.name"]], "")
- set(resource.attributes["service.instance.id"], attributes["node_name"])
resource:
attributes:
- action: insert
from_attribute: net.host.name
key: server.address
- action: insert
from_attribute: net.host.port
key: server.port
- action: update
key: service.name
value: nvidia-dcgm
- action: insert
key: INSTANA_PLUGIN
value: dcgm
exporters:
debug:
verbosity: detailed
otlp:
endpoint: "http://<instana-grpc-host>:443"
headers:
x-instana-key: <api-key>
x-instana-host: <instana-host>
otlphttp:
endpoint: "https://<instana-http-host>:443"
headers:
x-instana-key: <api-key>
x-instana-host: <instana-host>
service:
pipelines:
metrics/nvidia-dcgm:
receivers:
- prometheus/nvidia-dcgm
processors:
- transform
- batch
- resource
exporters:
- otlp
- debug
- otlphttp
telemetry:
metrics:
readers:
- pull:
exporter:
prometheus:
host: 0.0.0.0
port: 8888
Viewing metrics
After you install OpenTelemetry (OTel) Data Collector, you can view the GPU metrics in the Instana UI.
- Open the Instana UI, and click Infrastructure. Then, click Analyze Infrastructure.
- Select OTEL Dcgm from the list of types of the entities.
- Click the entity instance of OTEL Dcgm entity type to open the associated dashboard.
GPU metrics
| Metric | Description |
|---|---|
| DCGM_FI_DEV_GPU_TEMP | GPU temperature in celsius |
| DCGM_FI_DEV_POWER_USAGE | Power consumption in watts |
| DCGM_FI_DEV_GPU_UTIL | GPU utilization percentage |
| DCGM_FI_DEV_MEM_COPY_UTIL | Memory copy engine utilization |
| DCGM_FI_DEV_FB_USED | Used framebuffer memory |
| DCGM_FI_DEV_FB_FREE | Free framebuffer memory |
| DCGM_FI_DEV_SM_CLOCK | Streaming multiprocessor clock frequency |
| DCGM_FI_DEV_MEM_CLOCK GPU | Memory clock frequency |