Skip to content

feat(otel): add deployment.environment to setup span resource attributes#24747

Merged
pelikhan merged 2 commits intomainfrom
copilot/otel-advisor-add-deployment-environment
Apr 5, 2026
Merged

feat(otel): add deployment.environment to setup span resource attributes#24747
pelikhan merged 2 commits intomainfrom
copilot/otel-advisor-add-deployment-environment

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 5, 2026

sendJobSetupSpan was missing the deployment.environment resource attribute that sendJobConclusionSpan already sets — causing environment-scoped OTel queries to silently omit setup spans and breaking trace continuity in any backend that filters or groups by environment.

Changes

  • send_otlp_span.cjs: In sendJobSetupSpan, extract staged from awInfo and push deployment.environment to resourceAttributes, mirroring the conclusion span behavior:
const staged = awInfo.staged === true;
// ...
resourceAttributes.push(buildAttr("deployment.environment", staged ? "staging" : "production"));

When aw_info.json is absent (e.g., activation job's own setup span), staged defaults to false"production", matching the conclusion span's fallback behavior.

  • send_otlp_span.test.cjs: Added a staged / deployment.environment describe block under sendJobSetupSpan with three cases covering absent file, staged=true, and staged=false — mirroring the equivalent block already present for sendJobConclusionSpan.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/github/gh-aw/contents/.github%2Fworkflows%2Faudit-workflows.md
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node --experimental-import-meta-resolve --require /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/suppress-warnings.cjs --conditions node --conditions development /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/dist/workers/forks.js git _modules/.bin/giHEAD forks.js ls-r�� origin refs/heads/fallback-branch /git -bare-x8Loow main 1/x64/lib/node_m01d9c87d8f5288c8ab13e22cb7ff1058156537e9..HEAD git (http block)
  • invalid.example.invalid
    • Triggering command: /usr/lib/git-core/git-remote-https /usr/lib/git-core/git-remote-https origin https://invalid.example.invalid/nonexistent-repo.git git comm�� -m Initial commit k/_temp/uv-python-dir/git ranch main cal/bin/git git conf�� user.email test@test.com /git -b feature-branch /git /usr/lib/git-core/git (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add deployment.environment to setup span resource attributes feat(otel): add deployment.environment to setup span resource attributes Apr 5, 2026
Copilot AI requested a review from pelikhan April 5, 2026 15:39
@pelikhan pelikhan marked this pull request as ready for review April 5, 2026 15:42
Copilot AI review requested due to automatic review settings April 5, 2026 15:42
@pelikhan pelikhan merged commit 4360235 into main Apr 5, 2026
51 checks passed
@pelikhan pelikhan deleted the copilot/otel-advisor-add-deployment-environment branch April 5, 2026 15:42
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 the missing deployment.environment OpenTelemetry resource attribute to sendJobSetupSpan so setup spans can be reliably queried/grouped by environment the same way conclusion spans already are.

Changes:

  • Derive staged from aw_info.json in sendJobSetupSpan and emit deployment.environment as staging/production.
  • Add unit tests covering aw_info.json absent, staged=true, and staged=false for setup spans.
Show a summary per file
File Description
actions/setup/js/send_otlp_span.cjs Adds deployment.environment resource attribute to setup span payloads based on awInfo.staged.
actions/setup/js/send_otlp_span.test.cjs Adds test coverage ensuring deployment.environment is set correctly for setup spans across staged/unstaged/missing file cases.

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

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] add deployment.environment to setup span resource attributes

3 participants