OpenTelemetry Integration
How to send custom metrics to Metoro via OpenTelemetry
This guide explains how to send custom metrics to Metoro using OpenTelemetry. Metoro supports the OpenTelemetry Protocol (OTLP) for metric ingestion, allowing you to send metrics from any application or service that can export OpenTelemetry metrics.
Prerequisites
- A Metoro account
- An application configured with OpenTelemetry
High Level Overview
The Metoro exporter running in each cluster is a fully compliant OpenTelemetry collector. This means that you can send metrics to Metoro using any OpenTelemetry compatible metrics library.
Endpoint Configuration
Configure your OpenTelemetry exporter to send metrics to:
This endpoint is available within your Kubernetes cluster where the Metoro exporter is installed.
Authentication
No additional authentication is required when sending metrics from within the cluster to the Metoro exporter.
Language-Specific Examples
Python
Here’s an example Python script that publishes deployment metrics to Metoro:
This script:
- Creates two gauge metrics:
custom_metrics.desired_replicas
- The desired number of replicas for a deploymentcustom_metrics.available_replicas
- The number of available replicas for a deployment
- Includes a
deployment
attribute with the name of the deployment - Uses the OpenTelemetry SDK to export metrics to Metoro
Go
Node.js
Metric Types
OpenTelemetry supports several metric types that you can use:
- Counter - A value that can only increase or be reset to zero
- Gauge - A value that can arbitrarily go up and down
- Histogram - Tracks the distribution of values over time
Attributes and Context
When sending metrics via OpenTelemetry, you can include additional attributes that will be indexed and searchable in Metoro:
- Use resource attributes to define static information about the service
- Use metric attributes to include dynamic information with each metric value
- Link metrics with traces using trace context propagation
Troubleshooting
If you encounter issues with OpenTelemetry metric ingestion:
- Verify your endpoint URL is correct
- Check your network connectivity to the Metoro OTLP endpoint
- Enable debug logging in your OpenTelemetry SDK
- Verify your metrics appear in the Metoro metrics view
- Contact support if issues persist
Additional Resources
Was this page helpful?