Monitor Intel GPUs using OpenTelemetry
Shield360 uses OpenTelemetry to help you monitor Intel GPUs. This includes tracking GPU metrics like temperature, power consumption, energy usage, and clock frequency via the Linux i915/Xe kernel driver.
Collected Metrics
Section titled “Collected Metrics”| Metric | Description | Requirement |
|---|---|---|
hw.temperature | Die temperature | hwmon temp1_input |
hw.power | Current power draw (W) | hwmon power1_average |
hw.power.limit | Power cap (W) | hwmon power1_max |
hw.energy | Cumulative energy (J) | hwmon energy1_input |
hw.gpu.speed | Graphics clock (Hz; clock_domain=graphics) | DRM gt_cur_freq_mhz |
hw.fan.speed | Fan speed (RPM) | hwmon fan1_input, kernel 6.16+ |
Get started
Section titled “Get started”Collect and send GPU performance metrics directly from your application to an OpenTelemetry endpoint.
Using the CollectorInstall the OpenTelemetry GPU Collector as a Docker container to collect and send GPU performance metrics to an OpenTelemetry endpoint.
Using the SDK
Open your command line or terminal and run:
pip install shield360Perfect for existing applications - no code modifications needed:
# Configure via CLI argumentsshield360-instrument \ --service-name my-ai-app \ --environment production \ --otlp-endpoint YOUR_OTEL_ENDPOINT \ python your_app.py# Configure via environment variablesexport OTEL_SERVICE_NAME=my-ai-appexport OTEL_DEPLOYMENT_ENVIRONMENT=productionexport OTEL_EXPORTER_OTLP_ENDPOINT=YOUR_OTEL_ENDPOINT
# Run with zero code changesshield360-instrument python your_app.pyimport shield360
shield360.init(otlp_endpoint="YOUR_OTEL_ENDPOINT")Add the following two lines to your application code:
import shield360
shield360.init()Then, configure the your OTLP endpoint using environment variable:
export OTEL_EXPORTER_OTLP_ENDPOINT=YOUR_OTEL_ENDPOINTimport shield360 from "shield360"
shield360.init({ otlpEndpoint: "YOUR_OTEL_ENDPOINT" })Add the following two lines to your application code:
import shield360 from "shield360"
shield360.init()Then, configure the your OTLP endpoint using environment variable:
export OTEL_EXPORTER_OTLP_ENDPOINT=YOUR_OTEL_ENDPOINTReplace: YOUR_OTEL_ENDPOINT with the URL of your OpenTelemetry backend, such as http://127.0.0.1:4318 if you are using Shield360 and a local OTel Collector.
To send metrics and traces to other Observability tools, refer to the supported destinations.
For more advanced configurations and application use cases, visit the SDK configuration reference or TypeScript SDK reference.
Using the Collector
You can quickly start using the OTel GPU Collector by pulling the Docker image:
docker pull ghcr.io/thinkfleetai/otel-gpu-collector:latestHere’s a quick example showing how to run the container with the required environment variables.
For Intel GPUs, pass the DRM device into the container using --device:
docker run \ --device /dev/dri:/dev/dri \ --pid=host \ -e OTEL_SERVICE_NAME='my-app' \ -e OTEL_RESOURCE_ATTRIBUTES='deployment.environment=staging' \ -e OTEL_EXPORTER_OTLP_ENDPOINT="YOUR_OTEL_ENDPOINT" \ -e OTEL_EXPORTER_OTLP_HEADERS="YOUR_OTEL_HEADERS" \ ghcr.io/thinkfleetai/otel-gpu-collector:latest--pid=host is required for per-process GPU attribution (cmdline, PID, zombie state).
For more advanced configurations of the collector, visit the GPU Collector documentation.
Note: If you’ve deployed Shield360 using Docker Compose (docker-compose.yml in the Shield360 distribution), make sure to use the host’s IP address or add OTel GPU Collector to the Docker Compose (docker-compose.yml in the Shield360 distribution):
Docker Compose: Add the following config under `services`
otel-gpu-collector: image: ghcr.io/thinkfleetai/otel-gpu-collector:latest pid: host environment: OTEL_SERVICE_NAME: 'my-app' OTEL_RESOURCE_ATTRIBUTES: 'deployment.environment=staging' OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector:4318" devices: - /dev/dri:/dev/dri depends_on: - otel-collector restart: alwaysHost IP: Use the Host IP to connect to OTel Collector
OTEL_EXPORTER_OTLP_ENDPOINT="http://192.168.10.15:4318"Environment Variables
Section titled “Environment Variables”OTel GPU Collector uses standard OpenTelemetry environment variables for configuration:
| Environment Variable | Description | Default Value |
|---|---|---|
OTEL_SERVICE_NAME | Service/application name attached to all metrics | default |
OTEL_RESOURCE_ATTRIBUTES | Resource attributes, e.g. deployment.environment=production | deployment.environment=default |
OTEL_EXPORTER_OTLP_ENDPOINT | OpenTelemetry OTLP endpoint URL | (required) |
OTEL_EXPORTER_OTLP_HEADERS | Headers for authenticating with the OTLP endpoint | Ignore if using Shield360 |
OTEL_METRIC_EXPORT_INTERVAL | Metric polling interval in milliseconds | 10000 |
Details on the types of metrics collected and their descriptions.