Ingesting telemetry using OpenTelemetry Collector

Ingest Collector

OpenTelemetry Collectoropen in new window is an agent that pulls telemetry data from systems you want to monitor and sends it to tracing toolsopen in new window using the OpenTelemetry protocol (OTLP).

You can use OpenTelemetry Collector to monitor host metricsopen in new window, PostgreSQL, MySQL, Redis, and more.

Out of the box, Uptrace accepts data from OpenTelemetry Collector using OTLP and automatically creates dashboards for the available metrics.

Sending data from Collector to Uptrace

If you are already using OpenTelemetry Collectoropen in new window, you can configure it to send data to Uptrace using OpenTelemetry Protocol (OTLP).

TIP

Don't forget to add Uptrace exporter to service.pipelines section. Unused receivers and exporters are silently ignored.

Cloud

To send data to Uptrace Cloudopen in new window:

processors:
  resourcedetection:
    detectors: [env, system]
  cumulativetodelta:
  batch:
    send_batch_size: 10000
    timeout: 10s

exporters:
  otlp/uptrace:
    endpoint: otlp.uptrace.dev:4317
    headers:
      uptrace-dsn: 'https://token@api.uptrace.dev/project_id'

service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlp/uptrace]
    metrics:
      receivers: [otlp]
      processors: [cumulativetodelta, batch, resourcedetection]
      exporters: [otlp/uptrace]
    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlp/uptrace]
processors:
  resourcedetection:
    detectors: [env, system]
  cumulativetodelta:
  batch:
    send_batch_size: 10000
    timeout: 10s

exporters:
  otlphttp/uptrace:
    endpoint: https://otlp.uptrace.dev
    headers:
      uptrace-dsn: 'https://token@api.uptrace.dev/project_id'

service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp/uptrace]
    metrics:
      receivers: [otlp]
      processors: [cumulativetodelta, batch, resourcedetection]
      exporters: [otlphttp/uptrace]
    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp/uptrace]

Self-hosted

To send data to a self-hosted Uptrace installation that does not have TLS:

processors:
  resourcedetection:
    detectors: [env, system]
  cumulativetodelta:
  batch:
    send_batch_size: 10000
    timeout: 10s

exporters:
  otlp/uptrace:
    endpoint: http://localhost:14317
    tls:
      insecure: true
    headers:
      uptrace-dsn: 'http://project2_secret_token@localhost:14318?grpc=14317'

service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlp/uptrace]
    metrics:
      receivers: [otlp]
      processors: [cumulativetodelta, batch, resourcedetection]
      exporters: [otlp/uptrace]
    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlp/uptrace]
processors:
  resourcedetection:
    detectors: [env, system]
  cumulativetodelta:
  batch:
    send_batch_size: 10000
    timeout: 10s

exporters:
  otlphttp/uptrace:
    endpoint: http://localhost:14318
    tls:
      insecure: true
    headers:
      uptrace-dsn: 'http://project2_secret_token@localhost:14318?grpc=14317'

service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp/uptrace]
    metrics:
      receivers: [otlp]
      processors: [cumulativetodelta, batch, resourcedetection]
      exporters: [otlphttp/uptrace]
    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp/uptrace]

Debugging issues

If otelcol is not working as expected, you can check the log output for potential issues. The logging verbosity level defaults to INFO, but you can change it using the configuration file:

service:
  telemetry:
    logs:
      level: 'debug'

Sending data from Uptrace distros to Collector

Sometimes it might be useful to send data from Uptrace distros to an OpenTelemetry Collector acting as a middle-man that forwards the received data to Uptrace.

For example, you can use OpenTelemetry Collector in such a manner for tail-based samplingopen in new window or redactingopen in new window span attributes.

Assuming your local OpenTelemetry Collector is listening on localhost:4317 (OTLP/gRPC) and localhost:4318 (OTLP/HTTP), use the following Uptrace DSN to configure Uptrace distros:

# For distros that use OTLP/gRPC exporter.
UPTRACE_DSN=http://localhost:4317

# or

# For distros that use OTLP/HTTP exporter.
UPTRACE_DSN=http://localhost:4318

If the Collector supports TLS, replace http with https.

Host metrics

hostmetricsreceiver is an OpenTelemetry Collector plugin that gathers various metrics about the host system, for example, CPU, RAM, disk metrics and other system-level metrics.

See OpenTelemetry Host Metrics receiveropen in new window for details.

Dashboards

Once everything is configured properly, Uptrace will automatically create dashboards using pre-built templatesopen in new window:

Dashboard

What's next?

Next, learn more about OpenTelemetry Collectoropen in new window or browse available receiversopen in new window.

Last Updated: