# OTLP Logs

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.

If you're using OTel without a Sentry SDK, you can send logs directly to Sentry's OTLP endpoint. You can find your endpoint URL and auth key in [Project settings > Client Keys (DSN)](https://sentry.io/orgredirect/organizations/:orgslug/settings/projects/).

## [Configuration](https://docs.sentry.io/concepts/otlp/otlp-logs.md#configuration)

`.env`

```bash
export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT="___OTLP_LOGS_URL___"
export OTEL_EXPORTER_OTLP_LOGS_HEADERS="x-sentry-auth=sentry sentry_key=___PUBLIC_KEY___"
```

## [Using the OTel Collector](https://docs.sentry.io/concepts/otlp/otlp-logs.md#using-the-otel-collector)

You can configure your OTel collector instance to send logs to Sentry directly. This requires you to add an `otlphttp` exporter to your collector instance. Sentry's OTLP endpoints are project-specific, so you might also need to add a [routing connector](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/connector/routingconnector) to route logs to the correct project.

`otel-collector.yaml`

```yaml
exporters:
  otlphttp:
    logs_endpoint: ___OTLP_LOGS_URL___
    headers:
      x-sentry-auth: "sentry sentry_key=___PUBLIC_KEY___"
    compression: gzip
    encoding: proto
    timeout: 30s
```

## [Using an OTel SDK](https://docs.sentry.io/concepts/otlp/otlp-logs.md#using-an-otel-sdk)

You can configure the OTel Exporter directly in your application code. Here is an example with the OTel Node SDK:

`app.ts`

```typescript
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");
```

## [Known Limitations](https://docs.sentry.io/concepts/otlp/otlp-logs.md#known-limitations)

* Array attributes are partially supported. We ingest and display array attributes, but they cannot be searched, filtered, or aggregated.
