This section describes how to connect a OpenTelemetry Collector instance to Fleet Server over OpAMP.
-
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.
-
Create an Elasticsearch service account token using Kibana > Dev Tools > Console.
POST /_security/service/elastic/fleet-server/credential/token/opamp -
The OpAMP endpoint is enabled by default. If you need to disable it, add the following to the
fleet-serverinput section, as a sibling of thepolicy.idkey:server: feature_flags: enable_opamp: false
-
Build the Fleet Server binary for your platform.
mage build:local -
Run the Fleet Server binary with the above configuration.
./bin/fleet-server -
Create a new policy in Fleet. Copy the enrollment token for that policy.
-
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]
-
Download and extract an OpenTelemetry Collector Contrib release for your platform from https://github.com/open-telemetry/opentelemetry-collector-releases/releases
-
Run the OpenTelemetry Collector with the above configuration.
API_KEY=<enrollment token> ./otelcol-contrib --config ./otel-opamp.yaml