Configure the OTEL collector

To configure and deploy the OTEL collector with Docker, you need a New Relic API key and two .yaml files.

The following are required to configure and deploy the OTEL collector for New Relic with Docker:

  • Your New Relic API key.
  • Two .yaml files, docker-compose.yaml and config.yaml. The contents are listed below.

Create an API key

To create an API key:

  1. Log in to the New Relic portal and click your user name at the bottom of the left navigation pane.
  2. From the menu, select API keys.
  3. Click Create a key.
  4. For Key type, select Ingest - License.
  5. Click Create a key.
  6. Click Copy.
  7. Save the key in a secure location for later use.

Create and configure OTEL Docker files

On one host where a Groundplex node is deployed as a Docker image:

  1. Create an otel directory. For example on a Linux host: mkdir otel
  2. Create a docker-compose.yaml and a config.yaml. For example, on a Linux host:
    touch docker-compose.yaml
    touch config.yaml
            

Configure Docker files

  • Open config.yaml.
  • Insert the following:
    receivers:
      otlp:
        protocols:
          grpc:
          http:
    
    processors:
      batch:
        send_batch_max_size: 100
        send_batch_size: 10
        timeout: 10s
      attributes:
        actions:
          - key: snaplex.node.name
            value: <node_name>
            action: upsert
    
    exporters:
      otlphttp:
        endpoint: https://otlp.nr-data.net:4318
        headers:
          api-key: <new_relic_api_key>
      logging:
        verbosity: detailed
    
    service:
      pipelines:
        metrics:
          receivers: [otlp]
          processors: [batch, attributes]
          exporters: [otlphttp, logging]
        logs:
          receivers: [otlp]
          processors: [batch, attributes]
          exporters: [otlphttp, logging]
  • On line 15, replace <node_name> with the Groundplex node container ID (or hostname if not deployed in a container).
  • On line 22, replace <new_relic_api_key> with your New Relic API key.
  • Open docker-container.yaml.
  • Add the following configuration, which installs and runs the OTEL collector:
    version: '3'
    services:
      otel_collector:
        image: otel/opentelemetry-collector-contrib
        ports:
          - 4317:4317 
        volumes:
          - /otelcol/config.yaml:/etc/otelcol-contrib/config.yaml
        logging:
          driver: "json-file"
          options:
            max-file: "5"   # number of files or file count
            max-size: "10m"

Configure the remaining Groundplex nodes

On each JCC or FeedMaster node, follow these steps:

  1. Create an otel directory. For example on a Linux host: mkdir otel
  2. Copy the docker-compose.yaml and config.yaml files from the first configured node.
  3. On line 15 of the docker-compose.yaml file, change the container ID to the container ID of this host.

Next, Deploy the OTEL collector and restart Groundplex nodes.