Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/hourly-ci-cleaner.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inputs:
required: false
default: 'false'
job-name:
description: 'Name of the job being set up. When OTEL_EXPORTER_OTLP_ENDPOINT is configured, a gh-aw.job.setup span is pushed to the OTLP endpoint.'
description: 'Name of the job being set up. When OTEL_EXPORTER_OTLP_ENDPOINT is configured, a gh-aw.<job-name>.setup span is pushed to the OTLP endpoint.'
required: false
default: ''
Comment on lines 13 to 16
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.

In this description, gh-aw.<job-name>.setup reads like it might literally include the input name (job-name) rather than the value of the job name. Elsewhere in the code/comments you use gh-aw.<jobName>...; consider using the same placeholder here (or explicitly say “”) to avoid confusion.

This issue also appears on line 23 of the same file.

Copilot uses AI. Check for mistakes.
trace-id:
Expand All @@ -23,7 +23,7 @@ outputs:
files_copied:
description: 'Number of files copied'
trace-id:
description: 'The OTLP trace ID used for the gh-aw.job.setup span. Pass this to subsequent job setup steps via the trace-id input to correlate all job spans under a single trace.'
description: 'The OTLP trace ID used for the gh-aw.<job-name>.setup span. Pass this to subsequent job setup steps via the trace-id input to correlate all job spans under a single trace.'

runs:
using: 'node24'
Expand Down
2 changes: 1 addition & 1 deletion actions/setup/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions actions/setup/js/action_conclusion_otlp.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
/**
* action_conclusion_otlp.cjs
*
* Sends a gh-aw.job.conclusion OTLP span (or a span named after the current
* job). Used by both:
* Sends a `gh-aw.<jobName>.conclusion` OTLP span (or `gh-aw.job.conclusion`
* when no job name is configured). Used by both:
*
* - actions/setup/post.js (dev/release/action mode)
* - actions/setup/clean.sh (script mode)
Expand All @@ -14,7 +14,7 @@
*
* Environment variables read:
* INPUT_JOB_NAME – job name from the `job-name` action input; when set the
* span is named "gh-aw.job.<name>", otherwise
* span is named "gh-aw.<name>.conclusion", otherwise
* "gh-aw.job.conclusion".
* GITHUB_AW_OTEL_TRACE_ID – parent trace ID (set by action_setup_otlp.cjs)
* GITHUB_AW_OTEL_PARENT_SPAN_ID – parent span ID (set by action_setup_otlp.cjs)
Expand All @@ -35,7 +35,7 @@ async function run() {
return;
}

const spanName = process.env.INPUT_JOB_NAME ? `gh-aw.job.${process.env.INPUT_JOB_NAME}` : "gh-aw.job.conclusion";
const spanName = process.env.INPUT_JOB_NAME ? `gh-aw.${process.env.INPUT_JOB_NAME}.conclusion` : "gh-aw.job.conclusion";
console.log(`[otlp] sending conclusion span "${spanName}" to ${endpoint}`);

const { sendJobConclusionSpan } = require(path.join(__dirname, "send_otlp_span.cjs"));
Expand Down
2 changes: 1 addition & 1 deletion actions/setup/js/action_otlp.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ describe("action_conclusion_otlp run()", () => {

const payload = JSON.parse(capturedBody);
const spanName = payload?.resourceSpans?.[0]?.scopeSpans?.[0]?.spans?.[0]?.name;
expect(spanName).toBe("gh-aw.job.agent");
expect(spanName).toBe("gh-aw.agent.conclusion");
fetchSpy.mockRestore();
});

Expand Down
2 changes: 1 addition & 1 deletion actions/setup/js/action_setup_otlp.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/**
* action_setup_otlp.cjs
*
* Sends a gh-aw.job.setup OTLP span and writes the trace/span IDs to
* Sends a `gh-aw.<jobName>.setup` OTLP span and writes the trace/span IDs to
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.

Header comment says this always sends gh-aw.<jobName>.setup, but sendJobSetupSpan falls back to gh-aw.job.setup when no job name is configured. Consider updating the comment to reflect the fallback behavior.

Suggested change
* Sends a `gh-aw.<jobName>.setup` OTLP span and writes the trace/span IDs to
* Sends a `gh-aw.<jobName>.setup` OTLP span when a job name is configured,
* or falls back to `gh-aw.job.setup`, and writes the trace/span IDs to

Copilot uses AI. Check for mistakes.
* GITHUB_OUTPUT and GITHUB_ENV. Used by both:
*
* - actions/setup/index.js (dev/release/action mode)
Expand Down
5 changes: 3 additions & 2 deletions actions/setup/js/send_otlp_span.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ function isValidSpanId(id) {
*/

/**
* Send a `gh-aw.job.setup` span to the configured OTLP endpoint.
* Send a `gh-aw.<jobName>.setup` span (or `gh-aw.job.setup` when no job name
* is configured) to the configured OTLP endpoint.
*
* This is designed to be called from `actions/setup/index.js` immediately after
* the setup script completes. It always returns `{ traceId, spanId }` so callers
Expand Down Expand Up @@ -363,7 +364,7 @@ async function sendJobSetupSpan(options = {}) {
const payload = buildOTLPPayload({
traceId,
spanId,
spanName: "gh-aw.job.setup",
spanName: jobName ? `gh-aw.${jobName}.setup` : "gh-aw.job.setup",
startMs,
endMs,
serviceName,
Expand Down
3 changes: 1 addition & 2 deletions actions/setup/js/send_otlp_span.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,7 @@ describe("sendJobSetupSpan", () => {

const body = JSON.parse(init.body);
const span = body.resourceSpans[0].scopeSpans[0].spans[0];
expect(span.name).toBe("gh-aw.job.setup");
// Span traceId and spanId must match the returned values
expect(span.name).toBe("gh-aw.agent.setup");
expect(span.traceId).toBe(traceId);
expect(span.spanId).toBe(spanId);

Expand Down
2 changes: 1 addition & 1 deletion actions/setup/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const fs = require("fs");
// Wrap everything in an async IIFE so that the OTLP span is fully sent before
// the cleanup deletes /tmp/gh-aw/ (which contains aw_info.json and otel.jsonl).
(async () => {
// Send a gh-aw.job.conclusion span to the configured OTLP endpoint, if any.
// Send a gh-aw.<jobName>.conclusion span to the configured OTLP endpoint, if any.
// Delegates to action_conclusion_otlp.cjs so that script mode (clean.sh) and
// dev/release mode share the same implementation. Non-fatal: errors are
// handled inside sendJobConclusionSpan via console.warn.
Comment on lines +19 to 22
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.

This comment implies the conclusion span will always be gh-aw.<jobName>.conclusion, but action_conclusion_otlp.cjs falls back to gh-aw.job.conclusion when INPUT_JOB_NAME isn’t set. Consider mentioning the fallback here to keep the comment accurate.

Suggested change
// Send a gh-aw.<jobName>.conclusion span to the configured OTLP endpoint, if any.
// Delegates to action_conclusion_otlp.cjs so that script mode (clean.sh) and
// dev/release mode share the same implementation. Non-fatal: errors are
// handled inside sendJobConclusionSpan via console.warn.
// Send a job conclusion span to the configured OTLP endpoint, if any:
// gh-aw.<jobName>.conclusion when INPUT_JOB_NAME is set, otherwise
// gh-aw.job.conclusion. Delegates to action_conclusion_otlp.cjs so that
// script mode (clean.sh) and dev/release mode share the same implementation.
// Non-fatal: errors are handled inside sendJobConclusionSpan via console.warn.

Copilot uses AI. Check for mistakes.
Expand Down
Loading