Telemetry exporters

Export traces and logs to external services

Eric Allam

Eric Allam

CTO, Trigger.dev

Image for Telemetry exporters

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:

trigger.config.ts

import { defineConfig } from "@trigger.dev/sdk";
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
import { OTLPLogExporter } from "@opentelemetry/exporter-logs-otlp-http";
export default defineConfig({
project: "<project ref>",
telemetry: {
instrumentations: [],
logExporters: [
new OTLPLogExporter({
url: "https://api.axiom.co/v1/logs",
headers: {
Authorization: `Bearer ${process.env.AXIOM_API_TOKEN}`,
"X-Axiom-Dataset": process.env.AXIOM_DATASET,
},
}),
],
exporters: [
new OTLPTraceExporter({
url: "https://api.axiom.co/v1/traces",
headers: {
Authorization: `Bearer ${process.env.AXIOM_API_TOKEN}`,
"X-Axiom-Dataset": process.env.AXIOM_DATASET,
},
}),
],
},
});

Deploy your first agent today

Get set up in minutes, either on your own or with your coding agent.

Get started for free