Direct OTLP Logs
Send OpenTelemetry logs directly to Sentry without a Sentry SDK.
This feature is currently in open beta. Please reach out to feedback-logging@sentry.io if you have feedback or questions. Features in beta are still in-progress and may have bugs. We recognize the irony.
Send logs directly from your OpenTelemetry SDK to Sentry's OTLP endpoint. You can find your endpoint URL and auth key in Project settings > Client Keys (DSN).
The simplest way to configure your OTel SDK:
.envCopied
export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT="___OTLP_LOGS_URL___"
export OTEL_EXPORTER_OTLP_LOGS_HEADERS="x-sentry-auth=sentry sentry_key=___PUBLIC_KEY___"
You can also configure the exporter directly in your application code. Here's an example with the OTel Node SDK:
app.tsCopied
import {
LoggerProvider,
BatchLogRecordProcessor,
} from "@opentelemetry/sdk-logs";
import { OTLPLogExporter } from "@opentelemetry/exporter-logs-otlp-http";
const logExporter = new OTLPLogExporter({
url: "___OTLP_LOGS_URL___",
headers: {
"x-sentry-auth": "sentry sentry_key=___PUBLIC_KEY___",
},
});
const loggerProvider = new LoggerProvider({
processors: [new BatchLogRecordProcessor(logExporter)],
});
const logger = loggerProvider.getLogger("default", "1.0.0");
- Array attributes are partially supported. We ingest and display array attributes, but they cannot be searched, filtered, or aggregated.
If you need to collect logs from infrastructure sources (files, syslog, cloud services), see the Forwarding guides.
Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").