Dynatrace


To send OpenTelemetry metrics and traces generated by Shield360 from your AI Application to Dynatrace, follow the below steps.
1. Get your Credentials
-
Log into your Dynatrace environment
-
Generate an API Token:
- Go to Settings → Integration → API tokens
- Click Generate token
- Give it a name (e.g.,
shield360-token) - Enable these scopes:
openTelemetryTrace.ingest- for trace ingestionmetrics.ingest- for metrics ingestionlogs.ingest- for logs ingestion (optional)
- Click Generate and copy the token
-
Get your Environment ID:
- Your Dynatrace URL format:
https://{environment-id}.live.dynatrace.com - Extract the
{environment-id}part from your Dynatrace URL
- Your Dynatrace URL format:
-
Construct your OTLP endpoint:
- Format:
https://{environment-id}.live.dynatrace.com/api/v2/otlp - Example:
https://abc12345.live.dynatrace.com/api/v2/otlp
- Format:
2. Instrument your application
For direct integration into your Python applications:
import shield360
shield360.init( otlp_endpoint="https://YOUR_ENVIRONMENT_ID.live.dynatrace.com/api/v2/otlp", otlp_headers="Authorization=Api-Token YOUR_DYNATRACE_API_TOKEN")Replace:
YOUR_ENVIRONMENT_IDwith your Dynatrace environment ID.- Example:
abc12345.live.dynatrace.com
- Example:
YOUR_DYNATRACE_API_TOKENwith the API token you generated in Step 1.
import shield360
shield360.init()Set these environment variables:
export OTEL_EXPORTER_OTLP_ENDPOINT="https://YOUR_ENVIRONMENT_ID.live.dynatrace.com/api/v2/otlp"export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Api-Token YOUR_DYNATRACE_API_TOKEN"Replace:
YOUR_ENVIRONMENT_IDwith your Dynatrace environment ID.- Example:
abc12345.live.dynatrace.com
- Example:
YOUR_DYNATRACE_API_TOKENwith the API token you generated in Step 1.
Refer to the Shield360 SDK configuration reference for more advanced configurations and use cases.
For zero-code auto-instrumentation via command line:
# Using CLI argumentsshield360-instrument \ --otlp-endpoint "https://YOUR_ENVIRONMENT_ID.live.dynatrace.com/api/v2/otlp" \ --otlp-headers "Authorization=Api-Token YOUR_DYNATRACE_API_TOKEN" \ --service-name "my-ai-service" \ --deployment-environment "production" \ python app.pyReplace:
YOUR_ENVIRONMENT_IDwith your Dynatrace environment ID.- Example:
abc12345.live.dynatrace.com
- Example:
YOUR_DYNATRACE_API_TOKENwith the API token you generated in Step 1.
# Set environment variables (takes precedence over CLI args)export OTEL_EXPORTER_OTLP_ENDPOINT="https://YOUR_ENVIRONMENT_ID.live.dynatrace.com/api/v2/otlp"export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Api-Token YOUR_DYNATRACE_API_TOKEN"export OTEL_SERVICE_NAME="my-ai-service"export OTEL_DEPLOYMENT_ENVIRONMENT="production"
# Run your applicationshield360-instrument python app.pyReplace:
YOUR_ENVIRONMENT_IDwith your Dynatrace environment ID.- Example:
abc12345.live.dynatrace.com
- Example:
YOUR_DYNATRACE_API_TOKENwith the API token you generated in Step 1.
Refer to the Shield360 SDK configuration reference for more advanced configurations and use cases.
3. View your telemetry in Dynatrace
Once your AI application starts sending telemetry data, you can explore it in Dynatrace:
- Navigate to Observability: Go to Observe and explore in your Dynatrace environment
- Distributed traces: View Distributed traces to see your AI application traces with LLM calls and vector operations
- Services: Check Services to monitor your AI service performance and dependencies
- Metrics: Explore custom metrics in Metrics for token usage, costs, and AI-specific KPIs
Your Shield360-instrumented AI applications will appear automatically in Dynatrace with comprehensive observability including LLM costs, token usage, model performance, and vector database operations.