Monitoring
OpenMeter provides a way to monitor the event ingestion pipeline in your infrastructure. Event ingestion monitoring can be useful for debugging, monitoring data quality, and ensuring that events are sent to OpenMeter correctly.
Why Monitor Ingestion?
Monitoring the event ingestion pipeline can help you notice when:
- Your system stopped sending events to OpenMeter.
- Ingested events are incorrect or missing fields.
- OpenMeter is having trouble processing events.
Collecting Metrics
The OpenMeter GET /api/v1/debug/metrics
API endpoint provides metrics in
Prometheus format.
You can use a Prometheus server or any other monitoring system that supports the
Prometheus format to collect these metrics. For more information on using the
metrics API, check out the API documentation.
Popular monitoring solutions compatible with the Prometheus metrics format:
Authentication
The metrics API uses the same authentication method as the other API endpoints.
We recommend putting the API key in the
Authorization
header. Check the API documentation for more
information.
We recommend that you use a separate API key for monitoring purposes.
Counter Resets
The metrics counters reset at midnight UTC. The Prometheus query language offers
functions like increase
and rate
to handle counter resets correctly.
For example:
increase(openmeter_events_total[24h])
returns the number of events for the last 24 hoursrate(openmeter_events_total[1h])
returns the average per-second event read rate for the last hour
Available Metrics
The following metrics are provided by the OpenMeter Debug Metrics API.
Number of Ingested Events
The metric openmeter_events_total
counts the number of ingested events for
each subject and if an error occurred. Monitoring the number of ingested events
can help you ensure that events are sent and processed correctly.
Example response for the openmeter_events_total
counter metric:
Recommended Alerts
- Alert when the number of ingested events is significantly lower than expected.
- Alert when the number of ingested events with errors is not zero.
The correct threshold for the number of ingested events depends on your use case. However, the number of errors should always be zero. Otherwise, it means your system is sending incorrect events to OpenMeter.