Skip to content

Expand OTLP metrics reference documentation - #79082

Merged
pelikhan merged 5 commits into
mainfrom
copilot/fix-otlp-metrics-documentation
Nov 18, 2026
Merged

pelikhan merged 5 commits into
mainfrom
copilot/fix-otlp-metrics-documentation

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

The OTLP metrics documentation lacked a complete built-in metrics reference and details on custom metrics, batching, failure reporting, resource attributes, and secret screening. It also incorrectly described metrics as opt-in.

  • Built-in metrics: Add metric names, types, units, attributes, emission conditions, and compatibility mappings.
  • Custom metrics: Document logMetric() parameters, validation, cardinality limits, batching, and series merging.
  • Export and security: Explain export-failure counting, metric resource attribute filtering, and secret redaction.
  • Enablement: Clarify that metrics are enabled by default when OTLP is configured.
await logMetric("my-tool.items_processed", 42, {
  type: "counter",
  unit: "{item}",
  attributes: { "my-tool.result": "ok" },
});

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@pelikhan pelikhan changed the title [WIP] Fix documentation gaps in OTLP metrics Expand OTLP metrics reference documentation Nov 18, 2026
@pelikhan
pelikhan marked this pull request as ready for review November 18, 2026 18:11
Copilot AI adaptive review requested due to automatic review settings November 18, 2026 18:11
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

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.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 7.2K · ◷

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The documentation still contains two active accuracy and usability issues: it misstates the units for error aliases and omits the exact result attribute key and metric names.

2 open issues
What changed in this PR

Expands the OpenTelemetry metrics reference to document built-in and custom metrics, default enablement, export behavior, batching, resource filtering, and secret handling.

Changes:

  • Documents built-in metric names, types, units, attributes, emission conditions, and compatibility aliases.
  • Adds logMetric() validation, cardinality limits, batching, and series-merging behavior.
  • Clarifies export-failure reporting, resource attribute filtering, and secret screening.
File Description
docs/​src/​content/​docs/​reference/​open-telemetry.mdx Expands the OTLP metrics reference with built-in and custom instrumentation details, enablement behavior, export handling, batching, resource filtering, and security constraints.

Review effort: Lite (adaptive)


The built-ins include `gh_aw.job.duration` (histogram, `s`) and `gh_aw.job.errors` (counter, `{job}` for failed, timed-out, and cancelled jobs), `gen_ai.client.token.usage` (counter, `{token}`, by `gen_ai.token.type` for input, output, cache-read, and cache-write tokens), `gh_aw.agent.turns` (histogram, `{turn}`), `gh_aw.tool_calls` (counter, `{call}`, by `gh-aw.tool.status`), and `gh_aw.workflow.output.items` (counter, `{item}`, by `gh-aw.safe_output.type`). AI-credit limit and rate-limit errors and OTLP export failures are also counted when known.
Built-in metrics are emitted at job completion. Counters and histograms use delta temporality; durations and counts are job-level measurements.
Unless noted, built-in metrics include `gh-aw.job.name` and `gh-aw.workflow.name` when available. Compatibility metrics use their corresponding metric's type, unit, and attributes, with the run metrics using the run conclusion as noted below.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Updated in 9964484: gh_aw.job.errors uses {job}, while gh_aw.run.errors uses {run}.

Comment on lines +402 to +403
| `gh_aw.job.duration` | Histogram, `s` | Job result, job and workflow names, and (when known) engine and model; emitted for each completed job. |
| `gh_aw.job.errors` | Counter, `{job}` | Job result; emitted for `failure`, `timed_out`, or `cancelled` jobs. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Updated in 9964484: the reference now names cicd.pipeline.task.run.result, gh-aw.job.name, and gh-aw.workflow.name explicitly, including the run-alias mapping.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (docs/src/content/docs/reference/open-telemetry.mdx:398): address unresolved feedback - Review comment
  3. Review (docs/src/content/docs/reference/open-telemetry.mdx:403): address unresolved feedback - Review comment

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "9b8904459fdcda34cab6c3f5b232184d46901a8f",
  "kind": "requested",
  "schema_version": "1",
  "state": "317a359d3f93fe90837d39926a0e36e23b7972db550510c5caffdf05bafc67a0",
  "work": [
    "efc3000fd30e8423ece7d83c8c0c27c060ccecaad77ad969f62ce51270eebd02",
    "f84946e795d2153d225d0a19b77e43f598b3022c7113d8ed231552c8ae79aceb"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ⊞ 7K · ◷
Comment /souschef to run again

gh-aw-bot and others added 3 commits November 18, 2026 18:51
…ics-documentation

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Copilot AI requested a review from gh-aw-bot November 18, 2026 19:06
@pelikhan
pelikhan merged commit b904591 into main Nov 18, 2026
29 checks passed
@pelikhan
pelikhan deleted the copilot/fix-otlp-metrics-documentation branch November 18, 2026 19:14
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.

OTLP metrics documentation gaps — built-in metrics, logMetric API, batching, security

4 participants