# OpenTelemetry

Configure OpenTelemetry SDKs or collectors to send OTLP/HTTP protobuf data to Altertable. Logs and traces are written into the built-in `opentelemetry` catalog for the target environment.

## Goal

Authenticate an OpenTelemetry exporter, send logs or traces to Altertable, and verify the accepted telemetry with SQL.

## Prerequisites

- Enable [OpenTelemetry](/docs/opentelemetry.md) for the target environment.
- Have access to the target environment’s [lakehouse credentials](/docs/lakehouse/authentication.md).
- Configure an OpenTelemetry SDK or collector that supports OTLP over HTTP with protobuf encoding.

Altertable accepts logs and traces. Metrics are not supported yet.

## Steps

### 1. Configure authentication

OpenTelemetry uses HTTP Basic Auth with your environment’s lakehouse credentials. Copy this header into your SDK or collector configuration:

```http
Authorization: Basic {{BASE64_TOKEN}}
```

The token is already Base64-encoded. If your exporter has separate header name and value fields, use `Authorization` as the name and `Basic <token>` as the value.

See [Authentication](/docs/ingest-data/opentelemetry/authentication.md) to use a username and password or learn how the header is built.

### 2. Choose a signal

- [Send logs](/docs/ingest-data/opentelemetry/logs.md) to `POST https://api.altertable.ai/v1/logs`.
- [Send traces](/docs/ingest-data/opentelemetry/traces.md) to `POST https://api.altertable.ai/v1/traces`.

### 3. Export telemetry

Configure your SDK or collector with the selected endpoint, `Content-Type: application/x-protobuf`, and the Basic Auth header. Start the instrumented application or collector to send a batch.

## Verification

Query the table for the signal you sent:

```sql
SELECT * FROM opentelemetry.main.logs LIMIT 10;
SELECT * FROM opentelemetry.main.spans LIMIT 10;
```

Run only the relevant statement if you configured one signal. Confirm that the returned service and telemetry fields match the application or collector that sent the batch.

## Troubleshooting

- **The exporter receives an authentication error:** rebuild the Basic Auth header with credentials from the same environment as the OpenTelemetry catalog.
- **No rows appear:** confirm that the exporter uses OTLP/HTTP protobuf, the correct signal endpoint, and `Content-Type: application/x-protobuf`.
- **Metrics fail to export:** send logs or traces instead; Altertable does not support OpenTelemetry metrics yet.
- **Telemetry is in the wrong environment:** update the exporter credentials to those of the intended environment.

## Next steps

- [Authentication](/docs/ingest-data/opentelemetry/authentication.md): Authenticate OpenTelemetry OTLP requests to Altertable with Lakehouse HTTP Basic Auth credentials for logs and traces ingestion.
- [Logs](/docs/ingest-data/opentelemetry/logs.md): Send OpenTelemetry logs to Altertable through the OTLP HTTP logs endpoint and analyze application telemetry with SQL.
- [Traces](/docs/ingest-data/opentelemetry/traces.md): Send OpenTelemetry traces to Altertable through the OTLP HTTP traces endpoint and analyze spans with SQL workflows.
- [Metrics](/docs/ingest-data/opentelemetry/metrics.md): OpenTelemetry metrics ingestion is not supported yet; learn what Altertable currently accepts and how to send logs and traces instead.