Ingesting data using OpenTelemetry 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 system metricsopen in new window, PostgreSQLopen in new window, MySQLopen in new window, Redisopen in new window, and more.

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

OpenTelemetry Collector

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

To send data to a self-managed Uptraceopen in new window installation that does not have TLS:

exporters:
  otlp:
    endpoint: http://localhost:14317
    tls:
      insecure: true
    headers:
      uptrace-dsn: 'http://<project_token>:localhost:14317/<project_id>'
exporters:
  otlphttp:
    endpoint: http://localhost:14318
    tls:
      insecure: true
    headers:
      uptrace-dsn: 'http://<project_token>:localhost:14318/<project_id>'

To send data to Uptrace Cloudopen in new window:

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

hostmetrics

hostmetricsreceiveropen in new window is an OpenTelemetry Collector receiver that gathers various metrics about the host system, for example, CPU, RAM, disk metrics and more.

To start collecting host metrics, you need to installopen in new window Collector on each system you want to monitor and add the following lines to the Collector config:

processors:
  resourcedetection:
    detectors: ['system']
  batch:
    send_batch_size: 10000
    timeout: 10s

receivers:
  hostmetrics:
    collection_interval: 10s
    scrapers:
      cpu:
      disk:
      filesystem:
      load:
      memory:
      network:
      paging:

If you are using unusual filesystems, you may want to configure the receiver more thoroughly, for example, to scrape only supported filesystems:

receivers:
  hostmetrics:
    collection_interval: 10s
    scrapers:
      cpu:
      disk:
      load:
      filesystem:
        include_fs_types:
          match_type: strict
          fs_types: [ext3, ext4]
      memory:
      network:
      paging:

Lastly, you need to add the configured receiver to a pipeline to enable it:

service:
  pipelines:
    metrics/hostmetrics:
      receivers: [hostmetrics]
      processors: [batch, resourcedetection]
      exporters: [otlp]

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: