Repository navigation
Add opt-in OTLP metrics emission for per-job run observability - #78433
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
|
@copilot keep working |
|
Thanks for this. The plumbing looks solid: the fail-closed endpoint filtering is kept, per-endpoint headers are used, there's no endpoint override, the metric resource drops per-run IDs, and the JSONL mirror is in the unified artifact. I reviewed it against Dimensions
Spec alignment
Data collected but not emitted
Configuration
One open question (I haven't verified this): built-in metrics are only emitted from Happy to test the next revision against an Azure Monitor collector. |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Gated |
|
@copilot apply comments from #78433 (comment) |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Applied the linked review follow-ups in
Implemented the metric resource allowlist, job/model dimensions, documented dimensions and delta temporality, compatibility aliases, export-failure counters, exemplars, cache tokens, turns, credit counters, cancellation handling, and custom metric bounds in |
|
✅ PR Specification Reviewer completed successfully! Caution agentic threat detected DetailsPotential security threats were detected in the agent output. Detected threat types: prompt injection. Review the workflow run logs for details.
|
|
🧠 Matt Pocock Skills Reviewer is reviewing this pull request using Matt Pocock's engineering skills... |
|
✅ PR Code Quality Reviewer completed the code quality review. PR Code Quality ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Ponytail Reviewer completed successfully!
|
|
@copilot enabled by default with env var to turn off . Env var must support gh aw env command |
…-metrics-emission # Conflicts: # .github/workflows/dependabot-burner.lock.yml # scripts/dependabot-burner-selection.test.cjs Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Merged latest main in |
| */ | ||
| async function sendOTLPSpan(endpoint, payload, { maxRetries = 2, baseDelayMs = 100, skipJSONL = false, headersOverride = undefined, signal = "traces" } = {}) { | ||
| const sanitizedPayload = sanitizeOTLPPayload(payload); | ||
| async function sendOTLPSpan(endpoint, payload, { maxRetries = 2, baseDelayMs = 100, skipJSONL = false, headersOverride = undefined, signal = "traces", sanitize = sanitizeOTLPPayload } = {}) { |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Preserve the updated Dependabot tool contract, align its regression assertion, and regenerate workflow locks with the merged compiler. Validation: workflow contract tests, impacted Go and JavaScript tests, JavaScript lint, and workflow drift checks passed. The full pre-PR gate reports existing custom Go linter findings in unchanged code. Co-authored-by: Copilot App <[email protected]>
ok
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "b39d6b8cb690d2e168ba26b0b555dee851643b9b",
"kind": "requested",
"schema_version": "1",
"state": "71ba46bddd02408ae80cade3667ecc69ffca99c6ca9f2c797c294fec4fba488f",
"work": [],
"workflow": "pr-sous-chef"
}
|
|
🎉 This pull request is included in a new release. Release: |
Adds OTLP metrics alongside the existing traces/logs pipeline for job duration, failures, token usage, tool calls, and safe-output volume. Metrics are enabled by default when OTLP is configured, with an explicit opt-out.
Fixes #78427
Configuration and export
GH_AW_OTEL_METRICS: ${{ vars.GH_AW_OTEL_METRICS || 'true' }}unless workflowenvoverrides it. SetGH_AW_OTEL_METRICS: "false"to disable metrics.gh aw env get/updateexposesdefault_otel_metricsfor repository, organization, and enterprise defaults; deleting the variable restores default-on behavior. The runtime emits metrics only when the effective value is the literaltrue./v1/metricson all configured OTLP endpoints, reusing endpoint-specific headers, retries, and partial-success handling for rejected data points.http/protobuf.OTEL_EXPORTER_OTLP_METRICS_PROTOCOLtakes precedence overOTEL_EXPORTER_OTLP_PROTOCOL. Unsupported protocols and encoding errors produce diagnostics rather than silently falling back to JSON.@opentelemetry/otlp-transformeror other OpenTelemetry packages; SDK protocol types are used only for byte-for-byte conformance tests./tmp/gh-aw/otel-metrics.jsonlbefore export, regardless of wire encoding. The unified artifact includes the agent job's mirror only when metrics are enabled. Agent-job built-ins are emitted before artifact upload; other jobs' post-job metrics are exported remotely and are not included in that artifact.Built-in metrics
gh_aw.job.durationsgh_aw.job.errors{job}gen_ai.client.token.usage{token}gen_ai.token.typegh_aw.agent.turns{turn}gh_aw.tool_calls{call}gh_aw.workflow.output.items{item}gh_aw.ai.credits.limit_exceeded{event}gh_aw.ai.credits.rate_limit_errors{event}gh_aw.otlp.export.failures{failure}Counters and histograms use delta temporality. Compatibility aliases (
gh_aw.run.*,gh_aw.tokens.*, andgh_aw.safe_outputs) remain available; query canonical metrics or aliases, not both. Therunaliases still describe job-level observations.Custom instrumentation and safeguards
Exports
logMetric(name, value, { type, unit, description, attributes, buckets })fromotlp.cjsandindex.cjs. Supports gauges (default), delta counters, and explicit-bucket histograms, with per-series aggregation and a one-second flush timer.Custom metrics allow at most eight attributes and 100 unique series per process, with 128-character attribute keys/string values. High-cardinality keys identifying individual runs, jobs, traces, commits, users, issues, pull requests, conversations, or URLs are rejected. Metric resources retain only bounded repository, workflow, engine, event, and job identity; trace IDs appear in exemplars rather than metric dimensions. Shared secret redactors sanitize metric identity and string values before mirroring/export, and custom calls containing recognized credentials or configured secrets are rejected with a warning.
Compiler, documentation, and validation
mainand preserves its Dependabot workflow tool contract.