Configure the open-source OpenTelemetry Collector

Configure the open-source OpenTelemetry Collector

  1. On your machine prepare a plain text configuration file named config.yaml.Replace the placeholders for IP address and token with the data prepared in Configure Splunk Enterprise and enable OTel Collectors.
    
    
    receivers:
      hostmetrics:
        collection_interval: 10s
        scrapers:
          memory:
    
    exporters:
      debug:
        verbosity: detailed
    
    service:
      pipelines:
        metrics:
          receivers: [hostmetrics]
          exporters: [debug]
      extensions: [opamp]
    
    extensions:
      opamp:
        server:
          http:
            endpoint: https://10.245.152.187:8089/services/tenant/agent-management/v2/opamp/otel # This IP and port needs to be changed according to your setup.
            tls:
              #insecure: true
              insecure_skip_verify: true
              # Token below needs to be substituted with your auth token.
            headers:
              Authorization: Bearer eyJraWQiOiJzcGx1bmsuc2VjcmV0IiwiYWxnIjoiSFM1MTIiLCJ2ZXIiOiJ2MiIsInR0eXAiOiJzdGF0aWMifQ.eyJpc3MiOiJhZG1pbiBmcm9tIGRzMSIsInN1YiI6ImFkbWluIiwiYXVkIjoiYWRtaW4iLCJpZHAiOiJTcGx1bmsiLCJqdGkiOiJkNmRjYzBkYzJlNDljNjcxNjRlNmZjMjA5YWU3NWE5NTVhMTRjMzRlYjFhNzUzOTdiNmVlNDMxNzZmZjZmMmQ4IiwiaWF0IjoxNzQ1OTE0OTgwLCJleHAiOjE3NDg1MDY5ODAsIm5iciI6MTc0NTkxNDk4MH0.rJiyjhCL1M0x7DbKgDLR40pUKFvG3ayoDdBSA8gpz58TAZPAmL8q6zMv4mkqe6ZxeA2JUb1RY12QwhIEuukguQ
    
    
    
  2. Copy your file to your Linux machine using the following command:
    scp config.yaml splunker@10.202.7.129:/home/splunker
    
  3. Download the OTel Contrib Collector to your Linux machine from the OpenTelemetry Collector GitHub repository: https://github.com/open-telemetry/opentelemetry-collector-releases/releases.
    For example, you can use the following command to download otelcol-contrib_0.124.1_linux_amd64.tar.gz for AMD CPU Architecture:
    curl --proto '=https' --tlsv1.2 -fOL https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.124.1/otelcol-contrib_0.124.1_linux_amd64.tar.gz
    
  4. Untar the file with the following command:
    tar -xvf otelcol-contrib_0.124.1_linux_amd64.tar.gz
    
  5. Run the OTel Collector using your configuration file:
    ./otelcol-contrib --config=config.yaml
    
  6. Now, you can see the OTel Collector registered in the agent management. Select Settings and then select OTel Collectors under the Distributed Environment section.

Next step

After you configure and connect OTel Collectors to your Splunk Enterprise instance, you can view them on Splunk Enterprise. See View OpenTelemetry Collectors in Splunk Enterprise