# Send OpenTelemetry traces and logs to Lampwick

> Point any OpenTelemetry SDK or Collector at https://app.lampwick.dev over OTLP/HTTP with your project's ingest token. Spans become requests, jobs and issues.

Lampwick takes traces and logs over OTLP/HTTP, so an app in any language with an OpenTelemetry SDK can send to it without a Lampwick package. We tested [Node.js](/integrations/node/), [Next.js](/integrations/nextjs/) and [Python](/integrations/python/) end to end. Lampwick turns spans and log records into its own records, following the semantic conventions.

## What you get

| OpenTelemetry | In Lampwick |
|---|---|
| SERVER spans | **Requests**, grouped by `http.route` |
| Spans with `db.system` | **Queries** |
| HTTP client spans | **Outgoing requests** |
| CONSUMER and PRODUCER spans | **Jobs** and **Queued jobs** |
| `exception` span events | **Issues**, grouped by type and your own top stack frames |
| Log records | **Logs**, tied to their request or job |
| `enduser.id`, `user.id` | **Users** |

Queries, logs and exceptions show up under their request or job, through the span hierarchy. Other spans (middleware, router layers) are not stored and don't count as events. gRPC and metrics are not supported: use `http/protobuf` or JSON, and turn the metrics exporter off.

## Set it up

Set these environment variables for your app. The SDK adds `/v1/traces` and `/v1/logs` to the endpoint:

```dotenv
OTEL_EXPORTER_OTLP_ENDPOINT=https://app.lampwick.dev
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_EXPORTER_OTLP_HEADERS=x-lampwick-token=YOUR_PROJECT_TOKEN
OTEL_TRACES_EXPORTER=otlp
OTEL_LOGS_EXPORTER=otlp
OTEL_METRICS_EXPORTER=none
OTEL_SERVICE_NAME=shop-api
```

`YOUR_PROJECT_TOKEN` is the project's ingest token, from the **Connect your app** card on its **Settings** page. `OTEL_EXPORTER_OTLP_PROTOCOL` matters for Python and .NET, which default to gRPC. Set `service.version` in `OTEL_RESOURCE_ATTRIBUTES` and it shows as the deploy.

### Through an OpenTelemetry Collector {#collector}

Already run a Collector? Add Lampwick as an exporter:

```yaml
exporters:
  otlphttp/lampwick:
    endpoint: https://app.lampwick.dev
    headers:
      x-lampwick-token: ${env:LAMPWICK_TOKEN}
service:
  pipelines:
    traces: { receivers: [otlp], processors: [batch], exporters: [otlphttp/lampwick] }
    logs: { receivers: [otlp], processors: [batch], exporters: [otlphttp/lampwick] }
```

## Let your agent do it

```text
Send this app's OpenTelemetry traces and logs to Lampwick. Use OTLP over HTTP (http/protobuf) to https://app.lampwick.dev with the header x-lampwick-token set from the LAMPWICK_TOKEN environment variable, turn the metrics exporter off, and set OTEL_SERVICE_NAME. Keep the token out of git and the chat. Then make one request to the app and tell me which spans it exported.
```

## Next step

The [OpenTelemetry docs](/docs/opentelemetry/) have the full mapping, the limits and troubleshooting. Tested setups per language: [Node.js](/docs/node/), [Next.js](/docs/nextjs/) and [Python](/docs/python/). Each stored record counts as one event, as with [HTTP ingest](/docs/http-ingest/); the [free plan](/#pricing) has 500k events a month.
