Skip to content

Comments

docs: otel metrics#3096

Merged
ericallam merged 7 commits intomainfrom
docs/otel-metrics
Feb 20, 2026
Merged

docs: otel metrics#3096
ericallam merged 7 commits intomainfrom
docs/otel-metrics

Conversation

@ericallam
Copy link
Member

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Feb 19, 2026

⚠️ No Changeset found

Latest commit: 0466146

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 19, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Documentation is expanded to add metrics alongside traces and logs. docs/config/config-file.mdx introduces OTLPMetricExporter imports and a new metricExporters configuration (Axiom protobuf endpoint and Honeycomb examples), updates dependency references to include @opentelemetry/exporter-metrics-otlp-proto, and clarifies environment variables such as AXIOM_METRICS_DATASET. docs/insights/metrics.mdx gains an "Available metrics data" section describing automatic and Node.js runtime metrics and custom metrics via OpenTelemetry. docs/insights/query.mdx adds metrics table column docs and formatting examples. docs/logging.mdx is updated to include a full Metrics section with instruments, examples, querying, and exporting guidance.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is entirely missing, lacking all required sections: Closes issue, Checklist, Testing, Changelog, and Screenshots. Add a complete pull request description following the repository template, including issue reference, checklist confirmation, testing details, and a changelog summary.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'docs: otel metrics' is concise and clearly summarizes the main change: adding OpenTelemetry metrics documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/otel-metrics

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]

This comment was marked as resolved.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/config/config-file.mdx (1)

222-265: ⚠️ Potential issue | 🟡 Minor

Honeycomb example imports a package not listed in the dependency snippet.

Line 226 imports OTLPMetricExporter from @opentelemetry/exporter-metrics-otlp-http, but the shared package.json only lists @opentelemetry/exporter-metrics-otlp-proto. A user installing the listed dependencies and then following the Honeycomb example will encounter a module-not-found error at runtime.

This inconsistency is unnecessary since Honeycomb supports OTLP/HTTP with protobuf encoding. Use the same -proto package for Honeycomb metrics as the Axiom example (lines 222-250) to maintain a single dependency and consistent examples.

Proposed fix
-import { OTLPMetricExporter } from "@opentelemetry/exporter-metrics-otlp-http";
+import { OTLPMetricExporter } from "@opentelemetry/exporter-metrics-otlp-proto";
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/config/config-file.mdx` around lines 222 - 265, The Honeycomb example
imports OTLPMetricExporter from "@opentelemetry/exporter-metrics-otlp-http"
which doesn't match the documented/shared dependencies; replace that import to
use "@opentelemetry/exporter-metrics-otlp-proto" (same package used in the Axiom
example) so OTLPMetricExporter is sourced from the -proto package, keeping
examples and package.json consistent and avoiding a runtime module-not-found
error.
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8651e16 and f18805d.

📒 Files selected for processing (1)
  • docs/config/config-file.mdx
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger.config.ts : Configure OpenTelemetry instrumentations and exporters in trigger.config.ts for enhanced logging
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/otel-metrics.mdc:0-0
Timestamp: 2026-01-08T15:57:09.323Z
Learning: Applies to **/*.ts : When exporting OTEL metrics via OTLP to Prometheus, be aware that the exporter automatically adds unit suffixes to metric names (e.g., 'my_duration_ms' becomes 'my_duration_ms_milliseconds', 'my_counter' becomes 'my_counter_total'). Account for these transformations when writing Grafana dashboards or Prometheus queries
📚 Learning: 2026-01-08T15:57:09.323Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/otel-metrics.mdc:0-0
Timestamp: 2026-01-08T15:57:09.323Z
Learning: Applies to **/*.ts : When exporting OTEL metrics via OTLP to Prometheus, be aware that the exporter automatically adds unit suffixes to metric names (e.g., 'my_duration_ms' becomes 'my_duration_ms_milliseconds', 'my_counter' becomes 'my_counter_total'). Account for these transformations when writing Grafana dashboards or Prometheus queries

Applied to files:

  • docs/config/config-file.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger.config.ts : Configure OpenTelemetry instrumentations and exporters in trigger.config.ts for enhanced logging

Applied to files:

  • docs/config/config-file.mdx
📚 Learning: 2026-01-08T15:57:09.323Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/otel-metrics.mdc:0-0
Timestamp: 2026-01-08T15:57:09.323Z
Learning: Applies to **/*.ts : Do not use high-cardinality attributes in OTEL metrics such as UUIDs/IDs (envId, userId, runId, projectId, organizationId), unbounded integers (itemCount, batchSize, retryCount), timestamps (createdAt, startTime), or free-form strings (errorMessage, taskName, queueName)

Applied to files:

  • docs/config/config-file.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use logger methods (debug, log, info, warn, error) from `trigger.dev/sdk/v3` for structured logging in tasks

Applied to files:

  • docs/config/config-file.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger.config.ts : Specify runtime environment (node or bun) in trigger.config.ts using the `runtime` property

Applied to files:

  • docs/config/config-file.mdx
🔇 Additional comments (2)
docs/config/config-file.mdx (2)

157-169: Clear and accurate Axiom protobuf caveat.

The note correctly warns users about the protobuf-only requirement for Axiom's /v1/metrics endpoint and the dependency listing is consistent with this guidance.


205-213: Axiom metrics exporter config looks correct now.

The header (x-axiom-metrics-dataset), environment variable (AXIOM_METRICS_DATASET), and import (@opentelemetry/exporter-metrics-otlp-proto) are all consistent and match Axiom's requirements.

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@docs/config/config-file.mdx`:
- Around line 222-265: The Honeycomb example imports OTLPMetricExporter from
"@opentelemetry/exporter-metrics-otlp-http" which doesn't match the
documented/shared dependencies; replace that import to use
"@opentelemetry/exporter-metrics-otlp-proto" (same package used in the Axiom
example) so OTLPMetricExporter is sourced from the -proto package, keeping
examples and package.json consistent and avoiding a runtime module-not-found
error.

