β›“ OpenTelemetry collector integration

Follow the instructions below to use your own OpenTelemetry collector by chaining it with the Helios OpenTelemetry SDK.

With the Helios OpenTelemetry SDK, you may choose to keep your own OpenTelemetry collector and simply chain the collectors so that incoming data is sent to the Helios collector. This is supported by a simply configuration change to the SDK.

Send data to your own collector

First, change the collector endpoint on the init method of the SDK to have your own collector endpoint:

import initialize from '@heliosphere/opentelemetry-sdk';

initialize({
    apiToken: 'TOKEN',
    enable: true,
    serviceName: 'SERVICE_NAME',
    collectorEndpoint: 'YOUR_COLLECTOR_ENDPOINT'
});
from helios import initialize

hs = initialize(api_token = 'TOKEN', service_name = 'SERVICE_NAME', enabled = True, collector_endpoint = 'YOUR_COLLECTOR_ENDPOINT')

Then, in your collector configuration, you will have to configure a receiver endpoint for the Helios SDK:

receivers:
  otlp:
    protocols:
      http:
        endpoint: 0.0.0.0:55681

Exporting data from your own collector

Finally, in order to have your data sent to Helios as well after going through your collector, you should set an exporter in your collector config as well and add the authorization header with the token that was given to you by Helios:

exporters:
  otlphttp:
    endpoint: "https://collector.heliosphere.io"
    traces_endpoint: "https://collector.heliosphere.io/traces"
    headers:
      Authorization: "<<HS_TOKEN>>"

Did this page help you?