OpenTelemetry with AllStak
Ship your existing OpenTelemetry spans to AllStak with the AllStak OTel exporter (beta). This is an OpenTelemetry SpanExporter, not a standalone SDK.
- Source repository:
- AllStak/allstak-otel
- Source README:
- README.md
- SDK version:
- 0.1.2
- Installation source:
- npm
- Last verified:
- 2026-05-31
Installation
Install the exporter with the OpenTelemetry Node SDK and auto-instrumentations.
npm install @allstak/otel @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-nodeConfiguration
Use AllStakOtelExporter as the traceExporter of a NodeSDK.
import { NodeSDK } from '@opentelemetry/sdk-node';
import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';
import { AllStakOtelExporter } from '@allstak/otel';
const sdk = new NodeSDK({
traceExporter: new AllStakOtelExporter({
apiKey: process.env.ALLSTAK_API_KEY!,
environment: process.env.NODE_ENV ?? 'production',
release: process.env.ALLSTAK_RELEASE,
serviceName: 'api',
}),
instrumentations: [getNodeAutoInstrumentations()],
});
sdk.start();Basic example
You can also use the exporter directly (it implements the OTel SpanExporter contract).
const exporter = new AllStakOtelExporter({ apiKey: process.env.ALLSTAK_API_KEY!, serviceName: 'worker' });
exporter.export([span], (result) => {
if (result.code !== 0) console.error(result.error);
});
await exporter.forceFlush();Capturing errors
This package converts and ships OpenTelemetry spans — it has no captureException-style API. Error and request spans come from your OpenTelemetry instrumentation (e.g. auto-instrumentations-node), and the exporter sends them to AllStak.
Tracking requests
Request/HTTP spans are produced by OpenTelemetry's auto-instrumentations (a peer install), not by this package — the exporter only converts OTel spans to OTLP JSON and ships them to AllStak.
Best practices
- Install the OpenTelemetry SDK + auto-instrumentations alongside this exporter.
- Provide the API key via ALLSTAK_API_KEY.
- Set serviceName, environment, and release on the exporter.