Stream metrics via OpenTelemetry
Use OpenTelemetry to continuously stream metrics from your instance to external observability platforms. This includes any custom metrics defined within your application.
When to use this
Use metric streaming when:
- Console data is not sufficient for your analysis
- You need custom dashboards or alerting
- You want to correlate Alokai metrics with other systems
- You already use an external observability platform
How it works
Metric streaming is based on OpenTelemetry configuration. Once enabled, your instance sends a continuous stream of metrics to the selected external platform.
Supported destinations:
- Datadog
- New Relic
- Dynatrace
What data is included
By default, the stream includes:
- application-level metrics available within your instance
Configuration
To start streaming metrics, instrument the application, enable the integration in the Console, and pass connection details via environment variables.
Application setup
To set up instrumentation with OpenTelemetry, consult:
Console settings
Set integration credentials on the Telemetry settings page in the Console and enable the integration.
Environment variables
To pass connection details to the application, set the following environment variables via the Console environment variables page.
HTTP (protobuf):
OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_SERVICE_NAME=<service-name>
OTEL_RESOURCE_ATTRIBUTES=deployment.environment=<environment_name>,service.version=<service_version>
gRPC:
OTEL_EXPORTER_OTLP_ENDPOINT=otel-collector:4317
OTEL_EXPORTER_OTLP_PROTOCOL=grpc
OTEL_SERVICE_NAME=<service-name>
OTEL_RESOURCE_ATTRIBUTES=deployment.environment=<environment_name>,service.version=<service_version>
Important:
deployment.environmentandservice.versionmust be set viaOTEL_RESOURCE_ATTRIBUTESusing the exact key names above. Custom application env vars (e.g.DEPLOYMENT_ENV,SERVICE_VERSION) are not picked up by the OTel SDK automatically and will be silently ignored — causing APM data to appear tagged with the fallback valueenv:devin Datadog.
Verifying status
You can verify whether metric streaming is available and enabled in Telemetry configuration.
You can also verify whether additional metrics from Metric Explorer are included in the stream.
Additionally, streaming status can be validated using metrics related to the selected OpenTelemetry destination. These metrics indicate whether data is being successfully delivered to the external platform.