Skip to Content

How do I connect OpenTelemetry log records to Tares?

Tares receives OpenTelemetry log records through an otlp source, so you create the source, point your exporter at Tares and see the lines arrive. One source takes every service, and the service label comes from the resource attribute service.name. You can set it up in the console, with a connected agent, or as YAML.

How it works

The otlp connector receives OTLP/HTTP logs, traces and metrics at POST /v1/logs, POST /v1/traces and POST /v1/metrics. It is a push connector: your app or OpenTelemetry Collector sends events to Tares, and Tares does not poll.

One source ingests every service. Resource attributes such as service.name become labels, so everything an OTel SDK or Collector exports correlates by service with no per-service setup.

A label reads its value from a path in the event:

  • resourceAttributes.<key> reads a resource attribute, for example resourceAttributes.service.name.
  • attributes.<key> reads an attribute of a log record, span or data point.
  • text reads the rendered log line.

There is no bare service field in an OTLP event. Use the resourceAttributes.service.name path for the service label, because a label that reads a field named service gets no value.

The connector has no fields of its own, only labels. Mark one label primary: that is the key your events are grouped under.

Set it up

  1. Install and start Tares locally.

    uv tool install tares # or: brew install glassflow/tap/tares tares up

    The console is at http://127.0.0.1:8787.

  2. Create the source in one of three ways. In the console, go to Sources, Add source, otlp. There is no required config, so save it with the service label as the key. Or ask a connected agent: “Use tares to create an OTLP source keyed by service.” The agent calls create_source. Or declare it as YAML, or send the same object to POST /api/sources:

    - name: otel connector: otlp config: labels: - { name: service, field: resourceAttributes.service.name, primary: true }
  3. Point your exporter at Tares. For OTLP/HTTP, set the endpoint to the Tares address and the exporter appends /v1/logs for log records:

    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

    For OTLP/gRPC, install the extra with pip install 'tares[otlp-grpc]'. The receiver then listens on port 4317. You can change the port with TARES_OTLP_GRPC_PORT, or set it to off to disable the receiver.

  4. If your Tares runs with auth on (tares up --auth), have the exporter send a Bearer Authorization header holding an ingest-scoped API key. With auth off, the header is not needed.

  5. Check that lines arrive. Open the source and look at Recent events: log records, spans and metric points show up there as they arrive. Then open Explore: your services are listed under the service key.

  6. If you join the OTLP source with other sources, such as Prometheus metrics or alerts, give each source a label named service and mark it primary on both. Tares then merges them into one timeline per service. The AI SRE guide shows this pattern end to end.

What you get

  • Log records from every instrumented service in one source, with no per-service setup.
  • Each record labeled by its service name, so logs group under the service key in Explore.
  • Traces and metrics from the same exporter, on the same endpoint family, if you send them.
  • A correlated timeline per service once your other sources use the same primary service label. A trigger or a connected agent can then work from that single read.
  • Setup you can repeat in the console, through an agent or as YAML. All three produce the same stored config.

When something else fits

The otlp connector is for anything that exports OpenTelemetry. If your logs come from somewhere else, use the connector that matches the source: Docker logs for a running container, or Vercel for a log drain. The connectors index lists every option, and the OpenTelemetry connector page has the full reference for this one. For a system that only posts JSON, the webhook connector accepts it.

Still stuck? Get help

Last updated on