Skip to content
2 changes: 2 additions & 0 deletions reference/fleet/agent-provider.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
mapped_pages:
- https://www.elastic.co/guide/en/fleet/current/agent-provider.html
applies_to:
stack: ga
products:
- id: fleet
- id: elastic-agent
Expand Down
4 changes: 3 additions & 1 deletion reference/fleet/docker-provider.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
---
mapped_pages:
- https://www.elastic.co/guide/en/fleet/current/docker-provider.html
applies_to:
stack: ga
products:
- id: fleet
- id: elastic-agent
---

# Docker Provider [docker-provider]
# Docker provider [docker-provider]

Provides inventory information from Docker. The available dynamic variables are:

Expand Down
4 changes: 3 additions & 1 deletion reference/fleet/env-provider.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
---
mapped_pages:
- https://www.elastic.co/guide/en/fleet/current/env-provider.html
applies_to:
stack: ga
products:
- id: fleet
- id: elastic-agent
---

# Env Provider [env-provider]
# Env provider [env-provider]

Provides access to the environment variables as key-value pairs.

Expand Down
8 changes: 8 additions & 0 deletions reference/fleet/filesource-provider.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
---
applies_to:
stack: ga
products:
- id: fleet
- id: elastic-agent
---

# Filesource provider [filesource-provider]

Watches for changes of specified files and updates the values of the variables when the content of the files changes.
Expand Down
2 changes: 2 additions & 0 deletions reference/fleet/host-provider.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
mapped_pages:
- https://www.elastic.co/guide/en/fleet/current/host-provider.html
applies_to:
stack: ga
products:
- id: fleet
- id: elastic-agent
Expand Down
4 changes: 3 additions & 1 deletion reference/fleet/kubernetes-provider.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
---
mapped_pages:
- https://www.elastic.co/guide/en/fleet/current/kubernetes-provider.html
applies_to:
stack: ga
products:
- id: fleet
- id: elastic-agent
---

# Kubernetes Provider [kubernetes-provider]
# Kubernetes provider [kubernetes-provider]

Provides inventory information from Kubernetes.

Expand Down
2 changes: 2 additions & 0 deletions reference/fleet/kubernetes_leaderelection-provider.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
mapped_pages:
- https://www.elastic.co/guide/en/fleet/current/kubernetes_leaderelection-provider.html
applies_to:
stack: ga
products:
- id: fleet
- id: elastic-agent
Expand Down
4 changes: 3 additions & 1 deletion reference/fleet/kubernetes_secrets-provider.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
---
mapped_pages:
- https://www.elastic.co/guide/en/fleet/current/kubernetes_secrets-provider.html
applies_to:
stack: ga
products:
- id: fleet
- id: elastic-agent
---

# Kubernetes Secrets Provider [kubernetes_secrets-provider]
# Kubernetes Secrets provider [kubernetes_secrets-provider]

Provides access to the Kubernetes Secrets API.

Expand Down
2 changes: 2 additions & 0 deletions reference/fleet/local-dynamic-provider.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
mapped_pages:
- https://www.elastic.co/guide/en/fleet/current/local-dynamic-provider.html
applies_to:
stack: ga
products:
- id: fleet
- id: elastic-agent
Expand Down
4 changes: 3 additions & 1 deletion reference/fleet/local-provider.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
---
mapped_pages:
- https://www.elastic.co/guide/en/fleet/current/local-provider.html
applies_to:
stack: ga
products:
- id: fleet
- id: elastic-agent
---

# Local [local-provider]
# Local provider [local-provider]

Provides custom keys to use as variables. For example:

Expand Down
113 changes: 61 additions & 52 deletions reference/fleet/providers.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,68 @@
---
navigation_title: Providers
navigation_title: Agent providers
mapped_pages:
- https://www.elastic.co/guide/en/fleet/current/providers.html
applies_to:
stack: ga
products:
- id: fleet
- id: elastic-agent
---

# Configure providers for standalone {{agent}}s [providers]
# {{agent}} providers [providers]

Providers supply key-value pairs for variable substitution and conditional logic. In other words, they define dynamic values {{agent}} can use when building configurations.

Providers supply the key-value pairs that are used for variable substitution and conditionals. Each provider’s keys are automatically prefixed with the name of the provider in the context of the {{agent}}.
Each provider’s keys are automatically grouped under the provider name within the {{agent}} context. For example, if the `foo` provider supplies `{"key1": "value1", "key2": "value2"}`, {{agent}} stores these key-value pairs as `{"foo": {"key1": "value1", "key2": "value2"}}`.
You can then reference the values using the `${foo.key1}` and `${foo.key2}` variables.

