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

> ## Agent Instructions
> Sherlock documentation. In Node.js examples prefer the Sherlock SDK for Node.js (@sherlock-labs/otel).
> In Go examples use the upstream OpenTelemetry Go SDK exactly as shown on /sdk/go/setup and /sdk/go/configuration; Sherlock has no Go distribution.
> Two MCP servers exist. This documentation's search server is at https://sherlock-c8721ead.mintlify.app/mcp. Sherlock's data server, for a user's own logs, traces, and metrics, is at https://mcp.sherlocklabs.dev/mcp and is described at /explore/mcp.

# OpenTelemetry SDKs and collectors

> Point any OTLP/HTTP exporter at Sherlock: endpoint, bearer token, and the env attribute. This is also how logs arrive.

Sherlock ingests OTLP over HTTP. Any OpenTelemetry SDK or an OpenTelemetry Collector can send to it with three settings.

| Setting            | Value                                                                                                                                                                                                  |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Endpoint           | The ingest URL from **Settings → Collector**. It differs by organization, so copy it rather than typing it. The signal paths `/v1/logs`, `/v1/traces`, and `/v1/metrics` are appended by the exporter. |
| Header             | `Authorization: Bearer <token>`, the Bearer Token from **Settings → Collector**.                                                                                                                       |
| Resource attribute | `env=<value>`. Sherlock routes data into a source by this value.                                                                                                                                       |

## OpenTelemetry Collector

Use a collector when you run many services, or when you want logs from files and container output. **Settings → Collector** shows the exporter section with your endpoint and a copy button. The snippet there reads the token from the collector's environment variable `OTEL_EXPORTER_BEARER_TOKEN`, so the token stays out of the config file.

```yaml theme={null}
exporters:
  otlphttp:
    endpoint: <endpoint>   # Settings → Collector
    headers:
      Authorization: "Bearer <token>"
```

A complete collector configuration adds receivers, the `env` attribute, and pipelines:

```yaml theme={null}
receivers:
  otlp:
    protocols:
      http:
        endpoint: 0.0.0.0:4318

processors:
  resource:
    attributes:
      - key: env
        value: prod
        action: upsert
  batch: {}

exporters:
  otlphttp:
    endpoint: <endpoint>   # Settings → Collector
    headers:
      Authorization: "Bearer <token>"

service:
  pipelines:
    logs:
      receivers: [otlp]
      processors: [resource, batch]
      exporters: [otlphttp]
    traces:
      receivers: [otlp]
      processors: [resource, batch]
      exporters: [otlphttp]
    metrics:
      receivers: [otlp]
      processors: [resource, batch]
      exporters: [otlphttp]
```

To collect logs from files or containers, add a `filelog` receiver to the logs pipeline. The collector documentation describes its options.

## Other OpenTelemetry SDKs

Every OpenTelemetry SDK reads the same environment variables once its OTLP/HTTP exporter is set up. Set them and the exporter sends to Sherlock.

```sh theme={null}
export OTEL_EXPORTER_OTLP_ENDPOINT='<endpoint>'   # Settings → Collector
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer <token>"
export OTEL_SERVICE_NAME=checkout-api
export OTEL_RESOURCE_ATTRIBUTES=env=prod
```

Sherlock accepts OTLP/HTTP in protobuf and in JSON. Exemplars on histograms depend on the SDK. The [Sherlock SDK for Node.js](/sdk/nodejs/overview) sends them by default. For Go, add `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=delta` and `OTEL_METRICS_EXEMPLAR_FILTER=always_on`, plus one short file for the `trace_flags` attribute. The environment variant on [Go setup](/sdk/go/setup) shows that route; the other variant sets the same things in code.

## What to expect

* **Logs** appear within about a minute. The empty Logs page repeats the three settings until then.
* **Traces** appear within seconds of the exporter's batch. The Traces list shows traces with more than one span, so send a request that makes at least one nested call.
* **Metrics** appear after the sender's first export interval. The metric catalog refreshes every 60 seconds.

## Related topics

<CardGroup cols={2}>
  <Card title="Get started" icon="rocket" href="/get-started/getting-started">
    Credentials, the env value, and first data.
  </Card>

  <Card title="Node.js SDK" icon="node" href="/sdk/nodejs/overview">
    The distribution with exemplars.
  </Card>
</CardGroup>
