Skip to content

Latest commit

 

History

History
63 lines (57 loc) · 1.99 KB

File metadata and controls

63 lines (57 loc) · 1.99 KB

OpAMP

This section describes how to connect a OpenTelemetry Collector instance to Fleet Server over OpAMP.

  1. Create a deployment in Elastic Cloud. Integrations Server is not needed as we will instead be using the Fleet Server instance built from this repository so it can "speak" OpAMP to the OpenTelemetry Collector.

  2. Create an Elasticsearch service account token using Kibana > Dev Tools > Console.

    POST /_security/service/elastic/fleet-server/credential/token/opamp
    
  3. The OpAMP endpoint is enabled by default. If you need to disable it, add the following to the fleet-server input section, as a sibling of the policy.id key:

    server:
      feature_flags:
        enable_opamp: false
  4. Build the Fleet Server binary for your platform.

    mage build:local
    
  5. Run the Fleet Server binary with the above configuration.

    ./bin/fleet-server
    
  6. Create a new policy in Fleet. Copy the enrollment token for that policy.

  7. Create OpenTelemetry Collector configuration for connecting to the Fleet Server instance and save it as otel-opamp.yaml.

    receivers:
      otlp:
        protocols:
          grpc:
            endpoint: 0.0.0.0:4317
    
    exporters:
      debug:
        verbosity: detailed
    
    extensions:
      opamp:
        server:
          http:
            endpoint: http://localhost:8220/v1/opamp
            tls:
              insecure: true
            headers:
              Authorization: ApiKey ${env:FLEET_ENROLLMENT_TOKEN}
        instance_uid: "019b8d7a-2da8-7657-b52d-492a9de33319"
    
    service:
      pipelines:
        logs:
          receivers: [otlp]
          exporters: [debug]
          extensions: [opamp]
  8. Download and extract an OpenTelemetry Collector Contrib release for your platform from https://github.com/open-telemetry/opentelemetry-collector-releases/releases

  9. Run the OpenTelemetry Collector with the above configuration.

    API_KEY=<enrollment token> ./otelcol-contrib --config ./otel-opamp.yaml