Appearance


To send OpenTelemetry metrics and traces generated by ARMS from your AI Application to Prometheus and Grafana Tempo, follow the below steps.
1. Configure OpenTelemetry Collector
Prometheus + Tempo requires an OpenTelemetry Collector to route metrics to Prometheus and traces to Tempo.
Install OpenTelemetry Collector (if not already running)
For detailed installation instructions, refer to the OpenTelemetry Collector Documentation.
Configure the Collector
- Configure OTLP Receiver: Set up receiver on
0.0.0.0:4318for HTTP and0.0.0.0:4317for gRPC. - Define Exporters:
prometheusremotewritefor metrics → Prometheusotlpfor traces → Tempo
- Assign to Pipelines: Route metrics and traces to appropriate backends.
Complete Collector Configuration
yaml
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
processors:
batch:
memory_limiter:
# 80% of maximum memory up to 2G
limit_mib: 1500
# 25% of limit up to 2G
spike_limit_mib: 512
check_interval: 5s
exporters:
prometheusremotewrite:
endpoint: "YOUR_PROMETHEUS_REMOTE_WRITE_URL"
add_metric_suffixes: false
otlp:
endpoint: "YOUR_TEMPO_URL"
service:
pipelines:
traces:
receivers: [ otlp ]
processors: [ memory_limiter, batch ]
exporters: [ otlp ]
metrics:
receivers: [ otlp ]
processors: [ memory_limiter, batch ]
exporters: [ prometheusremotewrite ]Replace:
YOUR_PROMETHEUS_REMOTE_WRITE_URLwith your Prometheus remote write endpoint.- Example:
https://prometheus.grafana.net/api/prom/push
- Example:
YOUR_TEMPO_URLwith your Tempo endpoint.- Example:
tempo.grafana.net:443
- Example:
2. Instrument your application
SDK
For direct integration into your Python applications:
Function Arguments
python
import elsai_arms
elsai_arms.init(
otlp_endpoint="YOUR_OTELCOL_URL:4318"
)Replace:
YOUR_OTELCOL_URL:4318with the HTTP endpoint of your OpenTelemetry Collector.- Example:
http://127.0.0.1:4318(for local collector) - Example:
http://otel-collector.monitoring.svc.cluster.local:4318(for Kubernetes)
- Example:
Environment Variables
python
import elsai_arms
elsai_arms.init()Set these environment variables:
shell
export OTEL_EXPORTER_OTLP_ENDPOINT="YOUR_OTELCOL_URL:4318"Replace:
YOUR_OTELCOL_URL:4318with the HTTP endpoint of your OpenTelemetry Collector.- Example:
http://127.0.0.1:4318(for local collector) - Example:
http://otel-collector.monitoring.svc.cluster.local:4318(for Kubernetes)
- Example:
See the ARMS SDK configuration docs for more advanced options.
CLI
For zero-code auto-instrumentation via command line:
CLI Arguments
shell
# Using CLI arguments
elsai-arms-instrument \
--otlp-endpoint "YOUR_OTELCOL_URL:4318" \
--service-name "my-ai-service" \
--deployment-environment "production" \
python app.pyReplace:
YOUR_OTELCOL_URL:4318with the HTTP endpoint of your OpenTelemetry Collector.- Example:
http://127.0.0.1:4318(for local collector) - Example:
http://otel-collector.monitoring.svc.cluster.local:4318(for Kubernetes)
- Example:
Environment Variables
shell
# Set environment variables (takes precedence over CLI args)
export OTEL_EXPORTER_OTLP_ENDPOINT="YOUR_OTELCOL_URL:4318"
export OTEL_SERVICE_NAME="my-ai-service"
export OTEL_DEPLOYMENT_ENVIRONMENT="production"
# Run your application
elsai-arms-instrument python app.pyReplace:
YOUR_OTELCOL_URL:4318with the HTTP endpoint of your OpenTelemetry Collector.- Example:
http://127.0.0.1:4318(for local collector) - Example:
http://otel-collector.monitoring.svc.cluster.local:4318(for Kubernetes)
- Example:
See the ARMS SDK configuration docs for more advanced options.
3. Import the pre-built Dashboard
- Log into your Grafana Instance. To install Grafana, refer to the Official documentation.
- Add Data Sources: Make sure Prometheus and Tempo are added as data sources in Grafana. To add a new data source, follow the steps in the Official documentation.
- Click Dashboards in the primary menu.
- Click New and select Import in the drop-down menu.
- Copy the dashboard JSONs provided in the offical Grafana AI Observability repository
- Paste the dashboard JSONs one by one directly into the text area.
- Click Import.
- Save the dashboard.