Export metrics to OpenTelemetry

Export metrics to OpenTelemetry#

You can export metrics from a serving graph to an external system (Datadog, Grafana Cloud, a user-hosted OpenTelemetry Collector, or any OTLP-compatible backend). When configured, the metrics are exported via OTLP to your configured endpoint.

This UI icon is used for OTel export steps: steps-custom.

The default OTel collector is configured on the API server. See Export results and metrics via OTel.

Add a step for exporting metrics with OTelMetricsExporter():

graph = function.set_topology("flow", engine="async")
graph.to(name="my_step", class_name="MyStep").to(
    class_name="mlrun.serving.OTelMetricsExporter",
    headers_source="file",
)