Skip to content

Add external log exporters and fix missing external trace exporters in deployed tasks #2038

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 13, 2025

Conversation

ericallam
Copy link
Member

@ericallam ericallam commented May 12, 2025

This PR adds support for 3rd party log exporters (alongside the existing 3rd party trace exporters). This also fixes an issue where 3rd party trace exporters were not being registered in deployed tasks, and we've also fixed traceID generation in case 3rd parties expected the traceIDs to be in the exact format of the otel spec.

Summary by CodeRabbit

  • New Features

    • Added support for external log exporters, enabling logs to be sent to external monitoring systems.
    • Introduced configuration options for external trace exporters and log exporters in telemetry settings.
    • Added the ability to disable console log interception via configuration.
  • Bug Fixes

    • Resolved issues with missing external trace exporters in deployed tasks.
  • Chores

    • Updated dependencies to include OpenTelemetry log and trace exporters.
    • Enhanced logging in chat tasks for improved traceability.

Copy link

changeset-bot bot commented May 12, 2025

🦋 Changeset detected

Latest commit: 83dd40e

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

Copy link
Contributor

coderabbitai bot commented May 12, 2025

## Walkthrough

This update introduces support for external log exporters in the telemetry configuration, allowing logs from deployed tasks to be exported to external systems. It also adds a runtime toggle to disable console interception. Changes span configuration types, tracing SDK initialization, console interception logic, and example usage in a reference project, ensuring both traces and logs can be externally exported for improved observability.

## Changes

| File(s)                                                                 | Change Summary                                                                                                       |
|-------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| packages/core/src/v3/config.ts                                          | Added `logExporters` property to the `telemetry` section of `TriggerConfig` type for OpenTelemetry log exporters; added `disableConsoleInterceptor` boolean property to `TriggerConfig`. |
| packages/core/src/v3/otel/tracingSDK.ts                                 | Extended `TracingSDKConfig` with `logExporters`; added `ExternalLogRecordExporterWrapper` class; updated constructor to register external log exporters with conditional batch processing and trace ID proxying.            |
| packages/core/src/v3/consoleInterceptor.ts                             | Added `interceptingDisabled` boolean parameter to `ConsoleInterceptor` constructor; modified `intercept` method to bypass interception when disabled. |
| packages/cli-v3/src/entryPoints/dev-run-worker.ts<br>packages/cli-v3/src/entryPoints/managed-run-worker.ts | Updated tracing SDK initialization to accept and pass `logExporters` and `exporters` from config; passed `disableConsoleInterceptor` flag to `ConsoleInterceptor`.                                   |
| references/d3-chat/package.json                                         | Added dependencies: `@opentelemetry/exporter-logs-otlp-http@0.52.1` and `@opentelemetry/exporter-trace-otlp-http@0.52.1`.                                                  |
| references/d3-chat/trigger.config.ts                                    | Configured telemetry with OTLP log and trace exporters sending data to an external Axiom API endpoint with authorization headers.                                |
| references/d3-chat/src/trigger/chat.ts                                  | Added an info log statement at the start of the `interruptibleChat` task's `run` function.                         |
| .changeset/cuddly-boats-press.md                                        | Added a changeset entry summarizing the introduction of external log exporters and console interceptor toggle for improved observability.           |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant Task
    participant TracingSDK
    participant LoggerProvider
    participant ExternalLogExporter

    Task->>TracingSDK: Initialize with config (including logExporters)
    TracingSDK->>LoggerProvider: Register log exporters from config
    Task->>LoggerProvider: Emit log record
    LoggerProvider->>ExternalLogExporter: Export log record

Possibly related PRs

  • triggerdotdev/trigger.dev#1602: Adds support for custom span exporters, modifying related telemetry configuration, but does not introduce log exporter support.

Suggested reviewers

  • matt-aitken

Poem

Logs now leap where traces roam,
Exported far beyond their home.
With configs set and code aligned,
Observability’s redefined!
A rabbit cheers with twitching nose—
To logs that travel where the data flows!
🐇✨


<!-- walkthrough_end -->


---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 0c74bf37ce6ce1429010e6149b4b30ec5e168d0e and 83dd40e1316d3db167f61f0edd7c4f0c7005caf3.

</details>

<details>
<summary>⛔ Files ignored due to path filters (1)</summary>

* `pnpm-lock.yaml` is excluded by `!**/pnpm-lock.yaml`

</details>

<details>
<summary>📒 Files selected for processing (9)</summary>

* `.changeset/cuddly-boats-press.md` (1 hunks)
* `packages/cli-v3/src/entryPoints/dev-run-worker.ts` (2 hunks)
* `packages/cli-v3/src/entryPoints/managed-run-worker.ts` (2 hunks)
* `packages/core/src/v3/config.ts` (3 hunks)
* `packages/core/src/v3/consoleInterceptor.ts` (1 hunks)
* `packages/core/src/v3/otel/tracingSDK.ts` (6 hunks)
* `references/d3-chat/package.json` (1 hunks)
* `references/d3-chat/src/trigger/chat.ts` (1 hunks)
* `references/d3-chat/trigger.config.ts` (1 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (9)</summary>

* .changeset/cuddly-boats-press.md
* references/d3-chat/package.json
* references/d3-chat/src/trigger/chat.ts
* packages/cli-v3/src/entryPoints/dev-run-worker.ts
* packages/cli-v3/src/entryPoints/managed-run-worker.ts
* references/d3-chat/trigger.config.ts
* packages/core/src/v3/consoleInterceptor.ts
* packages/core/src/v3/otel/tracingSDK.ts
* packages/core/src/v3/config.ts

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms (7)</summary>

* GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
* GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
* GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
* GitHub Check: typecheck / typecheck
* GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
* GitHub Check: units / 🧪 Unit Tests
* GitHub Check: Analyze (javascript-typescript)

</details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNxU3bABsvkCiQBHbGlcABpIcVwvOkgAIgBBWnoSAA8aCgw0Xy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tbnR1owFUlYGT6798FfDIGqGfZ4bLoUGigAByZABhnqa+lycDS6H+v+0GdsKoyoO0eQEY9aVh6+D2BoOhmeblPh4CsuolHlA9I9Z5btcQJG8oU4RZHkOQJEWY0DQcpMWBlB/lEi5i+msbM6di5mtY7ip6HhDm01Q41bE+CvKYqxJEny1zZLK+CtOnQEuOokhO5RpOnIsuMHHYc8FuGOJIGwhE1unCdu4Jrunu3ergJugeNHD4dCAiOQogTIR+jmOyF3ZgLgYpvpPOXxooCsY8jJ/TKGjQA/efLuACaAfAHWXAWgCMPMPJmzAp4PAiAwAiAgWpyZ+p8vSYpplpkiEBRAdpzpqvSa3p/pwZ4ZlHZu8IaxrenJugEZ1HYPUS0dCyaSVazdbaliePdiNSLiPwNAbSbOvSAyRQIyNQEySScyAwa5tSdQf/YDRAf/fwE/YWOgf/JCsyK52iSAR4coAAFmOGRYADYAB2bFgg14EgAgggx4EgBMzoZ4FQe4codFhMgQAATnuFeHKAII7BpcZbJbhYBYRcxfuHuBIFeHRdpFpfKHuAEEeGRYksxdeAYApYEClYEATPKBpYYGpfReRZpdoATLxeeHZeuceAYExeRYEHKGeExc6HRc6AIORfuBpceEJZIHRYtZpYEANeeCJaVfxfRdeFoCJe1YRdeGeCSGRaJYIOeAIPRaZNoAEFDcxcpYIPKCJaSBNeRbjb1ceEeBJcDS1eog5YgA4nWBBbv3BaCy+hVFoH/3ojhaAA=== -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

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.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=triggerdotdev/trigger.dev&utm_content=2038):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai explain this code block.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and explain its main purpose.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
references/d3-chat/src/trigger/chat.ts (1)

230-230: Enhance startup log with additional context
Logging when interruptible-chat starts is useful; consider including extra metadata (e.g., run ID or correlation ID) to improve traceability across logs and spans.

packages/core/src/v3/config.ts (1)

83-90: Add logExporters to telemetry config schema
The new logExporters option is well-documented in the JSDoc. Remember to update your public configuration documentation to include usage examples for this property.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ccc9764 and 0f4ca46.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • .changeset/cuddly-boats-press.md (1 hunks)
  • packages/cli-v3/src/entryPoints/dev-run-worker.ts (1 hunks)
  • packages/cli-v3/src/entryPoints/managed-run-worker.ts (1 hunks)
  • packages/core/src/v3/config.ts (2 hunks)
  • packages/core/src/v3/otel/tracingSDK.ts (3 hunks)
  • references/d3-chat/package.json (1 hunks)
  • references/d3-chat/src/trigger/chat.ts (1 hunks)
  • references/d3-chat/trigger.config.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
references/d3-chat/src/trigger/chat.ts (1)
packages/core/src/v3/tracer.ts (1)
  • logger (56-64)
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: units / 🧪 Unit Tests
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (9)
references/d3-chat/package.json (1)

30-30: Add OTLP HTTP log exporter dependency
Including @opentelemetry/exporter-logs-otlp-http enables the OTLP HTTP log exporter in the reference project. Ensure this version is compatible with other OpenTelemetry packages used across the repo.

.changeset/cuddly-boats-press.md (1)

5-5: Changelog entry accurately reflects feature changes
The description clearly states the addition of external log exporters and the fix for missing external trace exporters, matching the PR objectives.

packages/cli-v3/src/entryPoints/dev-run-worker.ts (1)

