Skip to content

Add gh-aw.staged and deployment.environment to OTLP conclusion spans#24711

Merged
pelikhan merged 2 commits intomainfrom
copilot/otel-improvement-add-staged-flag
Apr 5, 2026
Merged

Add gh-aw.staged and deployment.environment to OTLP conclusion spans#24711
pelikhan merged 2 commits intomainfrom
copilot/otel-improvement-add-staged-flag

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 5, 2026

awInfo.staged was read nowhere in sendJobConclusionSpan, making it impossible for OTLP backends to distinguish dry-run executions from production runs — polluting failure metrics and firing alerts on staged noise.

Changes

  • send_otlp_span.cjssendJobConclusionSpan:

    • Reads awInfo.staged === true into a staged boolean
    • Pushes gh-aw.staged (bool) to span attributes
    • Pushes deployment.environment ("staging" | "production") to resourceAttributes, following OTel semantic conventions
  • send_otlp_span.test.cjs — new describe("staged / deployment.environment") covering:

    • staged absent → gh-aw.staged=false, deployment.environment="production"
    • awInfo.staged=truegh-aw.staged=true, deployment.environment="staging"
    • awInfo.staged=falsegh-aw.staged=false, deployment.environment="production"
// After reading other awInfo fields:
const staged = awInfo.staged === true;

// Span attribute
attributes.push(buildAttr("gh-aw.staged", staged));

// Resource attribute (OTel semantic convention)
resourceAttributes.push(buildAttr("deployment.environment", staged ? "staging" : "production"));

Reads awInfo.staged in sendJobConclusionSpan and propagates it as:
- gh-aw.staged (boolean) in span attributes
- deployment.environment ("staging"/"production") in resource attributes

Adds tests for both staged=true and staged=false cases.

Fixes #<issue>

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/f78bba75-eeb5-4ffa-abe4-0c55ae22c8f6

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add staged flag to OTLP spans in job conclusion Add gh-aw.staged and deployment.environment to OTLP conclusion spans Apr 5, 2026
Copilot AI requested a review from pelikhan April 5, 2026 11:34
@github-actions github-actions bot mentioned this pull request Apr 5, 2026
@pelikhan pelikhan marked this pull request as ready for review April 5, 2026 14:51
Copilot AI review requested due to automatic review settings April 5, 2026 14:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds explicit “staged vs production” signals to OTLP job conclusion spans so observability backends can separate dry-run noise from real runs.

Changes:

  • Read awInfo.staged into a boolean and emit gh-aw.staged span attribute.
  • Emit deployment.environment resource attribute as "staging"/"production" based on staged.
  • Add unit tests covering default behavior and both awInfo.staged boolean cases.
Show a summary per file
File Description
actions/setup/js/send_otlp_span.cjs Adds gh-aw.staged span attribute and deployment.environment resource attribute in sendJobConclusionSpan.
actions/setup/js/send_otlp_span.test.cjs Adds test coverage validating staged and environment attributes across staged unset/true/false.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

@pelikhan pelikhan merged commit 9023ef4 into main Apr 5, 2026
66 of 67 checks passed
@pelikhan pelikhan deleted the copilot/otel-improvement-add-staged-flag branch April 5, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[otel-advisor] OTel improvement: add deployment.environment and gh-aw.staged to conclusion spans

3 participants