Add optional OTel trace export for step-level timing#4366
Draft
stefanpenner wants to merge 4 commits intoactions:mainfrom
Draft
Add optional OTel trace export for step-level timing#4366stefanpenner wants to merge 4 commits intoactions:mainfrom
stefanpenner wants to merge 4 commits intoactions:mainfrom
Conversation
The deduplication logic introduced in actions#4296 used StringComparer.Ordinal, so action references differing only by owner/repo casing (e.g. actions/checkout vs actIONS/checkout) were treated as distinct and downloaded multiple times. Switch to OrdinalIgnoreCase for all dedup collections and the GroupBy in GetDownloadInfoAsync. Fixes actions#3731 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
On case-sensitive filesystems (Linux), after dedup merges differently-cased references into one download, PrepareRepositoryActionAsync and LoadAction would look for directories using the original (non-canonical) casing and fail to find the action. Fix by normalizing each action step's repositoryReference.Name to match downloadInfo.NameWithOwner after dedup lookup, in both the batch and legacy code paths. Also makes the empty-dictionary return path in GetDownloadInfoAsync use OrdinalIgnoreCase for consistency. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace StringComparer.OrdinalIgnoreCase with ActionLookupKeyComparer
that treats the owner/repo portion of "{owner/repo}@{ref}" keys
case-insensitively while keeping the ref portion case-sensitive, since
git refs are case-sensitive.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When ACTIONS_RUNNER_OTLP_ENDPOINT is set, the runner emits OTel spans for each step as they complete. Spans use deterministic IDs (MD5-based) compatible with otel-explorer's GitHub Actions trace view, allowing runner step spans to merge into workflow traces with zero configuration. Attributes follow OTel CI/CD semantic conventions (cicd.pipeline.*) and include GitHub-specific fields (github.action, github.step_type, etc.). Spans are batched per job and flushed via OTLP/HTTP JSON before job completion is reported to the server. Export is best-effort — failures are silently swallowed to never impact job execution. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
OTelStepTracer— a zero-dependency, opt-in OpenTelemetry span exporter for step executionACTIONS_RUNNER_OTLP_ENDPOINTto an OTLP/HTTP base URLHow it works
ExecutionContext.Complete()), step metadata is captured into a pending spanJobRunner.CompleteJobAsync()), all pending spans are flushed as a single OTLP JSON POSTAttributes emitted
typestepsourcerunnergithub.conclusionsuccessgithub.actionactions/checkoutgithub.action_refv4github.step_typenode20cicd.pipeline.task.nameRun testscicd.pipeline.task.run.resultsuccesscicd.pipeline.run.id24741863790vcs.repository.url.fullhttps://github.com/org/repoConfiguration
ACTIONS_RUNNER_OTLP_ENDPOINThttp://collector:4318)ACTIONS_RUNNER_OTLP_INSECUREtrueto skip TLS verificationRelation to other PRs
Test plan
🤖 Generated with Claude Code