167-167: Include logExporters in TracingSDK initialization
Correctly wires the new logExporters configuration into the TracingSDK, enabling external log export in the development worker.

packages/core/src/v3/config.ts (1)

14-14: Import LogRecordExporter for new config property
This import is required to type the telemetry.logExporters array. Confirm that the @opentelemetry/sdk-logs version used here matches your other OTel dependencies.

references/d3-chat/trigger.config.ts (1)

4-4: Good addition of the OpenTelemetry HTTP logs exporter.

The import of OTLPLogExporter from the OpenTelemetry HTTP logs exporter package is appropriate for the new telemetry configuration being added.

packages/cli-v3/src/entryPoints/managed-run-worker.ts (1)

166-167: Properly added support for external exporters in TracingSDK initialization.

Good implementation that passes both trace exporters and log exporters from the configuration to the TracingSDK. The code correctly handles undefined values by defaulting to empty arrays, which prevents potential runtime errors.

This change directly addresses the PR objectives to add external log exporters and fix missing external trace exporters in deployed tasks.

packages/core/src/v3/otel/tracingSDK.ts (3)

18-18: Appropriately imported LogRecordExporter.

The explicit import of LogRecordExporter from @opentelemetry/sdk-logs is needed for the type definition in the configuration.


91-91: Good extension of TracingSDKConfig.

The TracingSDKConfig type has been properly extended to include the optional logExporters array, maintaining consistency with the existing exporters property pattern.


215-226: Well-implemented external log exporter processing.

The implementation for processing external log exporters follows the same pattern used for trace exporters, ensuring consistency in the codebase. It correctly:

  1. Iterates through all provided log exporters
  2. Adds appropriate processors based on environment configuration
  3. Uses the same environment variables for batch processing configuration as the main exporter

This change properly fulfills the PR objective to support external log exporters in deployed tasks.

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.

Actionable comments posted: 0

♻️ Duplicate comments (1)
references/d3-chat/trigger.config.ts (1)

15-16: Document AXIOM_TOKEN in project documentation

The telemetry setup looks solid, but there's a need to document the required AXIOM_TOKEN environment variable in the repo's documentation.

#!/bin/bash
# Check if the AXIOM_TOKEN environment variable is documented somewhere
rg -i "AXIOM_TOKEN" --type md

Also applies to: 24-25

🧹 Nitpick comments (1)
references/d3-chat/trigger.config.ts (1)

10-29: Well-structured telemetry configuration

The telemetry configuration is properly implemented with both log and trace exporters pointing to Axiom's API. The configuration correctly:

  1. Uses environment variables for sensitive data (AXIOM_TOKEN)
  2. Specifies the appropriate dataset identifier
  3. Sets the correct Axiom API endpoints

Consider extracting the dataset name to an environment variable for better configurability across environments.

-          "X-Axiom-Dataset": "d3-chat-tester",
+          "X-Axiom-Dataset": process.env.AXIOM_DATASET || "d3-chat-tester",
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0f4ca46 and 722e86a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • .changeset/cuddly-boats-press.md (1 hunks)
  • packages/cli-v3/src/entryPoints/dev-run-worker.ts (2 hunks)
  • packages/cli-v3/src/entryPoints/managed-run-worker.ts (2 hunks)
  • packages/core/src/v3/config.ts (3 hunks)
  • packages/core/src/v3/consoleInterceptor.ts (1 hunks)
  • packages/core/src/v3/otel/tracingSDK.ts (6 hunks)
  • references/d3-chat/package.json (1 hunks)
  • references/d3-chat/src/trigger/chat.ts (1 hunks)
  • references/d3-chat/trigger.config.ts (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • references/d3-chat/src/trigger/chat.ts
  • references/d3-chat/package.json
🚧 Files skipped from review as they are similar to previous changes (5)
  • .changeset/cuddly-boats-press.md
  • packages/core/src/v3/config.ts
  • packages/cli-v3/src/entryPoints/managed-run-worker.ts
  • packages/cli-v3/src/entryPoints/dev-run-worker.ts
  • packages/core/src/v3/otel/tracingSDK.ts
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: units / 🧪 Unit Tests
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
packages/core/src/v3/consoleInterceptor.ts (2)

13-14: Well-implemented console interceptor toggle

Good addition of the interceptingDisabled parameter to the constructor. This enables the runtime toggle mentioned in the PR objectives.


20-22: Clean implementation of early return pattern

The early return pattern when intercepting is disabled is a clean and efficient approach. This ensures that when interception is disabled, we simply pass through to the callback without any overhead.

references/d3-chat/trigger.config.ts (1)

4-5: Good OpenTelemetry exporter imports

These imports correctly add the necessary dependencies for both log and trace exporters, aligning with the PR objective to support external telemetry.

@ericallam ericallam merged commit a815633 into main May 13, 2025
12 checks passed
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.

3 participants