Skip to content

Commit f12fa08

Browse files
committed
Adds example for exporting logs to Axiom
1 parent 00a6328 commit f12fa08

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

docs/config/config-file.mdx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,37 @@ Some ones we recommend:
137137
`@opentelemetry/instrumentation-fs` which logs all file system calls is currently not supported.
138138
</Note>
139139

140+
### Exporters
141+
142+
You can also configure custom exporters to send your telemetry data to other services. For example, you can send your logs to [Axiom](https://axiom.co/docs/guides/opentelemetry-nodejs#exporter-instrumentation-ts):
143+
144+
```ts trigger.config.ts
145+
import { defineConfig } from "@trigger.dev/sdk/v3";
146+
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-proto';
147+
148+
// Initialize OTLP trace exporter with the endpoint URL and headers
149+
const axiomExporter = new OTLPTraceExporter({
150+
url: 'https://api.axiom.co/v1/traces',
151+
headers: {
152+
'Authorization': `Bearer ${process.env.AXIOM_API_TOKEN}`,
153+
'X-Axiom-Dataset': process.env.AXIOM_DATASET
154+
},
155+
});
156+
157+
export default defineConfig({
158+
project: "<project ref>",
159+
// Your other config settings...
160+
telemetry: {
161+
instrumentations: [
162+
// Your instrumentations here
163+
],
164+
exporters: [axiomExporter],
165+
},
166+
});
167+
```
168+
169+
Make sure to set the `AXIOM_API_TOKEN` and `AXIOM_DATASET` environment variables in your project.
170+
140171
## Runtime
141172

142173
We currently only officially support the `node` runtime, but you can try our experimental `bun` runtime by setting the `runtime` option in your config file:

0 commit comments

Comments
 (0)