Skip to content

feat(otel): enrich resource attributes with service.version, github.repository, github.run_id, github.event_name#24659

Merged
pelikhan merged 2 commits intomainfrom
copilot/otel-improvement-enrich-resource-attributes
Apr 5, 2026
Merged

feat(otel): enrich resource attributes with service.version, github.repository, github.run_id, github.event_name#24659
pelikhan merged 2 commits intomainfrom
copilot/otel-improvement-enrich-resource-attributes

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 5, 2026

buildOTLPPayload only set service.name as a resource attribute, causing github.repository, github.run_id to be repeated on every span (wasting bytes), and making it impossible to filter traces by gh-aw version or trigger event in backends like Grafana/Honeycomb/Datadog.

Changes

  • buildOTLPPayload: Accepts new optional resourceAttributes parameter; promotes scopeVersionservice.version resource attribute (omitted when value is "unknown"); merges caller-supplied resource attributes into the resource block

  • sendJobSetupSpan / sendJobConclusionSpan: Read GITHUB_EVENT_NAME; pass github.repository, github.run_id, and github.event_name (when set) as resource attributes

  • Tests: Updated send_otlp_span.test.cjs and action_otlp.test.cjs to assert all new resource attributes are present/absent under the correct conditions

Result payload shape

resource: {
  attributes: [
    { key: "service.name",       value: { stringValue: "gh-aw" } },
    { key: "service.version",    value: { stringValue: "v1.2.3" } },   // ← new
    { key: "github.repository",  value: { stringValue: "owner/repo" } }, // ← new
    { key: "github.run_id",      value: { stringValue: "123456789" } }, // ← new
    { key: "github.event_name",  value: { stringValue: "pull_request" } }, // ← new (when set)
  ]
}

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/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GO111MODULE ache/go/1.25.8/x--show-toplevel git rev-�� --show-toplevel ache/go/1.25.8/x64/pkg/tool/linustatus /usr/bin/git 2692225/b043/_pkgit edcfg .cfg git (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GO111MODULE k/gh-aw/gh-aw/ac--show-toplevel git rev-�� --show-toplevel go /usr/bin/git 1759-60268/test-git GO111MODULE /opt/hostedtoolc--show-toplevel /usr/bin/git (http block)
  • https://api.github.com/orgs/test-owner/actions/secrets
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name go1.25.8 -c=4 -nolocalimports -importcfg /tmp/go-build3065263728/b396/importcfg -pack /tmp/go-build3065263728/b396/_testmain.go env -json go 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name "prettier" --wriGOINSECURE git 64/bin/go --show-toplevel git /usr/bin/git go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name go1.25.8 -c=4 -nolocalimports -importcfg /tmp/go-build2135580204/b396/importcfg -pack /tmp/go-build2135580204/b396/_testmain.go env ath ../../../.pr**/*.json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha --show-toplevel x_amd64/compile /usr/bin/git -json GO111MODULE 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linu-buildtags /usr/bin/git g_.a GO111MODULE 64/pkg/tool/linu--show-toplevel /usr/bin/git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha --show-toplevel go 1/x64/bin/node -json GO111MODULE 64/bin/go 1/x64/bin/node conf�� epository }} Test User /usr/bin/git -json GO111MODULE 64/bin/node git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha se 5263728/b113/vet.cfg ache/node/24.14.1/x64/bin/node /tmp/go-build247git -trimpath 64/bin/go infocmp t-18�� k/gh-aw/gh-aw/.github/workflows/audit-workflows.md tcbQ_Ihm_uaw /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/compile -json GO111MODULE 64/bin/go /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha xterm-color -extld=gcc 1/x64/bin/node -json GO111MODULE 64/bin/go 1/x64/bin/node /tmp�� e: ${{ secrets.TOKEN }} go /usr/bin/git -json GO111MODULE 64/bin/go git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha g_.a yi2fVdpoL ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile GOINSECURE tants GOMODCACHE ache/go/1.25.8/xrepos/{owner}/{repo}/actions/runs/12345/artifacts env caoUaHMyX GO111MODULE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile GOINSECURE fips140deps/goderev-parse GOMODCACHE ortcfg (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha xterm-color 64/pkg/tool/linu--auto /usr/bin/git g_.a GO111MODULE x_amd64/vet git rev-�� --show-toplevel x_amd64/vet /usr/bin/git g_.a dAR9m3zY_ 64/pkg/tool/linu--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel 64/pkg/tool/linu/tmp/go-build3065263728/b448/_testmain.go /usr/bin/git ipts.test -trimpath ortcfg.link git rev-�� --show-toplevel 9FX53sm1OTZ6jdpoJ_/CWrYu2czG7Ca7-importcfg /usr/bin/gh g/cli -trimpath g_.a gh (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha -b test-branch /usr/bin/git -json 8601/parse.go x_amd64/compile git conf�� user.email test@example.com /usr/bin/git -json GO111MODULE x_amd64/link git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --show-current resolved$ /usr/bin/git -json 2/compile.go x_amd64/compile git init�� GOMODCACHE x_amd64/compile /usr/bin/git -json GO111MODULE 64/pkg/tool/linu--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha -aw-actions/git/ref/tags/v1.0.0 ache/go/1.25.8/x-tests /usr/bin/git se 5263728/b127/vetrev-parse e/git-upload-pac--show-toplevel git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linu--jq /usr/bin/git /tmp/go-build358git k/gh-aw/gh-aw/pkrev-parse /opt/hostedtoolc--show-toplevel git (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha go1.25.8 -c=4 -nolocalimports -importcfg /tmp/go-build3582692225/b246/importcfg -pack /home/REDACTED/go/pkg/mod/golang.org/x/text@v0.35.0/internal/internal.go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE x_amd64/asm GOINSECURE GOMOD GOMODCACHE x_amd64/asm (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha user.email test@example.com /opt/hostedtoolcache/node/24.14.1/x64/bin/node -json 1.4.1/internal/mrev-parse x_amd64/compile node /tmp�� /home/REDACTED/work/gh-aw/gh-aw/.github/workflows/blog-auditor.md x_amd64/compile /usr/bin/git -json GO111MODULE x_amd64/link git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha /repos/actions/github-script/git/ref/tags/v8 --jq /usr/bin/git le-frontmatter.mgit GO111MODULE odules/npm/node_--show-toplevel git add test.txt go /usr/bin/git 1 GO111MODULE 64/bin/go git (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha GOMODCACHE x_amd64/compile /usr/bin/git 345 4/arm64.go x_amd64/compile git rev-�� --show-toplevel x_amd64/compile /usr/bin/git -json GO111MODULE x_amd64/compile git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha /tmp/shared-actions-test2523147720 remote /usr/bin/git y-frontmatter.mdgit GO111MODULE 64/bin/go git conf�� user.name Test User /usr/bin/git ty-test.md GO111MODULE x_amd64/vet git (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha 999 BJGJRDpSI4wKt0zQSK0W/BJGJRDpSI4wKt0zQSK0W .git -goversion go1.25.8 -c=4 git-upload-pack /tmp�� /tmp/go-build3582692225/b089/importcfg (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha log.showsignature=false 5580204/b421/_testmain.go /bin/sh ntent.md --format=format:rev-parse --end-of-options--show-toplevel /bin/sh -c git-receive-pack '/tmp/TestParseDefaultBranchFromLsRemoteWithRealGitmaster_branch3024548749/001'git git-receive-pack '/tmp/TestParseDefaultBranchFromLsRemoteWithRealGitmaster_branch3024548749/001'rev-parse /usr/bin/git --write ../../../**/*.jsrev-parse 64/bin/go git (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0.1.2
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq .object.sha run --auto r,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,disp--show-toplevel --detach flow-ci-test-678rev-parse x_amd64/compile git rev-�� --show-toplevel x_amd64/compile /usr/bin/git -json GO111MODULE x_amd64/vet git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq .object.sha --show-toplevel go /usr/bin/git -json GO111MODULE 64/bin/go git conf�� user.name s/1/artifacts /usr/bin/git 488043/001 GO111MODULE layTitle git (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq .object.sha -unreachable=false /tmp/go-build3065263728/b127/vet.cfg /usr/lib/git-core/git-upload-pack go1.25.8 -c=4 -nolocalimports git-upload-pack /tmp�� -pack l /usr/bin/git --check scripts/**/*.js 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq .object.sha runs/20260405-041759-60268/test-2594029505/.github/workflows node /usr/bin/git --write scripts/**/*.js 64/bin/go git add . node /usr/bin/git --write ../../../**/*.jsrev-parse 64/bin/go git (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq .object.sha -x c /usr/bin/git - -symabis /tmp/go-build358--show-toplevel git ls-r�� --symref origin /usr/bin/git --check scripts/**/*.js 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq .object.sha runs/20260405-041759-60268/test-2594029505/.github/workflows node /tmp/go-build2135580204/b414/gitutil.test --write scripts/**/*.js 64/bin/go /tmp/go-build2135580204/b414/gitutil.test -tes�� -test.paniconexit0 (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/1/artifacts --jq .artifacts[].name oding@v0.5.4/ascii/equal_fold.go 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD abis 64/pkg/tool/linuTest User env g_.a uVfRvwDwi x_amd64/link GOINSECURE on GOMODCACHE x_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 verutil.go 64/pkg/tool/linux_amd64/compile GOINSECURE iat abis 64/pkg/tool/linux_amd64/compile env 1224884809 gNtEbmW0N ache/go/1.25.8/x64/pkg/tool/linux_amd64/asm GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/asm (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/1/artifacts --jq .artifacts[].name GO111MODULE de/node/bin/sh GOINSECURE GOMOD GOMODCACHE go env y_with_repos_array_c2847461081/001 GO111MODULE 1/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12345/artifacts --jq .artifacts[].name GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE bug GOMODCACHE 64/pkg/tool/linux_amd64/compile env b/workflows ne_constants.go 64/pkg/tool/linux_amd64/vet GOINSECURE bidirule GOMODCACHE 64/pkg/tool/linuremote.origin.url (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 @v1.1.3/cpu/arm64/arm64.go 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env g_.a rrG8ct2Bi 64/pkg/tool/linux_amd64/compile GOINSECURE (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12345/artifacts --jq .artifacts[].name GO111MODULE tions/setup/js/node_modules/.bin/sh GOINSECURE GOMOD GOMODCACHE go env y_only_defaults_repo563958456/001 GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12346/artifacts --jq .artifacts[].name mLsRemoteWithRealGitbranch_with_hyphen3705161995/001' 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env b/workflows AUUx1O_e3 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 LsRemoteWithRealGitbranch_with_hyphen3705161995/001' 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env l.go l_test.go 64/pkg/tool/linux_amd64/compile GOINSECURE go-sdk/internal/rev-parse GOMODCACHE 64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12346/artifacts --jq .artifacts[].name GO111MODULE tions/setup/node_modules/.bin/sh GOINSECURE GOMOD GOMODCACHE go env y_only_defaults_repo563958456/001 GO111MODULE ndor/bin/sh GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/2/artifacts --jq .artifacts[].name oding@v0.5.4/json/codec.go 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD abis 64/pkg/tool/linutest@example.com env g_.a xpQFH7LFx stants.test GOINSECURE GOMOD GOMODCACHE stants.test (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 /semver/semver.go 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linuTest User env 1224884809 DfcRFzBGz 64/pkg/tool/linux_amd64/vet GOINSECURE go-sdk/jsonrpc GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/2/artifacts --jq .artifacts[].name GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env ithout_min-integrity3877270637/001 GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/3/artifacts --jq .artifacts[].name GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD abis 64/pkg/tool/linux_amd64/compile 64/s�� g_.a 5-yTJqrnP util.test GOINSECURE GOMOD GOMODCACHE util.test (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE mic_wasm.o 64/src/internal/--show-toplevel 64/pkg/tool/linux_amd64/compile env g_.a yZeOx_cnJ 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/3/artifacts --jq .artifacts[].name GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env ithout_min-integrity3877270637/0remote.origin.url GO111MODULE 86_64/node GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/4/artifacts --jq .artifacts[].name ZW5eqtFbR 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env g_.a B-Au8vNkW 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 4/apic.go 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env 1224884809 cuiX4cYAj ache/go/1.25.8/x64/pkg/tool/linux_amd64/asm GOINSECURE erutil GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/asm (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/4/artifacts --jq .artifacts[].name mLsRemoteWithRealGitcustom_branch3345157201/001' ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env '**/*.ts' '**/*.json' --ignore-path ../../../.pr**/*.json GO111MODULE n-dir/node GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/5/artifacts --jq .artifacts[].name 0/internal/tag/tag.go 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD abis 64/pkg/tool/linux_amd64/compile env til.go o 64/pkg/tool/linux_amd64/compile GOINSECURE gset GOMODCACHE 64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 rotocol/go-sdk@v1.4.1/jsonrpc/jsonrpc.go 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linutest@example.com env 1224884809 bt7zDc9ZF ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linuremote.origin.url (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/5/artifacts --jq .artifacts[].name GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env ithout_min-integrity3877270637/001 GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path /tmp/go-build247-p (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100 GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 GOMOD GOMODCACHE 64/pkg/tool/linu/tmp/go-build3065263728/b451/_testmain.go env mpiledOutput1473536077/001 GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD abis 64/pkg/tool/linux_amd64/vet (http block)
  • 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 . n-dir/git forks.js rev-�� --reverse origin/fallback-branch..HEAD cal/bin/git -m Initial commit /usr/local/sbin/f90dee0625dccf99261a9281c089696ebdd7ae4f..HEAD /usr/lib/git-cor--stdout (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v0.47.4
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq .object.sha --show-toplevel -tests /usr/bin/git g_.a DW6KATJ4J 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/compile /usr/bin/git 69/001/test-fron/bin/sh v4b3viMTA ache/go/1.25.8/xgit-upload-pack 'origin' git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq .object.sha --show-toplevel go ache/node/24.14.1/x64/bin/node mpiledOutput9416git GO111MODULE x_amd64/link ache/node/24.14.1/x64/bin/node s-92�� ets.TOKEN }} x_amd64/link /usr/bin/git g_.a GO111MODULE 64/pkg/tool/linugit-upload-pack 'origin' git (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha mpiledOutput2024171384/001 GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE move_wasm.o 64/src/runtime/m--show-toplevel 64/pkg/tool/linux_amd64/vet env -json sYAOo28ie ache/go/1.25.8/x64/pkg/tool/linux_amd64/asm GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/asm (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha -json GO111MODULE ode_modules/.bin/sh GOINSECURE GOMOD GOMODCACHE go env on' --ignore-path ../../../.prettierignore GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile 9007�� -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go 3991�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE iptables -w -t security 64/bin/go OUTPUT -d 168.63.129.16 go (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v2.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha -json 1.4.1/oauthex/oamain x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env Gitmain_branch2919007848/001' Gitmain_branch2919007848/001' x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha d d/cpuid.go x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v3.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha re GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE iptables -w -t security _modules/.bin/sh OUTPUT -d 168.63.129.16 go (http block)
  • https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha edOutput851941607/001 GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE obyte 64/src/runtime/r--show-toplevel 64/pkg/tool/linux_amd64/vet env 1337652569/001 57OuoO-7M ache/go/1.25.8/x64/pkg/tool/linux_amd64/asm GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/asm (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha -json GO111MODULE es/.bin/sh GOINSECURE GOMOD GOMODCACHE go env b/workflows GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/nonexistent/repo/actions/runs/12345
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE GOMOD GOMODCACHE go estl�� til.go til_test.go ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu/tmp/file-tracker-test292972458/test2.lock.yml (http block)
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE GOMOD GOMODCACHE go env */*.ts' '**/*.json' --ignore-path ../../../.pret.prettierignore GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE GOMOD GOMODCACHE node /opt�� run lint:cjs 5580204/b410/vet.cfg GOSUMDB GOWORK 64/bin/go sh (http block)
  • https://api.github.com/repos/owner/repo/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go -p main -lang=go1.25 go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo -importcfg /tmp/go-build3065263728/b413/importcfg -pack /home/REDACTED/work/gh-aw/gh-aw/pkg/gitutil/gitutil.go /home/REDACTED/work/gh-aw/gh-aw/pkg/gitutil/gitutil_test.go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go --ignore-path ../../../.pretti-c ache/node/24.14."prettier" --check '**/*.cjs' '**/*.ts' '**/*.json' --ignore-path ../../../.pret.prettierignore go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/owner/repo/contents/file.md
    • Triggering command: /tmp/go-build3065263728/b396/cli.test /tmp/go-build3065263728/b396/cli.test -test.testlogfile=/tmp/go-build3065263728/b396/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true -importcfg /tmp/go-build3582692225/b214/importcfg -pack /home/REDACTED/go/pkg/mod/github.com/segmentio/encoding@v0.5.4/json/codec.go -o /tmp/go-build247-p -trimpath 64/bin/go -p main -lang=go1.25 go (http block)
    • Triggering command: /tmp/go-build703102912/b396/cli.test /tmp/go-build703102912/b396/cli.test -test.testlogfile=/tmp/go-build703102912/b396/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true tierignore /usr/lib/git-corenv /usr/bin/git node /hom�� --write ../../../**/*.jsGOMOD 64/bin/go --ignore-path ../../../.pretti-c /usr/bin/git go (http block)
    • Triggering command: /tmp/go-build2135580204/b396/cli.test /tmp/go-build2135580204/b396/cli.test -test.testlogfile=/tmp/go-build2135580204/b396/testlog.txt -test.paniconexit0 -test.timeout=10m0s -c npx prettier --wGOINSECURE 64/pkg/tool/linuGOMOD 64/bin/go -json GO111MODULE 64/pkg/tool/linu-json go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/test-owner/test-repo/actions/secrets
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name /tmp/go-build247-I -trimpath 64/bin/go -p github.com/githu-o -lang=go1.25 go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name "prettier" --wriGOINSECURE git 64/bin/go --show-toplevel git ache/node/24.14."prettier" --check '**/*.cjs' '**/*.ts' '**/*.json' --ignore-path ../../../.prettierignore go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name go1.25.8 -c=4 -nolocalimports -importcfg /tmp/go-build2135580204/b402/importcfg -pack /tmp/go-build2135580204/b402/_testmain.go env ath ../../../.pr**/*.json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (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 lure test commit e_modules/.bin/git -b main ode_modules/.bin-b git conf�� user.email test@test.com /git -b feature-branch odules/npm/node_agent-change.txt git (dns block)

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

…ository, github.run_id, github.event_name

- Extend OTLPSpanOptions typedef with resourceAttributes optional field
- buildOTLPPayload promotes scopeVersion to service.version resource attr
- buildOTLPPayload merges caller-supplied resourceAttributes into resource block
- sendJobSetupSpan reads GITHUB_EVENT_NAME and passes github.repository,
  github.run_id, github.event_name as resource attributes
- sendJobConclusionSpan applies same resource attribute additions
- Update tests to assert new resource attributes

Fixes #[issue]

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/b798b274-af7d-4ae5-8566-b2711bfa8a0f

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Enrich resource attributes with service.version and GitHub details feat(otel): enrich resource attributes with service.version, github.repository, github.run_id, github.event_name Apr 5, 2026
Copilot AI requested a review from pelikhan April 5, 2026 04:21
@pelikhan pelikhan marked this pull request as ready for review April 5, 2026 04:22
Copilot AI review requested due to automatic review settings April 5, 2026 04:22
@pelikhan pelikhan merged commit a173ab2 into main Apr 5, 2026
112 of 155 checks passed
@pelikhan pelikhan deleted the copilot/otel-improvement-enrich-resource-attributes branch April 5, 2026 04:22
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

Enhances OTLP span export to include additional OpenTelemetry resource attributes (service version and GitHub Actions metadata) to reduce per-span repetition and improve trace filtering in backends.

Changes:

  • Extend buildOTLPPayload to support extra resourceAttributes and map scopeVersion into service.version (omitted when "unknown").
  • Add github.repository, github.run_id, and optional github.event_name as resource attributes for job setup/conclusion spans.
  • Update tests to assert presence/absence of the new resource attributes under various conditions.
Show a summary per file
File Description
actions/setup/js/send_otlp_span.cjs Adds resource attribute support in OTLP payload builder and populates GitHub-related resource attributes in emitted spans.
actions/setup/js/send_otlp_span.test.cjs Adds/updates unit tests covering service.version behavior and resource-attribute propagation for setup/conclusion spans.
actions/setup/js/action_otlp.test.cjs Adds integration-style test asserting resource attributes are present in the setup span payload.

Copilot's findings

Tip

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

  • Files reviewed: 3/3 changed files
  • Comments generated: 3

attributes.push(buildAttr("gh-aw.engine.id", engineId));
}

const resourceAttributes = [buildAttr("github.repository", repository), buildAttr("github.run_id", runId)];
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

github.repository and github.run_id resource attributes are always added even when the corresponding env vars are unset (empty string). This produces resource attributes with empty values; prefer only adding these attributes when the env vars are non-empty (similar to how gh-aw.engine.id is conditional).

Suggested change
const resourceAttributes = [buildAttr("github.repository", repository), buildAttr("github.run_id", runId)];
const resourceAttributes = [];
if (repository) {
resourceAttributes.push(buildAttr("github.repository", repository));
}
if (runId) {
resourceAttributes.push(buildAttr("github.run_id", runId));
}

Copilot uses AI. Check for mistakes.
attributes.push(buildAttr("gh-aw.agent.conclusion", agentConclusion));
}

const resourceAttributes = [buildAttr("github.repository", repository), buildAttr("github.run_id", runId)];
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

Same as in setup span: github.repository / github.run_id are always included as resource attributes even when empty. Consider conditionally adding them only when the env vars are present to avoid emitting empty-valued resource attributes.

Suggested change
const resourceAttributes = [buildAttr("github.repository", repository), buildAttr("github.run_id", runId)];
const resourceAttributes = [];
if (repository) {
resourceAttributes.push(buildAttr("github.repository", repository));
}
if (runId) {
resourceAttributes.push(buildAttr("github.run_id", runId));
}

Copilot uses AI. Check for mistakes.
Comment on lines +144 to +164
let capturedBody;
const fetchSpy = vi.spyOn(global, "fetch").mockImplementation((_url, opts) => {
capturedBody = opts?.body;
return Promise.resolve(new Response(null, { status: 200 }));
});

await runSetup();

const payload = JSON.parse(capturedBody);
const resourceAttrs = payload?.resourceSpans?.[0]?.resource?.attributes ?? [];
expect(resourceAttrs).toContainEqual({ key: "github.repository", value: { stringValue: "owner/repo" } });
expect(resourceAttrs).toContainEqual({ key: "github.run_id", value: { stringValue: "111222333" } });
expect(resourceAttrs).toContainEqual({ key: "github.event_name", value: { stringValue: "workflow_dispatch" } });

fetchSpy.mockRestore();
} finally {
fs.rmSync(tmpOut, { force: true });
delete process.env.GITHUB_REPOSITORY;
delete process.env.GITHUB_RUN_ID;
delete process.env.GITHUB_EVENT_NAME;
}
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

fetchSpy.mockRestore() is called inside the try block; if an assertion fails or runSetup() throws, the spy may not be restored and can leak into subsequent tests. Move the restore into the finally block (and guard it if needed).

Copilot uses AI. Check for mistakes.
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: enrich resource attributes with service.version, github.repository, github.run_id, and github.event_name

3 participants