Skip to Content
Tares

How do I line up logs from Vercel projects with OpenTelemetry metric series for one service?

Tares lines up Vercel logs and OpenTelemetry metrics for one service when both sources use the same primary service label. One read of that service then returns the log lines and the metric values merged on one clock.

How it works

Tares correlates events by the primary label of each source. Two sources that share a primary label name and value land on the same timeline.

  • The Vercel logs connector is a push source. A Vercel log drain posts to its ingest URL, and each log entry becomes one event. Its key is project, taken from the payload’s projectName, else projectId. environment and source ride along as labels.
  • The OpenTelemetry connector receives OTLP/HTTP logs, traces and metrics. One source ingests every service, and resource attributes such as service.name become labels. The service label comes from service.name.
  • To make the two meet, give the Vercel source a primary label named service that reads the project field. Keep the OTLP source’s primary label as service.
  • The values must match. The Vercel project name has to equal the service.name your exporter sends, so checkout on both sides is one entity.

With both sources keyed by service, Tares builds one timeline per service. This is the same pattern the AI SRE guide uses for metrics, logs and alerts.

Set it up

  1. Make sure your OpenTelemetry exporter sets service.name to the same string as the Vercel project name, for example checkout.

  2. Create both sources in Sources → Add source, or with POST /api/sources, or ask a connected agent to do it. Both use service as the primary label:

- name: web-logs connector: vercel config: labels: - { name: service, field: project, primary: true } - { name: environment, field: environment } - { name: source, field: source } - name: otel connector: otlp config: labels: - { name: service, field: service, primary: true }
  1. Point your exporter at Tares. Use the HTTP endpoint, or the gRPC one if you installed the otlp-grpc 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. Copy the Vercel source’s ingest URL from its page. It has the form https://<host>/ingest/<ingest_key>. Vercel delivers from its cloud, so the URL must be publicly reachable. Use a deployed instance or a tunnel, because a bare localhost daemon will not receive drains.

  2. In Vercel, go to Team Settings → Log Drains → Add Log Drain. Set the endpoint to the ingest URL and the delivery format to JSON. Vercel verifies the endpoint with an x-vercel-verify header, and Tares echoes it back.

  3. If your Tares instance is secured, both senders use a Bearer Authorization header holding an ingest-scoped API key. Add it as a custom header on the Vercel drain and in the OTLP exporter headers. Without auth on, you need no key.

  4. Verify. Recent events on each source shows entries arriving. In Explore, pick your service under the service key and check that log lines and metric points appear together.

What you get

  • One timeline for the service, with Vercel log entries and OpenTelemetry metric values side by side on one clock.
  • One read per service. In Explore, or from a connected agent that reads that service, you get the logs and the metrics together instead of querying two systems.
  • Several Vercel projects through one drain. Each project shows up as its own entity, and each lines up with the OTel service of the same name.
  • Traces and OTel logs for the same service on the same timeline, since the OTLP source ingests all three signals under the same service label.
  • A base for triggers and agents. Once both sources share service, you can build triggers over them keyed by service, as the AI SRE guide shows.

When something else fits

  • If your app already exports its logs over OpenTelemetry, a single otlp source carries logs and metrics under one service label, and you do not need the Vercel drain for that service.
  • If the Vercel project field is sparse, check Fields on the Vercel source. You can pick a denser field as the key, or slice by source or environment.
  • If the project name and the service.name differ, align one of them first, because Tares joins on the label value.

Still stuck? Get help

Last updated on