Skip to content

Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.

2.6 KB
Raw Blame
To send OpenTelemetry metrics and traces generated by OpenLIT from your AI Application to an OpenTelemetry Collector **you operate**, follow the below steps.

<Info>
OpenLIT itself no longer bundles `otelcol`. The OpenLIT container already accepts OTLP on `:4317` and `:4318`. Use this page only when you want a separate Collector for processors, sampling, or fan-out. To send data **into** OpenLIT, see the [OTLP receiver](/latest/openlit/otlp-receiver).
</Info>

The OpenTelemetry Collector is a vendor-agnostic way to receive, process, and export telemetry data. It can act as an intermediary to route your OpenLIT data to multiple backends or apply processing transformations.

### 1. Deploy OpenTelemetry Collector

**Install the Collector** (choose your preferred method):

<Tabs>
  <Tab title="Docker">
  ```bash
  # Run OpenTelemetry Collector with OTLP receivers
  docker run -p 4317:4317 -p 4318:4318 \
    -v $(pwd)/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml \
    otel/opentelemetry-collector-contrib:latest
  ```
  </Tab>
  
  <Tab title="Kubernetes">
  ```bash
  # Deploy using Helm
  helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
  helm install my-otel-collector open-telemetry/opentelemetry-collector \
    --set config.receivers.otlp.protocols.grpc.endpoint="0.0.0.0:4317" \
    --set config.receivers.otlp.protocols.http.endpoint="0.0.0.0:4318"
  ```
  </Tab>
  
  <Tab title="Binary">
  ```bash
  # Download and run the collector binary
  curl -LO https://github.com/open-telemetry/opentelemetry-collector-releases/releases/latest/download/otelcol-contrib_linux_amd64.tar.gz
  tar -xzf otelcol-contrib_linux_amd64.tar.gz
  ./otelcol-contrib --config=otel-collector-config.yaml
  ```
  </Tab>
</Tabs>

**Basic Collector Configuration**:
Create an `otel-collector-config.yaml` file:

<Accordion title="Basic OTLP Configuration">
```yaml
receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318

processors:
  batch:

exporters:
  logging:
    loglevel: debug
  # Add your preferred backend exporters here
  # Examples: jaeger, prometheus, otlp, etc.

service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [logging]
    metrics:
      receivers: [otlp]
      processors: [batch]
      exporters: [logging]
```
</Accordion>

**Get the Collector Endpoint**:
- **Default HTTP endpoint**: `http://localhost:4318` or `http://your-collector-host:4318`
- **Default gRPC endpoint**: `http://localhost:4317` or `http://your-collector-host:4317`