Conversation
|
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughDocumentation is expanded to add metrics alongside traces and logs. docs/config/config-file.mdx introduces OTLPMetricExporter imports and a new Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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 | 🟡 MinorHoneycomb example imports a package not listed in the dependency snippet.
Line 226 imports
OTLPMetricExporterfrom@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
-protopackage 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
📒 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/metricsendpoint 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.
f18805d to
1898b5f
Compare
1898b5f to
ea4e202
Compare
There was a problem hiding this comment.
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
docs/config/config-file.mdxdocs/insights/metrics.mdxdocs/insights/query.mdxdocs/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-protopackage is used and the header key isx-axiom-metrics-datasetwith the dedicatedAXIOM_METRICS_DATASETenv 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 missingpackage.jsonentry 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.
ea4e202 to
7e15372
Compare
No description provided.