Set up OpenTelemetry Fleet Management for Inventory management
Learn how to configure OpAMP for collectors and agents.
OpenTelemetry Fleet Management requires agents to be enrolled so they connect to the centralized Fleet Management Server. By configuring the agents for Fleet Management, each service registers with the Fleet Management Server, reports its identity and health through the OpAMP management path through the Collector.
Depending on the clients (collectors or agents) that you want to manage, you need to:
-
configure OpAMP for Collector
-
configure OpAMP for Agents
Before you begin
You must run a OpenTelemetry Collector on the same host or a reachable network path to:
-
receive agent telemetry over OTLP (data plane)
-
act as the OpAMP HTTP proxy for language agents (management plane).
For a quick overview of the Collector, see Splunk Distribution of the OpenTelemetry Collector.
Configure OpAMP for collector
-
In the OpenTelemetry Collector, you need the following extensions in the agent_config.yaml configuration file:
Note:-
If you are using OpenTelemetry Collector version prior to 0.151.0, add the extensions manually.
-
If you are using OpenTelemetry Collector version 0.151.0 to 0.157, apply the
splunk.opamp.enabledfeature gate to add the extensions. -
If you are using OpenTelemetry Collector 0.158.0 or later, the extensions are enabled by default.
CODEextensions: opamp/splunk_o11y: agent_description: include_resource_attributes: true server: http: endpoint: https://ingest.<realm>.observability.splunkcloud.com/v1/opamp polling_interval: 30s headers: X-SF-Token: "<your-token>" -
- (Optional) Set the deployment environment in the Collector internal telemetry resource attributes.This setting populates the
Environmentfield in the Fleet management UI and associates OpAMP data with the same environment as your APM data. In the Collector configuration file, adddeployment.environment.nameunderservice::telemetry::resource::attributes.For example, if you use the default agent Collector configuration on Linux at /etc/otel/collector/agent_config.yaml, enable this by following the comments for
deployment.environment.nameas mentioned in the following configuration snippet:CODEservice: telemetry: resource: attributes: - name: otelcol.service.mode value: agent # Optional: Add a deployment environment to the Collector's internal telemetry. # To use the deprecated attribute, change the key to "deployment.environment". - name: deployment.environment.name value: staging -
If you changed the Collector configuration in the previous step, restart the Collector service.
Configure OpAMP for agents
-
In the agent_config.yaml configuration file of the OpenTelemetry Collector, add the following extension to act as a proxy for OpAMP requests from agents:
CODEextensions: http_forwarder: ingress: endpoint: 0.0.0.0:<your-port> egress: endpoint: https://ingest.<realm>.observability.splunkcloud.com/v1/opamp headers: X-SF-Token: "<your-token>" -
Configure your agents with the following environment variables:
Environment variable Type Value Default Description SPLUNK_OPAMP_ENABLEDboolean true false Enables the OpAMP client in the agent. SPLUNK_OPAMP_ENDPOINTstring http://localhost:<port>/v1/opamp- Points to the http_forwarderof the collector. -
Get the inventory details by using the APIs. See Client Inventory API.
Example of the OpenTelemetry collector agent_config.yaml file
extensions:
http_forwarder:
ingress:
endpoint: 0.0.0.0:<your-port>
egress:
endpoint: https://ingest.<realm>.observability.splunkcloud.com/v1/opamp
headers:
X-SF-Token: "<your-token>"
opamp:
agent_description:
include_resource_attributes: true
server:
http:
endpoint: https://ingest.<realm>.observability.splunkcloud.com/v1/opamp/fm-service
polling_interval: 30s
headers:
X-SF-Token: "<your-token>"
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:<your-port>
exporters:
debug:
processors:
batch: {}
service:
extensions: [http_forwarder, opamp]
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [debug]
Parameter Details:
- ingress.endpoint: the port at which the agent connects to. For example, the Java agent connects to port 4320
- egress.endpoint: the base URL of the Fleet Management server. (The request path /v1/opamp is forwarded without modifications)
- egress.headers: the token is added so that the agent does not need to carry it.