Skip to Content

How do I get OpenTelemetry metric series into Tares?

Tares receives OpenTelemetry metrics over OTLP/HTTP at POST /v1/metrics, so you create an otlp source and point your SDK or Collector exporter at the Tares daemon. Metrics are pushed to Tares, so there is no polling interval and no query to write. One source covers every service, and resource attributes such as service.name become labels.

How it works

The OpenTelemetry connector is a push connector. Your exporter sends logs, traces and metrics to the Tares daemon, and Tares stores them as events under one otlp source.

  • Endpoints. OTLP/HTTP arrives at /v1/logs, /v1/traces and /v1/metrics on the daemon. OTLP/gRPC is optional and listens on port 4317.
  • One source for every service. Resource attributes, for example service.name, become labels. Everything an OTel SDK or Collector exports correlates by service with no per-service setup.
  • Label paths. A label reads its value from a path into the event. Use resourceAttributes.<key> for resource attributes, attributes.<key> for the attributes of a log record, span or data point, and text for the rendered log line. The service label is resourceAttributes.service.name. There is no bare service field in an OTLP event, so a label that uses field: service gets no value.
  • Prometheus is the polled alternative. If your metrics already live in a Prometheus server, the Prometheus connector polls the metrics you pick by name or by a label they carry. You write no PromQL. OpenTelemetry metrics skip that server and go straight to the OTLP endpoint.

Set it up

  1. Start Tares and open the console, or use a connected agent. In the console go to Sources, then Add source, then otlp. The connector has no required config. Or ask your agent: “Use tares to create an OTLP source keyed by service.” The agent calls create_source for you. You can also send POST /api/sources with the object below.

  2. Save the source with the service label. The field value is resourceAttributes.service.name, and the label is the primary one:

- name: otel connector: otlp config: labels: - { name: service, field: resourceAttributes.service.name, primary: true }
  1. If you join these metrics with another source, such as a Prometheus source, mark a label with the same name, service, as primary on both sources. That gives both sources the same key to correlate on.

  2. Point your exporter at the daemon. Set the endpoint for OTLP/HTTP, or for gRPC if you installed the extra:

OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:8787 # OTLP/HTTP → /v1/{logs,traces,metrics} # or gRPC (otlp-grpc extra): OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
  1. For gRPC, install the otlp-grpc extra first. The receiver then listens on port 4317. Set TARES_OTLP_GRPC_PORT to change the port, or to off to disable it:
pip install 'tares[otlp-grpc]'
  1. If your Tares instance has auth on, the exporter sends a Bearer Authorization header holding an ingest-scoped API key. Without auth on, you do not need the header.

  2. Verify. Open the source and check Recent events, which shows spans, logs and metric points as they arrive. Then open Explore, which lists services under the service key.

The AI SRE guide shows what you can do with the data once it is flowing.

What you get

  • OpenTelemetry metric points land in Tares as events as soon as your exporter sends them.
  • One otlp source ingests every service. The service label comes from resourceAttributes.service.name, so metrics, logs and traces from the same service share one key.
  • You can watch services arrive in Explore under the service key and inspect each point in Recent events.
  • You keep your existing instrumentation. Only the exporter endpoint changes, and the same endpoint also takes your logs and traces.
  • If you also poll Prometheus, marking service primary on both sources lets the two sets of data line up on the same key.

When something else fits

  • Your metrics already live in a Prometheus server and you want to pick them by name or label: use the Prometheus connector, which polls on an interval and needs no PromQL.
  • You only need logs, traces or metrics from a service that does not export OTLP: check the OpenTelemetry connector page first, then choose the connector that matches how the data leaves that service.

Still stuck? Get help

Last updated on