This project lets you configure the OpenTelemetry collector to send your collected Prometheus-format metrics to Logz.io.

Configuring OpenTelemetry to send your metrics data to Logz.io

Download OpenTelemetry collector

If you already have OpenTelemetry, proceed to the next step.

Create a dedicated directory on your host and download the OpenTelemetry collector that is relevant to the operating system of your host.

After downloading the collector, create a configuration file config.yaml.

Configure the receivers

Open the configuration file and make sure that it states the receivers required for your source.

Configure the exporters

In the same configuration file, add the following to the exporters section:

exporters:
  prometheusremotewrite:
    endpoint: https://<<LISTENER-HOST>>:8053
    headers:
      Authorization: Bearer <<PROMETHEUS-METRICS-SHIPPING-TOKEN>>

Replace the placeholders to match your specifics. (They are indicated by the double angle brackets << >>):

  • Replace <<PROMETHEUS-METRICS-SHIPPING-TOKEN>> with a token for the Metrics account you want to ship to.
    Here’s how to look up your Metrics token.
  • Replace <<LISTENER-HOST>> with the Logz.io Listener URL for your region, configured to use port 8052 for http traffic, or port 8053 for https traffic. For example, listener.logz.io if your account is hosted on AWS US East, or listener-nl.logz.io if hosted on Azure West Europe.
Configure the service pipeline

In the service section of the configuration file, add the following configuration

service:
  pipelines:
    metrics:
      receivers: [<<YOUR-RECEIVER>>]
      exporters: [prometheusremotewrite]
  • Replace <<YOUR_RECEIVER>> with the name of your receiver.
Start the collector

Run the following command:

<path/to>/otelcol-contrib --config ./config.yaml
  • Replace <path/to> with the path to the directory where you downloaded the collector. If the name of your configuration file is different to config, adjust name in the command accordingly.
Check Logz.io for your metrics

Give your data some time to get from your system to ours, then log in to your Logz.io Metrics account, and open the Logz.io Metrics tab.