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

# OpenTelemetry SDKs

> Install the OpenTelemetry SDK for your language and point it at Mirador

Mirador ingests OTLP directly, so you instrument with the **standard OpenTelemetry SDK for your language**. There is no Mirador package to install on the server, and no proprietary API to migrate off later.

Every SDK below reads the same four environment variables:

```bash theme={null}
export OTEL_SERVICE_NAME=checkout-api
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.mirador.org
export OTEL_EXPORTER_OTLP_HEADERS=Authorization=mir_srv_xxx
```

<Info>
  Create a server key (`mir_srv_*`) on your project's **API keys** page in the Mirador dashboard. See [Authentication](/opentelemetry/overview#authentication) for the `Bearer` form and web-key rules.
</Info>

## Languages

<CardGroup cols={3}>
  <Card title="JavaScript / Node.js" icon="js" href="https://opentelemetry.io/docs/languages/js/">
    Auto-instrumentation for Express, Fastify, HTTP, gRPC, Postgres, and more
  </Card>

  <Card title="Python" icon="python" href="https://opentelemetry.io/docs/languages/python/">
    Zero-code startup via `opentelemetry-instrument`
  </Card>

  <Card title="Go" icon="golang" href="https://opentelemetry.io/docs/languages/go/">
    Explicit SDK setup with `otelhttp` and `otelgrpc` middleware
  </Card>

  <Card title="Java" icon="java" href="https://opentelemetry.io/docs/languages/java/">
    Drop-in `-javaagent` with no code changes
  </Card>

  <Card title=".NET" icon="microsoft" href="https://opentelemetry.io/docs/languages/dotnet/">
    `OpenTelemetry.Extensions.Hosting` plus OTLP exporter
  </Card>

  <Card title="Rust" icon="rust" href="https://opentelemetry.io/docs/languages/rust/">
    `opentelemetry-otlp` with the `tracing` ecosystem
  </Card>

  <Card title="Ruby" icon="gem" href="https://opentelemetry.io/docs/languages/ruby/">
    `opentelemetry-sdk` with Rails and Rack instrumentation
  </Card>

  <Card title="PHP" icon="php" href="https://opentelemetry.io/docs/languages/php/">
    Extension-based auto-instrumentation
  </Card>

  <Card title="Erlang / Elixir" icon="e" href="https://opentelemetry.io/docs/languages/erlang/">
    `opentelemetry_exporter` for BEAM services
  </Card>

  <Card title="Swift" icon="swift" href="https://opentelemetry.io/docs/languages/swift/">
    Server-side and Apple platform instrumentation
  </Card>

  <Card title="C++" icon="c" href="https://opentelemetry.io/docs/languages/cpp/">
    OTLP HTTP and gRPC exporters
  </Card>

  <Card title="Collector" icon="layer-group" href="/opentelemetry/overview#use-an-opentelemetry-collector">
    Already running a Collector? Add Mirador as an exporter
  </Card>
</CardGroup>

## Install and run

<CodeGroup>
  ```bash Node.js theme={null}
  npm install @opentelemetry/sdk-node \
              @opentelemetry/auto-instrumentations-node \
              @opentelemetry/exporter-trace-otlp-http

  export OTEL_SERVICE_NAME=checkout-api
  export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
  export OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.mirador.org
  export OTEL_EXPORTER_OTLP_HEADERS=Authorization=mir_srv_xxx

  node --require @opentelemetry/auto-instrumentations-node/register app.js
  ```

  ```bash Python theme={null}
  pip install opentelemetry-distro opentelemetry-exporter-otlp
  opentelemetry-bootstrap -a install

  export OTEL_SERVICE_NAME=checkout-api
  export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
  export OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.mirador.org
  export OTEL_EXPORTER_OTLP_HEADERS=Authorization=mir_srv_xxx

  opentelemetry-instrument python app.py
  ```

  ```bash Go theme={null}
  go get go.opentelemetry.io/otel \
         go.opentelemetry.io/otel/sdk \
         go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp

  export OTEL_SERVICE_NAME=checkout-api
  export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
  export OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.mirador.org
  export OTEL_EXPORTER_OTLP_HEADERS=Authorization=mir_srv_xxx

  go run .
  ```

  ```bash Java theme={null}
  curl -L -O https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar

  export OTEL_SERVICE_NAME=checkout-api
  export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
  export OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.mirador.org
  export OTEL_EXPORTER_OTLP_HEADERS=Authorization=mir_srv_xxx

  java -javaagent:./opentelemetry-javaagent.jar -jar app.jar
  ```

  ```bash .NET theme={null}
  dotnet add package OpenTelemetry.Extensions.Hosting
  dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol
  dotnet add package OpenTelemetry.Instrumentation.AspNetCore

  export OTEL_SERVICE_NAME=checkout-api
  export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
  export OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.mirador.org
  export OTEL_EXPORTER_OTLP_HEADERS=Authorization=mir_srv_xxx

  dotnet run
  ```

  ```bash Ruby theme={null}
  bundle add opentelemetry-sdk opentelemetry-exporter-otlp opentelemetry-instrumentation-all

  export OTEL_SERVICE_NAME=checkout-api
  export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
  export OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.mirador.org
  export OTEL_EXPORTER_OTLP_HEADERS=Authorization=mir_srv_xxx

  bundle exec ruby app.rb
  ```
</CodeGroup>

<Note>
  With `OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.mirador.org`, standards-compliant HTTP exporters append `/v1/traces`, `/v1/metrics`, and `/v1/logs` automatically. Signal-specific variables such as `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` must include the full path.
</Note>

## Add web3 correlation

Once telemetry is flowing, emit a reserved `mirador.*` span event when an external action starts. Mirador follows the action and stitches its outcome back into the same trace, which is how on-chain and off-chain steps end up on one timeline.

<CodeGroup>
  ```typescript TypeScript theme={null}
  span.addEvent('mirador.web3.evm.txhint', {
    'tx.hash': transactionHash,
    'chain.id': 8453, // or 'base'
  });
  ```

  ```python Python theme={null}
  span.add_event("mirador.web3.evm.txhint", {
      "tx.hash": transaction_hash,
      "chain.id": 8453,
  })
  ```

  ```go Go theme={null}
  span.AddEvent("mirador.web3.evm.txhint", trace.WithAttributes(
      attribute.String("tx.hash", transactionHash),
      attribute.Int64("chain.id", 8453),
  ))
  ```
</CodeGroup>

EVM, Solana, Canton, Safe, Relay, Stripe, and market rates are supported. See [Enrichment hints](/opentelemetry/enrichment-hints) for the full event catalog and required attributes.

## Next steps

<CardGroup cols={2}>
  <Card title="OpenTelemetry overview" icon="circle-nodes" href="/opentelemetry/overview">
    Endpoints, authentication, and Collector setup
  </Card>

  <Card title="Enrichment hints" icon="wand-magic-sparkles" href="/opentelemetry/enrichment-hints">
    Track on-chain and external actions from OTel spans
  </Card>

  <Card title="Logs" icon="rectangle-list" href="/opentelemetry/logs">
    Export structured logs and correlate them with traces
  </Card>

  <Card title="Web SDK" icon="browser" href="/web-sdk/overview">
    Browser telemetry with wallet and provider capture
  </Card>
</CardGroup>