For example, a provider named `foo` provides `{"key1": "value1", "key2": "value2"}`, the key-value pairs are placed in `{"foo" : {"key1": "value1", "key2": "value2"}}`. To reference the keys, use `{{foo.key1}}` and `{{foo.key2}}`.
How you can configure and use {{agent}} providers depends on whether you're running a standalone or a {{fleet}}-managed {{agent}}. For more information, refer to:

* [Configure providers on standalone {{agent}}](#configure-providers-standalone-agent)
* [Using providers on {{fleet}}-managed {{agent}}](#using-providers-fleet-managed-agent)

## Provider configuration [_provider_configuration]

The provider configuration is specified under the top-level `providers` key in the `elastic-agent.yml` configuration. All registered providers are enabled by default. If a provider cannot connect, no mappings are produced.
## Provider types

The following example shows two providers (`local` and `local_dynamic`) that supply custom keys:
{{agent}} supports two types of providers: [context](#context-providers) and [dynamic](#dynamic-providers).


### Context providers [context-providers]

Context providers supply the current context of the running {{agent}} such as agent information (ID, version), host information (hostname, IP addresses), and environment information (environment variables).

These providers supply only a single key-value mapping. They are generally static, although this is not required. If the key's value changes, the entire configuration is re-evaluated.

To ensure consistency and clarity across documentation and projects, context providers use the {{product.ecs}} naming conventions.

{{agent}} supports the following context providers:

* [Local provider](/reference/fleet/local-provider.md) - Provides custom keys to use as variables.
* [Agent provider](/reference/fleet/agent-provider.md) - Provides information about the {{agent}} such as ID, version, and build details.
* [Host provider](/reference/fleet/host-provider.md) - Provides information about the current host such as hostname, IP addresses, platform, and architecture.
* [Env provider](/reference/fleet/env-provider.md) - Provides access to environment variables as key-value pairs.
* [{{k8s}} Secrets provider](/reference/fleet/kubernetes_secrets-provider.md) - Provides access to the {{k8s}} Secrets API.
* [{{k8s}} LeaderElection provider](/reference/fleet/kubernetes_leaderelection-provider.md) - Enables leader election between {{agent}} instances running on {{k8s}} to ensure only one agent holds the leader lock.


### Dynamic providers [dynamic-providers]

Dynamic providers supply an array of multiple key-value mappings. Each key-value mapping is combined with the previous context provider’s key and value mapping which provides a new unique mapping that is used to generate a configuration.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this sentence existed already, but it's really confusing for me. Is this accurate?

Dynamic providers supply multiple key-value mappings. Each mapping represents a separate “item” or resource. {{agent}} merges each mapping with context providers to create a separate configuration for each item.

Copy link
Contributor Author

@vishaangelova vishaangelova Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I used Cursor to search for an answer, and I made it check the code in the elastic-agent repo and compare with that. Here’s what it tells me:

“Dynamic providers supply an array of multiple key-value mappings”: This is accurate.

The bullet descriptions are accurate.

What is imprecise/misleading:

“combined with the previous context provider’s key and value mapping” is not how the code conceptualizes it:

  • Internally, there is a global context built from all context providers, and a set of dynamic mappings from each dynamic provider (DynamicProviderComm.AddOrUpdate).
  • When rendering configurations, the composable controller matches each dynamic mapping to config templates (often using conditions) and creates a separate rendered config per matching mapping, substituting variables like ${docker.container.id} or ${kubernetes.pod.ip}.
  • There is no special notion of “the previous” context provider; mappings are merged into the overall state with priorities.

So, the high‑level idea (dynamic providers drive multiple config instances from many items) is true, but the current wording about “previous context provider” is inaccurate and could confuse users.

It also confirmed your suggestion as accurate but I have a slightly more detailed description based on Cursor’s findings (see 016e30e).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!


{{agent}} supports the following dynamic providers:

* [Local dynamic provider](/reference/fleet/local-dynamic-provider.md) - Defines multiple key-value pairs to generate multiple configurations.
* [Docker provider](/reference/fleet/docker-provider.md) - Provides Docker container metadata such as ID, name, image, and labels.
* [{{k8s}} provider](/reference/fleet/kubernetes-provider.md) - Provides metadata from {{k8s}} resources such as pods, nodes, and services.


## Configure providers on standalone {{agent}} [configure-providers-standalone-agent]

On standalone {{agent}}, providers can be configured through the top-level `providers` key in the `elastic-agent.yml` configuration file. By default, all providers are enabled, but {{agent}} runs them only if they are referenced in the configuration file or in an {{agent}} policy. Disabled providers are not run even if they are referenced. If a provider cannot connect, no mappings are produced.

You can enable, disable, and configure provider settings as needed. All providers are prefixed without name collisions. In the configuration, the name of the provider is in the key.

The following example shows two providers (`local` and `local_dynamic`) that supply custom keys on a standalone {{agent}}:

```yaml
providers:
Expand All @@ -36,53 +79,22 @@ providers:
item: key3
```

Providers are enabled automatically if a provider is referenced in an {{agent}} policy. All providers are prefixed without name collisions. The name of the provider is in the key in the configuration.
If a provider is referenced in an {{agent}} policy, it is turned on automatically unless it's explicitly disabled in the `elastic-agent.yml` configuration file.


### Disable providers [disable-providers-by-default]

On standalone {{agent}}, you can disable a specific provider, so it cannot be run even if it is referenced. For example, to disable the Docker provider on a standalone {{agent}}, set:

```yaml
providers:
docker:
enabled: false
```

{{agent}} supports two broad types of providers: [context](#context-providers) and [dynamic](#dynamic-providers).

With this setting, {{agent}} will not run the Docker provider even if it's referenced in an {{agent}} policy.

### Context providers [context-providers]

Context providers give the current context of the running {{agent}}, for example, agent information (ID, version), host information (hostname, IP addresses), and environment information (environment variables).

They can only provide a single key-value mapping. Think of them as singletons; an update of a key-value mapping results in a re-evaluation of the entire configuration. These providers are normally very static, but not required. A value can change which results in re-evaluation.

Context providers use the Elastic Common Schema (ECS) naming to ensure consistency and understanding throughout documentation and projects.

{{agent}} supports the following context providers:

* [Local](/reference/fleet/local-provider.md)
* [Agent Provider](/reference/fleet/agent-provider.md)
* [Host Provider](/reference/fleet/host-provider.md)
* [Env Provider](/reference/fleet/env-provider.md)
* [Kubernetes Secrets Provider](/reference/fleet/kubernetes_secrets-provider.md)
* [Kubernetes Leader Election Provider](/reference/fleet/kubernetes_leaderelection-provider.md)


### Dynamic Providers [dynamic-providers]

Dynamic providers give an array of multiple key-value mappings. Each key-value mapping is combined with the previous context provider’s key and value mapping which provides a new unique mapping that is used to generate a configuration.

{{agent}} supports the following context providers:

* [Local Dynamic Provider](/reference/fleet/local-dynamic-provider.md)
* [Docker Provider](/reference/fleet/docker-provider.md)
* [Kubernetes Provider](/reference/fleet/kubernetes-provider.md)


### Disabling Providers By Default [disable-providers-by-default]

All registered providers are disabled by default until they are referenced in a policy.

You can disable all providers even if they are referenced in a policy by setting `agent.providers.initial_default: false`.

The following configuration disables all providers from running except for the docker provider, if it becomes referenced in the policy:
You can also disable all providers by setting `agent.providers.initial_default: false`. The following configuration disables all providers with the exception of the Docker provider, which is run when it's referenced in the policy:

```yaml
agent.providers.initial_default: false
Expand All @@ -92,11 +104,8 @@ providers:
```


## Using providers on {{fleet}}-managed {{agent}} [using-providers-fleet-managed-agent]

On {{fleet}}-managed {{agent}}, you can use provider variables in integration policy settings (for example, `${host.name}`, `${env.foo}`, `${agent.id}`), but you cannot add a `providers` configuration block directly through the {{fleet}} UI.







Some providers can be configured on {{k8s}} deployments using ConfigMaps. For more details, refer to [Advanced {{agent}} configuration managed by {{fleet}}](/reference/fleet/advanced-kubernetes-managed-by-fleet.md).
24 changes: 12 additions & 12 deletions reference/fleet/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,6 @@ toc:
- file: elastic-agent-simplified-input-configuration.md
- file: elastic-agent-inputs-list.md
- file: dynamic-input-configuration.md
- file: providers.md
children:
- file: local-provider.md
- file: agent-provider.md
- file: host-provider.md
- file: env-provider.md
- file: filesource-provider.md
- file: kubernetes_secrets-provider.md
- file: kubernetes_leaderelection-provider.md
- file: local-dynamic-provider.md
- file: docker-provider.md
- file: kubernetes-provider.md
- file: elastic-agent-output-configuration.md
children:
- file: elasticsearch-output.md
Expand Down Expand Up @@ -163,6 +151,18 @@ toc:
- file: data-streams-advanced-features.md
- file: alert-templates.md
- file: agent-command-reference.md
- file: providers.md
children:
- file: local-provider.md
- file: agent-provider.md
- file: host-provider.md
- file: env-provider.md
- file: filesource-provider.md
- file: kubernetes_secrets-provider.md
- file: kubernetes_leaderelection-provider.md
- file: local-dynamic-provider.md
- file: docker-provider.md
- file: kubernetes-provider.md
- file: agent-processors.md
children:
- file: processor-syntax.md
Expand Down
Loading