You can now configure custom telemetry exporters in your trigger.config.ts
to send traces and logs to external services such as Axiom and Honeycomb. This is done by instantiating OTLPTraceExporter
and OTLPLogExporter
directly, specifying the endpoint URLs and any required headers.
Read more about exporting telemetry in the docs and see the v4 upgrade guide for details on how to upgrade to v4.
Example usage:
import { defineConfig } from "@trigger.dev/sdk/v3";
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
import { OTLPLogExporter } from "@opentelemetry/exporter-logs-otlp-http";
export default defineConfig({
project: "<project ref>",
url: "https://api.axiom.co/v1/logs",
Authorization: `Bearer ${process.env.AXIOM_API_TOKEN}`,
"X-Axiom-Dataset": process.env.AXIOM_DATASET,
url: "https://api.axiom.co/v1/traces",
Authorization: `Bearer ${process.env.AXIOM_API_TOKEN}`,
"X-Axiom-Dataset": process.env.AXIOM_DATASET,