Improve opentelemetry collector #794
Draft
weiiwang01 wants to merge 7 commits into
Draft
Conversation
yanksyoon
reviewed
May 20, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the self-hosted runner’s OpenTelemetry Collector setup generated by the pre-job hook, aiming to accept locally-pushed telemetry (OTLP + Loki) and enrich it with GitHub workflow context labels before exporting to the configured upstream OTLP endpoint.
Changes:
- Extend the collector config to expose OTLP (gRPC/HTTP) and Loki HTTP receivers and add new metrics/logs/traces pipelines.
- Add GitHub workflow/run context labeling via attributes/resource processors, plus a Loki-labels transform.
- Enable
system.cpu.logical.countandsystem.cpu.physical.counthostmetrics.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
github-runner-manager/src/github_runner_manager/templates/pre-job.j2 |
Expands the generated otelcol config to add OTLP/Loki receivers, new pipelines, and richer GitHub context labels. |
docs/changelog.md |
Adds a changelog entry describing the new local telemetry endpoints and CPU-count metrics. |
Comment on lines
+160
to
+166
| endpoint: 0.0.0.0:44317 | ||
| http: | ||
| endpoint: 0.0.0.0:44318 | ||
| loki: | ||
| protocols: | ||
| http: | ||
| endpoint: 0.0.0.0:43100 |
| otlp/mimir: | ||
| endpoint: {{ otel_collector_endpoint }} | ||
| otlp/self_hosted_runner: | ||
| endpoint: "$ACTION_OTEL_EXPORTER_OTLP_ENDPOINT" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Enhanced OpenTelemetry Collector configuration in the pre-job script to properly expose local endpoints for metrics, logs, and traces collection with automatic GitHub workflow context labeling. Also adding
system.cpu.logical.countandsystem.cpu.physical.countmetrics.Why we need it
This addition allows users to more easily upload workload custom metrics, logs, and traces to the action COS. Also, this will help us understand and plan the resource usage for self-hosted runners.
Checklist
docs/changelog.mdwith user-relevant changesterraform fmtpasses andtflintreports no errorsgithub-runner-manager/pyproject.toml.