# Configure an exporter

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

## Set up with your coding agent

Open this prompt from the repository for the service you want to instrument.

```text
Set up OpenTelemetry export to Altertable for this service. Read https://altertable.ai/docs/opentelemetry/setup.md and the official documentation for the installed SDK or collector first.

Inspect the runtime, existing instrumentation, exporters, and deployment configuration. Determine which signal I need first: logs, traces, or metrics. Ask only if the signal or target environment is unclear. Reuse existing instrumentation and preserve other telemetry destinations.

Configure OTLP over HTTP, the correct signal endpoint and encoding, batching, and service resource attributes. Keep lakehouse credentials in server-side secret configuration; do not print or commit them. Confirm the target Altertable environment.

Run the project's checks and send one non-sensitive test signal. Inspect the actual schema in the opentelemetry catalog and query the matching logs, spans, or metrics. Verify the service, timestamp, and test payload rather than relying on an exporter acknowledgement. Report the changes and any deployment configuration I must complete.
```

## Goal

Authenticate an OpenTelemetry exporter, send logs, traces, or metrics 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/administration/lakehouse-credentials.md).
- Configure an OpenTelemetry SDK or collector that supports OTLP over HTTP with protobuf or JSON encoding.

## SDK and collector setup

Use the [OpenTelemetry SDK for your application language](https://opentelemetry.io/docs/languages/) or an existing collector with an OTLP/HTTP exporter. Configure instrumentation, batching, and resource attributes in the SDK or collector, then use the credentials and endpoints below.

## 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.

If the exporter provides separate username and password fields for Basic Auth, use the lakehouse credentials from **API keys & credentials** in organization settings. Use credentials from the environment that owns the OpenTelemetry catalog.

**Continue in Altertable:** [Open credentials](/app)

To build the header yourself, Base64-encode `username:password` and prefix the result with `Basic` followed by a space. The [OpenTelemetry API reference](/docs/api-references/opentelemetry.md#authentication) defines the authentication header and request format.

### 2. Choose a signal

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

### 3. Export telemetry

Configure your SDK or collector with the selected endpoint, the content type matching its encoding (`application/x-protobuf` or `application/json`), and the Basic Auth header. Start the instrumented application or collector to send a batch.

## Verification

Open [SQL Explorer](/docs/lakehouse/query/sql-explorer.md) and choose the signal you sent:

### Logs

```sql
SELECT * FROM opentelemetry.main.logs ORDER BY timestamp DESC LIMIT 10;
```

### Traces

```sql
SELECT * FROM opentelemetry.main.spans ORDER BY start_time DESC LIMIT 10;
```

### Metrics

```sql
SELECT * FROM opentelemetry.main.metrics ORDER BY timestamp DESC LIMIT 10;
```

Find your service and check that the timestamp and telemetry fields match the test signal you sent. If it is missing, use the troubleshooting checks below.

## 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, the correct signal endpoint, and a content type matching its payload.
- **Telemetry is in the wrong environment:** update the exporter credentials to those of the intended environment.

## Next steps

- [Logs](/docs/opentelemetry/logs.md): Send OpenTelemetry logs to Altertable through the OTLP HTTP logs endpoint and analyze application telemetry with SQL.
- [Traces](/docs/opentelemetry/traces.md): Send OpenTelemetry traces to Altertable through the OTLP HTTP traces endpoint and analyze spans with SQL workflows.
- [Send metrics](/docs/opentelemetry/metrics.md): Export OpenTelemetry metrics to Altertable with an SDK or collector, then verify gauge, sum, and histogram data with SQL.
- [OpenTelemetry API](/docs/api-references/opentelemetry.md): OTLP/HTTP reference for logs, traces, and metrics, including authentication, encodings, compression, and response statuses.