You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: reference/fleet/providers.md
+49-53Lines changed: 49 additions & 53 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,34 +11,56 @@ products:
11
11
12
12
# {{agent}} providers [providers]
13
13
14
+
Providers supply key-value pairs for variable substitution and conditional logic. In other words, they define dynamic values {{agent}} can use when building configurations.
14
15
15
-
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}}.
16
+
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"}}`.
17
+
You can then reference the values using the `${foo.key1}` and `${foo.key2}` variables.
16
18
17
-
For example, if 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 the variables `${foo.key1}` and `${foo.key2}`.
19
+
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:
18
20
21
+
*[Configure providers on standalone {{agent}}](#configure-providers-standalone-agent)
22
+
*[Using providers on {{fleet}}-managed {{agent}}](#using-providers-fleet-managed-agent)
19
23
20
-
## Provider usage by deployment model [provider_usage_by_deployment_model]
21
24
22
-
How you use providers depends on whether you're running a standalone or a {{fleet}}-managed {{agent}}.
25
+
## Provider types
23
26
24
-
### Using providers on standalone {{agent}} [using-providers-standalone-agent]
27
+
{{agent}} supports two types of providers: [context](#context-providers) and [dynamic](#dynamic-providers).
25
28
26
-
On standalone {{agent}}, providers can be configured through the `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.
27
29
28
-
You can enable, disable, and configure provider settings as needed. For more details, refer to [Provider configuration](#provider_configuration).
30
+
### Context providers [context-providers]
29
31
30
-
### Using providers on {{fleet}}-managed {{agent}} [using-providers-fleet-managed-agent]
32
+
Context providers supply the current context of the running {{agent}} such as agent information (ID, version), host information (hostname, IP address), and environment information (environment variables).
31
33
32
-
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.
34
+
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.
33
35
34
-
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).
36
+
To ensure consistency and clarity across documentation and projects, context providers use the {{product.ecs}} naming conventions.
35
37
38
+
{{agent}} supports the following context providers:
On standalone {{agent}}, provider configuration is specified under the top-level `providers`key in the `elastic-agent.yml` configuration file. All registered providers are enabled by default but they are run by {{agent}} only if they are referenced. If a provider cannot connect, no mappings are produced.
50
+
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.
40
51
41
-
All providers are prefixed without name collisions. The name of the provider is in the key in the configuration.
52
+
{{agent}} supports the following dynamic providers:
## Configure providers on standalone {{agent}} [configure-providers-standalone-agent]
60
+
61
+
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.
62
+
63
+
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.
42
64
43
65
The following example shows two providers (`local` and `local_dynamic`) that supply custom keys on a standalone {{agent}}:
44
66
@@ -57,7 +79,12 @@ providers:
57
79
item: key3
58
80
```
59
81
60
-
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. For example, to disable the Docker provider in a standalone {{agent}}, set:
82
+
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.
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:
61
88
62
89
```yaml
63
90
providers:
@@ -67,49 +94,18 @@ providers:
67
94
68
95
With this setting, {{agent}} will not run the Docker provider even if it's referenced in an {{agent}} policy.
69
96
70
-
{{agent}} supports two broad types of providers: [context](#context-providers) and [dynamic](#dynamic-providers).
71
-
72
-
73
-
### Context providers [context-providers]
74
-
75
-
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).
76
-
77
-
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.
78
-
79
-
Context providers use the {{product.ecs}} naming to ensure consistency and understanding throughout documentation and projects.
80
-
81
-
{{agent}} supports the following context 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.
94
-
95
-
{{agent}} supports the following context providers:
### Disabling providers by default [disable-providers-by-default]
103
-
104
-
Registered providers are run by {{agent}} if they are referenced in the {{agent}} configuration or in a policy.
105
-
106
-
On standalone {{agent}}, you can disable all providers by setting `agent.providers.initial_default: false`, preventing them from running even if they are referenced.
107
-
108
-
The following configuration disables all providers with the exception of the Docker provider, which is run when it's referenced in the policy:
97
+
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:
109
98
110
99
```yaml
111
100
agent.providers.initial_default: false
112
101
providers:
113
102
docker:
114
103
enabled: true
115
104
```
105
+
106
+
107
+
## Using providers on {{fleet}}-managed {{agent}} [using-providers-fleet-managed-agent]
108
+
109
+
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.
110
+
111
+
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).
0 commit comments