Skip to Content

How do I show GitHub commits and pull requests against OpenTelemetry metric series?

Tares puts GitHub commits and pull requests on the same timeline as your OpenTelemetry metric series when both sources carry the same primary service label. The timeline orders the change and the metric points by time, so you or an agent can check whether the metric moved after the change. You set this up with an otlp source and a github source.

How it works

Tares builds one timeline per service from every source that carries the same primary label.

  • The OpenTelemetry connector receives OTLP metrics, logs and traces. One source takes every service. The service label reads resourceAttributes.service.name.
  • The GitHub connector brings in pull requests, and commits when you use a personal token. With a token, Tares polls every 2 minutes by default, with one source per repository. With the GitHub App, pushes and pull requests arrive by webhook.
  • Both sources name a label service and mark it primary. Events with the same value land on the same timeline, merged on one clock.
  • An agent reads that timeline and sees the commit or pull request next to the metric points before and after it.

OTLP events have no bare service field, so the OTLP label must read resourceAttributes.service.name. GitHub events carry labels such as repo, action, author, sha and title. A constant service label on the GitHub source gives its events the same value your OTel SDK reports as service.name.

Set it up

  1. Start Tares and open the console. Install it first with uv tool install tares or brew install glassflow/tap/tares if you have not.
tares up
  1. Add an otlp source. The service label comes from the resource attribute and is primary.
- name: otel connector: otlp config: labels: - { name: service, field: resourceAttributes.service.name, primary: true }
  1. Point your exporter or OpenTelemetry Collector at Tares. The same endpoint carries metrics, logs and traces.
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

When Tares has auth on, the exporter sends a Bearer Authorization header holding an ingest-scoped API key.

  1. Add a GitHub credential under Settings > GitHub with Add a personal token. Give the token Metadata read, Contents read and Pull requests read.

  2. Add a github source for the repository that builds the service. Give it a service label with a constant value equal to the service.name your app exports, and mark it primary. Keep the repo label too, so each event shows its repository.

- name: checkout-api connector: github poll: 2m config: repo: acme/checkout-api credential: github labels: - { name: service, const: checkout, primary: true } - { name: repo, field: repo }
  1. Open Explore and pick the service. Metric points, commits and pull requests appear in time order. Use Recent events on the otlp source to confirm points arrive, and Explore lists services under the service key.

  2. Ask a connected agent to check the order, for example: Use tares: did the checkout metrics change after the last pull request? See Build an AI SRE for connecting an MCP client and waking an agent from a trigger.

What you get

  • One timeline per service with metric points, commits and pull requests merged on one clock.
  • A direct way to see whether a metric moved after a change, since each commit or pull request sits between the metric points before and after it.
  • GitHub fields on every change event, such as author, sha, title, branch and action, so the agent can name which change landed when.
  • The same events for a token or the App. A pull request event has the same labels either way, so a trigger on event_type pull_request keeps working if you switch.
  • No per-service setup on the OTel side. One otlp source covers every service that exports.

When something else fits

  • If your changes are deploys rather than commits, a webhook source with a primary service label puts each deploy on the same timeline, and the AI SRE guide shows how.
  • If you want pushes, reviews, releases and CI runs across every repository in one source, connect the GitHub App instead of a token. Commits then arrive as pushes.
  • If your metrics live in Prometheus rather than OTel, use the prometheus connector with the same service label.

Still stuck? Get help

Last updated on