---

Duplicate comments:
In `@docs/config/config-file.mdx`:
- Around line 267-268: Add a short example and brief note: show creating a
PeriodicExportingMetricReader with a custom exportIntervalMillis and passing it
into the SDK's metricReaders array (refer to PeriodicExportingMetricReader and
metricReaders), and add a one-line warning that OTLP→Prometheus exports may
append unit suffixes (e.g., my_counter → my_counter_total). Ensure the example
demonstrates instantiating PeriodicExportingMetricReader with
exportIntervalMillis and including that instance in metricReaders so users can
copy/paste.

@ericallam ericallam changed the title docs: custom metrics exporters for otel metrics docs: otel metrics Feb 20, 2026
coderabbitai[bot]

This comment was marked as resolved.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1898b5f and ea4e202.

📒 Files selected for processing (4)
  • docs/config/config-file.mdx
  • docs/insights/metrics.mdx
  • docs/insights/query.mdx
  • docs/logging.mdx
✅ Files skipped from review due to trivial changes (1)
  • docs/insights/query.mdx
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/logging.mdx
  • docs/insights/metrics.mdx
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/otel-metrics.mdc:0-0
Timestamp: 2026-01-08T15:57:09.323Z
Learning: Applies to **/*.ts : When creating or editing OTEL metrics (counters, histograms, gauges), ensure metric attributes have low cardinality by using only enums, booleans, bounded error codes, or bounded shard IDs
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/otel-metrics.mdc:0-0
Timestamp: 2026-01-08T15:57:09.323Z
Learning: Applies to **/*.ts : Do not use high-cardinality attributes in OTEL metrics such as UUIDs/IDs (envId, userId, runId, projectId, organizationId), unbounded integers (itemCount, batchSize, retryCount), timestamps (createdAt, startTime), or free-form strings (errorMessage, taskName, queueName)
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger.config.ts : Configure OpenTelemetry instrumentations and exporters in trigger.config.ts for enhanced logging
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/otel-metrics.mdc:0-0
Timestamp: 2026-01-08T15:57:09.323Z
Learning: Applies to **/*.ts : When exporting OTEL metrics via OTLP to Prometheus, be aware that the exporter automatically adds unit suffixes to metric names (e.g., 'my_duration_ms' becomes 'my_duration_ms_milliseconds', 'my_counter' becomes 'my_counter_total'). Account for these transformations when writing Grafana dashboards or Prometheus queries
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger.config.ts : Configure OpenTelemetry instrumentations and exporters in trigger.config.ts for enhanced logging

Applied to files:

  • docs/config/config-file.mdx
📚 Learning: 2026-01-08T15:57:09.323Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/otel-metrics.mdc:0-0
Timestamp: 2026-01-08T15:57:09.323Z
Learning: Applies to **/*.ts : When exporting OTEL metrics via OTLP to Prometheus, be aware that the exporter automatically adds unit suffixes to metric names (e.g., 'my_duration_ms' becomes 'my_duration_ms_milliseconds', 'my_counter' becomes 'my_counter_total'). Account for these transformations when writing Grafana dashboards or Prometheus queries

