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 metrics when both sources carry the same service label. The timeline orders them on one clock, so you or your agent can see whether a metric moved after a change. You set this up with an otlp source and a github source that share one service value.
How it works
Tares builds one timeline per service from every source that carries the same label. The AI SRE guide describes it as sources labeled by service, merged on one clock.
- The OpenTelemetry connector receives OTLP metrics, logs and traces. One source covers every service, and the resource attribute
service.namebecomes theservicelabel. - The GitHub connector with a personal token polls one repository every 2 minutes by default. It reports commits, and pull requests opened, merged or closed. Commits arrive as
commitevents and pull requests aspull_requestevents. - A GitHub event carries
repoas its label by default. You add a second label namedservicewith a constant value that matches theservice.nameyour app exports. That shared value joins the change to the metric series.
Open Explore, pick the service, and the metric points, commits and pull requests appear in time order. An agent reads the same timeline through MCP, so it can check whether a metric changed after a commit landed or a pull request merged.
Set it up
- Create the OpenTelemetry source in Sources > Add source > otlp, or ask a connected agent to create an OTLP source keyed by service. It needs no required config, only the
servicelabel.
- name: otel
connector: otlp
config:
labels:
- { name: service, field: service, primary: true }- Point your exporter at Tares. Set the endpoint, and make sure the app’s
service.nameis the value you will use in step 4, for examplecheckout-api.
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:8787 # OTLP/HTTP → /v1/{logs,traces,metrics}
# or gRPC (otlp-grpc extra): OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317On a secured instance, the exporter sends an ingest-scoped API key as a Bearer Authorization header. That is needed only when Tares has auth on.
-
Add a GitHub credential. Create a fine-grained token with Metadata read, Contents read and Pull requests read. Open Settings > GitHub, choose Add a personal token, and paste it.
-
Add a source for each repository in Sources > Add source > GitHub, or with this object. The
servicelabel uses a constant that equals the OTelservice.name. Keeprepoas well if you want it as a label.
- name: checkout-api
connector: github
poll: 2m
config:
repo: acme/checkout-api
credential: github
labels:
- { name: service, const: checkout-api, primary: true }
- { name: repo, field: repo }- Verify. In Explore, pick
checkout-apiunder theservicekey. You see metric points next to commits and pull requests. Then ask your connected agent:
Use tares: what happened to checkout-api in the last 15 minutes?
The first GitHub poll imports recent commits and no old pull requests, so earlier history does not appear. Each commit’s changed files are added to its payload by default, which gives the agent more to read next to the metric.
What you get
- One timeline per service that holds metric series, commits and pull requests in time order.
- Labels on GitHub events that you can use in a trigger or read from an agent:
repo,action,author,branch,sha,title,numberandurlwhen they apply. A closed pull request that merged readsmerged. - An agent that starts from the correlated read. It can tie a metric change to a specific commit or merged pull request instead of searching GitHub separately.
- A trigger you can scope to changes. For example, a trigger on the
githubsource can fire for every merged pull request in chosen repositories, usingevent_typeequal topull_requestandactionequal tomerged. - Findings the agent writes back, which land on the same service timeline for the next investigation.
When something else fits
- If you want pushes, reviews, releases and CI runs as they happen, connect the GitHub App instead. It delivers
pushevents, notcommitevents, and covers every repository it is installed on in one source. - If your metrics come from a Prometheus server rather than OTLP, use the Prometheus connector. The same shared
servicelabel approach applies, and the AI SRE guide shows it end to end.