Skip to main content
Sumo Logic

Set up traces collection for other environments

Sumo Logic leverages OpenTelemetry standards for trace collection. To gather the spans generated by tracing clients, see Instrument your application with OpenTelemetry, the OpenTelemetry Collector instance needs to be run. It receives and buffers data, optionally attaches metadata tags, and pushes them to a Sumo Logic hosted collector endpoint, residing in the cloud.

Preparation

Depending on the architecture of the environment, OpenTelemetry Collector can be run in two types of deployment scenarios. Due to the fact that vital metadata is available only with local collectors, we recommend that instances of OpenTelemetry Collector should be run at least on each of the nodes as an agent. Doing so allows you to collect metadata tags locally and to buffer the messages, reducing the number of requests to the collector instance.

preparation diagram bd.png

Installation steps

Step 1 - generating tracing endpoint URL

Installation steps require you to add a Source to a Hosted Collector. Before creating the Source, identify the Hosted Collector you want to use or create a new Hosted Collector. For instructions, see Configure a Hosted Collector.

  1. In the Sumo Logic web app, select Manage Data > Collection > Collection.
  2. In the Collectors page, click Add Source next to a Hosted Collector.

  3. Select HTTP Traces from the available options.

    http traces icon bd.png

  4. Provide a name and click Save.

    HTTP traces set up bd.png

  5. An HTTP address is presented. Save it, you'll need to put it into your OpenTelemetry Collector configuration.

    http endpoint bd.png

Step 2 - prepare config file

config.yaml for OpenTelemetry Collector/Agent

Use the following as a template for config.yaml and apply the following changes:

  • ENDPOINT_URL needs to be replaced with the value retrieved in Step 1, point 5.
  • Refer to the pipelines/processors section and comment out the pipelines that don’t match your environment.

 

receivers:
  zipkin:
    endpoint: 0.0.0.0:9411
  otlp:
    protocols:
      grpc: 
        endpoint: 0.0.0.0:55680
  jaeger:
    protocols:
      grpc:
        endpoint: 0.0.0.0:14250
      thrift_compact:
        endpoint: 0.0.0.0:6831
      thrift_http:
        endpoint: 0.0.0.0:14268
processors:
  memory_limiter:
    check_interval: 5s
    limit_mib: 1000
    spike_limit_mib: 500
  batch:
    send_batch_size: 256
    send_batch_max_size: 512
    timeout: 5s
  resourcedetection/aws:
    detectors: [ec2]
    timeout: 5s
    override: false
  resource/aws:
    attributes:
    - action: upsert
      key: cloud.namespace
      value: ec2
  resourcedetection/gcp:
    detectors: [gcp]
    timeout: 5s
    override: false
  resource/gcp:
    attributes:
    - action: upsert
      key: cloud.namespace
      value: gce
  queued_retry:
    num_workers: 16
    queue_size: 5000
    retry_on_failure: true
extensions:
  health_check: {}
exporters:
  zipkin:
    endpoint: ENDPOINT_URL
  logging:
    loglevel: debug
service:
  extensions: [health_check]
  pipelines:
    traces:
      receivers: [jaeger, zipkin, otlp]
      # For AWS EC2 environment use this:
      processors: [memory_limiter, batch, resourcedetection/aws, resource/aws, queued_retry]
      # For GCP Compute Engine environment use this:
      processors: [memory_limiter, batch, resourcedetection/gcp, resource/gcp, queued_retry]
 # For other environments use this:
      processors: [memory_limiter, batch, queued_retry]
      # To enable verbose debugging, add “,logging” to the list of exporters
      exporters: [zipkin]

Step 3 - prepare the OpenTelemetry Collector binaries and run them

As spans are sent over TCP or UDP connections, the OpenTelemetry Collector service needs to have relevant ports exposed. The templates provided above support the following protocols:

  • Zipkin/HTTP on port 9411
  • Jaeger/gRPC on port 14250
  • Jaeger/Compact on port 6831 (UDP)
  • OTLP/gRPC on port 55680
Option I: Containerized environments

A published Docker image could be used: sumologic/opentelemetry-collector:0.8.0.1 

For example:

docker run --rm -p 55680:55680 -p 9411:9411 \
  -p 6831:6831/udp -p 14250:14250 \
  -v "${PWD}/config.yaml":/conf/config.yaml \
  sumologic/opentelemetry-collector:0.8.0.1 \
  --config /conf/config.yaml 

Option II: Non-containerized environments

For non-containerized environments, a binary can be downloaded from the project repository available under https://github.com/SumoLogic/opentelemetry-collector-contrib/releases/ and run on a given node with the appropriate config, such as:

otelcontribcol_linux_amd64 --config config.yaml

Step 4 - connecting clients to OpenTelemetry Collector

During instrumentation of your application, typically you need to configure collector endpoint and protocol.

Tracing client libraries need to point spans accordingly to the protocol used:

  • Jaeger GRPC: HOSTNAME:14250
  • Jaeger Thrift HTTP: HOSTNAME:14268
  • Jaeger Thrift Compact (UDP): HOSTNAME:6831
  • Zipkin: HOSTNAME:9411
  • OTLP: HOSTNAME:55680

Replace HOSTNAME with the host where the OpenTelemetry Collector/Agent is accessible. For example, this might be localhost or another address on the local node, depending on how the Agent was deployed.