Applied to files:

  • docs/config/config-file.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger.config.ts : Use build extensions in trigger.config.ts (additionalFiles, additionalPackages, aptGet, prismaExtension, etc.) to customize the build

Applied to files:

  • docs/config/config-file.mdx
📚 Learning: 2026-01-08T15:57:09.323Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/otel-metrics.mdc:0-0
Timestamp: 2026-01-08T15:57:09.323Z
Learning: Applies to **/*.ts : Do not use high-cardinality attributes in OTEL metrics such as UUIDs/IDs (envId, userId, runId, projectId, organizationId), unbounded integers (itemCount, batchSize, retryCount), timestamps (createdAt, startTime), or free-form strings (errorMessage, taskName, queueName)

Applied to files:

  • docs/config/config-file.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use logger methods (debug, log, info, warn, error) from `trigger.dev/sdk/v3` for structured logging in tasks

Applied to files:

  • docs/config/config-file.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger.config.ts : Configure build process in trigger.config.ts using `build` object with external packages, extensions, and JSX settings

Applied to files:

  • docs/config/config-file.mdx
📚 Learning: 2025-11-27T16:26:37.432Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T16:26:37.432Z
Learning: Applies to packages/trigger-sdk/**/*.{ts,tsx} : In the Trigger.dev SDK (packages/trigger-sdk), prefer isomorphic code like fetch and ReadableStream instead of Node.js-specific code

Applied to files:

  • docs/config/config-file.mdx
🔇 Additional comments (4)
docs/config/config-file.mdx (4)

167-172: LGTM — clear and accurate note about Axiom's encoding constraint.


208-216: LGTM — Axiom metrics configuration correctly fixed.

Both previously flagged issues are now resolved: the correct @opentelemetry/exporter-metrics-otlp-proto package is used and the header key is x-axiom-metrics-dataset with the dedicated AXIOM_METRICS_DATASET env var.


221-223: LGTM — env var guidance is accurate and the OTEL_ conflict warning is useful.*


257-265: Honeycomb metrics block is technically correct.

Honeycomb supports OTLP over gRPC, HTTP/protobuf, and HTTP/JSON, so @opentelemetry/exporter-metrics-otlp-http (JSON encoding) works here. The only outstanding issue is the missing package.json entry noted above.

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@docs/config/config-file.mdx`:
- Around line 159-165: The package.json snippet is missing
`@opentelemetry/exporter-metrics-otlp-http` which the Honeycomb example imports;
either add "@opentelemetry/exporter-metrics-otlp-http": "<version>" to the
dependencies list in the shown package.json block, or change the Honeycomb
example import to use "@opentelemetry/exporter-metrics-otlp-proto" so the
examples are consistent; update the package.json snippet and the Honeycomb
import reference (the dependency names
"@opentelemetry/exporter-metrics-otlp-http" and
"@opentelemetry/exporter-metrics-otlp-proto" appear in the docs) accordingly.

coderabbitai[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@ericallam ericallam merged commit 6765252 into main Feb 20, 2026
8 checks passed
@ericallam ericallam deleted the docs/otel-metrics branch February 20, 2026 16:51
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.

2 participants