feat: add gh-aw.agent.execute OpenTelemetry span around agentic engine execution#24654
Closed
feat: add gh-aw.agent.execute OpenTelemetry span around agentic engine execution#24654
Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/efaac737-c0ed-4e78-82df-05c1a0a0a220 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…e execution Agent-Logs-Url: https://github.com/github/gh-aw/sessions/efaac737-c0ed-4e78-82df-05c1a0a0a220 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
pelikhan
April 5, 2026 03:35
View session
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
Adds an OpenTelemetry
gh-aw.agent.executespan aroundRunWorkflowOnGitHub, the function that triggers an agentic workflow on GitHub Actions from the CLI.Changes
New package:
pkg/telemetryTracer()— returns thegh-awnamed tracer via the global OTelTracerProviderInitTracerProvider(ctx)— configures a batching OTLP HTTPTracerProviderwhenOTEL_EXPORTER_OTLP_ENDPOINTis set in the environment; returns a no-op shutdown function otherwise so callers can alwaysdefer shutdown(ctx)without a nil checkpkg/cli/run_workflow_execution.goRunWorkflowOnGitHubnow starts agh-aw.agent.executespan at its entry point and ends it (viadefer) when the function returnsworkflow(name/ID),engine(override if any),repo(target repository)cmd/gh-aw/main.goruncommand'sRunEcallstelemetry.InitTracerProviderbefore dispatching the workflow; the TracerProvider is flushed and shut down when the command returnsDependencies
go.opentelemetry.io/otel/sdkfrom indirect → direct at v1.40.0go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttpat v1.40.0go.opentelemetry.io/otel,otel/metric, andotel/tracefrom v1.39.0 → v1.40.0 to fix a PATH-hijacking vulnerability (GHSA) present in v1.39.0 of the SDKBehaviour
OTEL_EXPORTER_OTLP_ENDPOINTunsetOTEL_EXPORTER_OTLP_ENDPOINT=https://…gh-aw.agent.executespans via OTLP HTTP to the configured endpointStandard OTel environment variables (
OTEL_EXPORTER_OTLP_HEADERS,OTEL_SERVICE_NAME, etc.) are respected automatically by the SDK.