Skip to content

Introduce direct agent configuration #5018

@axw

Description

@axw

As part of the move to Fleet we will need to move away from fetching agent config directly from Kibana, as the privileges APM Server is given do not cover this. Instead, agent config will be pushed down to APM Server via the server's policy.

In order to make the above possible, we will add configuration to APM Server to directly specify agent config. This will include the criteria, config settings, and an optional Etag value. For example:

apm-server:
  agent_config:
  - service.name: ten_percent
    config:
      transaction_sample_rate: 0.1
  - service.environment: production
    etag: abc123 # optional, computed by APM Server if not specified
    config:
      transaction_sample_rate: 0.5

If the "etag" property is not set for a config block, the server will compute one by hashing the settings. The property is configurable so that Kibana can inject a value. When creating/updating agent config in Kibana, it will take responsibility for calculating an Etag value and injecting it into the server config; Kibana will later use this for identifying whether config has been applied (more below).

Configuring a list of agent config will disable fetching agent config from Kibana.

Currently when APM Server queries Kibana for agent config, Kibana will mark config as having been applied when the provided Etag is found to be current. As we will no longer be communicating with Kibana, we'll need to write documents to Elasticsearch instead. The server will track whether in a config query from an agent, the agent supplies the current Etag (If-None-Match) for the config block that matches its criteria. When this is first true, the server will index a document including the Etag value indicating that the config has been applied.

Alternatively, we could have agents periodically send an internal agent statistics event which includes the current config Etag value. This would have the benefit of enabling us to see how many and which agents have applied the config.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions