> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sazabi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenTelemetry Metrics

> Set OTEL_EXPORTER_OTLP_METRICS_ENDPOINT to your Sazabi intake URL to store OpenTelemetry metrics as searchable log records.

[All OpenTelemetry integration capabilities](https://docs.sazabi.com/catalogs/integrations/opentelemetry)

## About

Send OpenTelemetry metrics to Sazabi and store them as searchable log records. Each metric data point becomes a record with structured fields including `metric.name`, `metric.type`, `metric.unit`, and `metric.value`, making metrics queryable alongside your logs and traces in the same thread.

This source is separate from the general [OpenTelemetry](https://docs.sazabi.com/catalogs/log-sources/send-to-an-endpoint/opentelemetry.md) source because Sazabi routes metrics to a dedicated intake path. Use this source when your SDK or collector emits metrics data.

## Prerequisites

* An application or OpenTelemetry Collector configured to emit metrics
* Your Sazabi intake URL, shown above — open the log source and copy the **Intake URL** from its setup screen (the public key is embedded in the URL).

## Set up in the dashboard

**Step 1**

### Enable or add the OpenTelemetry metrics SDK

If your application already uses an OpenTelemetry SDK, enable the metrics component. If you are using the OpenTelemetry Collector, add or confirm a `prometheus` or `hostmetrics` receiver and an `otlphttp` exporter.

**Step 2**

### Set the metrics exporter environment variables

Configure the following environment variables so they are present when the process starts:

```bash theme={"system"}
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=<your intake URL>
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
```

Your intake URL is shown above. Set `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` specifically for metrics rather than the general `OTEL_EXPORTER_OTLP_ENDPOINT` so logs and traces can target a different endpoint if needed.

**Step 3**

### Redeploy the application

Restart or redeploy the application so it picks up the new environment variables.

**Step 4**

### Hand off the change

If this configuration is version-controlled, commit it on a new branch, push it, and open a pull request. Otherwise apply it directly to your application or Collector. Keep the intake URL and any keys in environment variables or a secret store, and commit only configuration that references them.

## Set up with the CLI

You can also register the OpenTelemetry Metrics log source with the [Sazabi CLI](https://docs.sazabi.com/reference/cli.md) (installed and authenticated — see [CLI reference](https://docs.sazabi.com/reference/cli/log-sources.md)).

Registering the source mints the same intake URL the dashboard shows above (the public key is embedded in its hostname):

```bash theme={"system"}
sazabi log-sources create otel_metrics --mode manual
```

The command prints the intake URL for the new source — copy the whole URL and point your sender at it using the configuration shown above. Run `sazabi log-sources get <log-source-id>` at any time to reprint the endpoint, or `sazabi log-sources list` to see every log source in the project.

## Verify

Emit a metric from your application or trigger a metrics scrape cycle. Open the [Intake page](https://docs.sazabi.com/guides/instrument/intake.md) in the Sazabi dashboard and confirm records from the **OpenTelemetry Metrics** source appear. Records typically arrive within a minute or two, or within one export interval if your SDK batches at a longer interval.

Start a thread in the dashboard and search for `metric.name` to confirm individual metric data points are queryable.

## Troubleshooting

**No records after redeploying** — Confirm `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` is set in the correct process. Check for SDK initialization errors in application output.

**Records arrive for logs/traces but not metrics** — Verify you set `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` and not only the general `OTEL_EXPORTER_OTLP_ENDPOINT`. Some SDKs split metrics into a separate exporter that must be configured independently.

**Missing metric fields** — Histograms and summaries include `metric.count`, `metric.sum`, `metric.min`, and `metric.max` in addition to the base fields. Verify your SDK version supports those fields in OTLP exports.

## Further reading

> [card] [Intake](https://docs.sazabi.com/guides/instrument/intake.md)
>
> See per-source ingestion volume and health in the Intake page.

> [card] [Log sources](https://docs.sazabi.com/catalogs/log-sources.md)
>
> Browse the full log source catalog.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.