How do I get OpenTelemetry metric series into Tares?
Tares receives OpenTelemetry metrics over OTLP, so you add one otlp source and point your exporter at the Tares endpoint. Metrics are pushed to POST /v1/metrics, and one source takes every service. Resource attributes such as service.name become labels, so metric points correlate by service with no per-service setup.
How it works
The otlp connector is a push connector. Your app, SDK or OpenTelemetry Collector sends data to Tares, and Tares does not poll anything.
- Endpoints. OTLP/HTTP arrives at
POST /v1/logs,POST /v1/tracesandPOST /v1/metrics. The same source takes logs, traces and metrics. - One source for every service. Resource attributes become labels. The
servicelabel comes fromservice.nameand is the natural key. - No connector-specific config. The only field you set is
labels. - Optional gRPC. With the
otlp-grpcextra installed, the receiver also listens on port 4317. SetTARES_OTLP_GRPC_PORTto change the port, or tooffto disable it.
This differs from the Prometheus connector. Prometheus is polled: Tares reads a Prometheus server on an interval, and you pick metrics by name or by label with no PromQL to write. OpenTelemetry metrics are pushed to the OTLP endpoint by whatever exports them.
Set it up
You need something exporting OTLP, such as an instrumented app or an OpenTelemetry Collector, that can reach the Tares daemon.
-
Create the otlp source. Pick whichever route suits you:
- Ask a connected agent: “Use tares to create an OTLP source keyed by service.” The agent calls
create_source. - In the console, go to Sources, Add source, otlp, and save. No config is required.
- Send
POST /api/sourceswith the object below.
- name: otel connector: otlp config: labels: - { name: service, field: service, primary: true } - Ask a connected agent: “Use tares to create an OTLP source keyed by service.” The agent calls
-
Point the exporter at Tares. Set the standard OpenTelemetry endpoint variable. For OTLP/HTTP, use the daemon address. For gRPC, use port 4317.
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 -
Install the gRPC extra if you export over gRPC. OTLP/HTTP needs nothing extra.
pip install 'tares[otlp-grpc]' -
Add a key if Tares has auth on. The exporter sends a Bearer Authorization header holding an ingest-scoped API key. You only need it when Tares has auth on. With the OpenTelemetry SDK or Collector, you can set it through
OTEL_EXPORTER_OTLP_HEADERS. See the deployment reference for how keys and authentication work. -
Verify. Open the source and check Recent events, which shows spans, logs and metric points as they arrive. In Explore, your services are listed under the
servicekey.
The OpenTelemetry connector page has the full reference for this source.
What you get
- Metric series from every OpenTelemetry-instrumented service arrive through a single source, with no per-service setup.
- Each metric point carries labels taken from its resource attributes, and
serviceis the primary key. - Metrics, logs and traces land on the same
servicekey, so you can look at them together for one service. - A standard exporter configuration. You change the OpenTelemetry endpoint variable and nothing in your instrumentation.
- Both OTLP/HTTP and, with the extra installed, OTLP/gRPC.
Once the data is flowing, the rest of the AI SRE workflow works on the same service key.
When something else fits
- If your metrics already live in a Prometheus server, use the Prometheus connector. Tares polls it, and you pick metrics by name or label with no PromQL.
- If you only want logs or traces, the same otlp source and endpoints take them. Metrics need no separate source.