Skip to content

Monitor NVIDIA GPUs using OpenTelemetry

Shield360 uses OpenTelemetry to help you monitor NVIDIA GPUs. This includes tracking GPU metrics like utilization, temperature, memory usage and power consumption.

Using the SDK
Install Shield360

Open your command line or terminal and run:

Terminal window
pip install shield360
Initialize Shield360 in your Application

Perfect for existing applications - no code modifications needed:

Terminal window
# Configure via CLI arguments
shield360-instrument \
--service-name my-ai-app \
--environment production \
--otlp-endpoint YOUR_OTEL_ENDPOINT \
python your_app.py

Replace: 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
Pull `otel-gpu-collector` Docker Image

You can quickly start using the OTel GPU Collector by pulling the Docker image:

Terminal window
docker pull ghcr.io/thinkfleetai/otel-gpu-collector:latest
Run `otel-gpu-collector` Docker container

You can quickly start using the OTel GPU Collector by pulling the Docker image: Here’s a quick example showing how to run the container with the required environment variables:

Terminal window
docker run --gpus all --pid=host \
-e OTEL_SERVICE_NAME='chatbot' \
-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: 'chatbot'
OTEL_RESOURCE_ATTRIBUTES: 'deployment.environment=staging'
OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector:4318"
device_requests:
- driver: nvidia
count: all
capabilities: [gpu]
depends_on:
- otel-collector
restart: always
Host IP: Use the Host IP to connect to OTel Collector
Terminal window
OTEL_EXPORTER_OTLP_ENDPOINT="http://192.168.10.15:4318"

OTel GPU Collector uses standard OpenTelemetry environment variables for configuration:

Environment VariableDescriptionDefault Value
OTEL_SERVICE_NAMEService/application name attached to all metricsdefault
OTEL_RESOURCE_ATTRIBUTESResource attributes, e.g. deployment.environment=productiondeployment.environment=default
OTEL_EXPORTER_OTLP_ENDPOINTOpenTelemetry OTLP endpoint URL(required)
OTEL_EXPORTER_OTLP_HEADERSHeaders for authenticating with the OTLP endpointIgnore if using Shield360
OTEL_METRIC_EXPORT_INTERVALMetric polling interval in milliseconds10000
Collected Metrics

Details on the types of metrics collected and their descriptions.