Skip to content

Commit 215dff7

Browse files
authored
Updated OpAMP endpoint authentication docs (#864)
* Updated OpAMP endpoint authentication docs * Fixed spelling
1 parent 8aad13e commit 215dff7

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

extension/apmconfigextension/README.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,19 @@ extensions:
3434
protocols:
3535
http:
3636
endpoint: ":4320"
37+
38+
service:
39+
extensions: [bearertokenauth, apmconfig]
3740
```
3841
3942
The previous snippet configures the `bearertokenauth` authenticator as client authenticator to be used with the Elasticsearch endpoint.
4043

4144
- An Elasticsearch API key is used as secret token.
4245
- The `apmconfig` section defines the Elasticsearch `endpoint` for reading the EDOT SDK configuration and the `authenticator` that should be used with the endpoint.
43-
- The `opamp` section configures the OpAMP endpoint to provide an HTTP endpoint on port 4320. The EDOT SDKs are connecting to this endpoint to fetch configuration messages.
46+
- The `opamp` section configures the OpAMP endpoint to provide an HTTP endpoint on port 4320. The EDOT SDKs are connecting to this endpoint to fetch configuration messages.
47+
- The `service` section enables the `bearertokenauth` and `apmconfig` extension.
4448

45-
Authentication between the OpAMP endpoint and the EDOT SDKs is not configured in the snippet. More information on securing the communication between the apmconfig extension and the EDOT SDKs are given in [Secure the OpAMP endpoint](#secure-the-opamp-endpoint).
49+
Authentication between the OpAMP endpoint and the EDOT SDKs is not configured in the snippet. More information on securing the communication between the `apmconfig` extension and the EDOT SDKs are given in [Secure the OpAMP endpoint](#secure-the-opamp-endpoint).
4650

4751
## Advanced configuration
4852

@@ -56,7 +60,7 @@ All available Elasticsearch client configuration options can be found [here](htt
5660

5761
### Secure the OpAMP endpoint
5862

59-
The apmconfig extension embeds the [confighttp.ServerConfig](https://github.com/open-telemetry/opentelemetry-collector/blob/v0.125.0/config/confighttp/README.md), which means it supports standard HTTP server configuration, including TLS/mTLS and authentication.
63+
The `apmconfig` extension embeds the [confighttp.ServerConfig](https://github.com/open-telemetry/opentelemetry-collector/blob/v0.125.0/config/confighttp/README.md), which means it supports standard HTTP server configuration, including TLS/mTLS and authentication.
6064

6165
#### Enable TLS and mTLS for the OpAMP endpoint
6266

@@ -76,7 +80,6 @@ extensions:
7680
tls:
7781
cert_file: your/path/to/server.crt
7882
key_file: your/path/to/server.key
79-
...
8083
```
8184

8285
More information is available in the [OpenTelemetry TLS server configuration documentation](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configtls/README.md#server-configuration).
@@ -103,15 +106,25 @@ extensions:
103106
http:
104107
auth:
105108
authenticator: apikeyauth
106-
...
109+
service:
110+
extensions: [bearertokenauth, apmconfig, apikeyauth]
107111
```
108112

109-
The server will expect incoming HTTP requests to include an API key with sufficient privileges, using the following header format:
113+
The OpAMP server will expect incoming HTTP requests to include an API key with sufficient privileges, using the following header format:
110114

111115
```
112-
Authorization: ApiKey <base64(id:api_key)>
116+
Authorization=ApiKey <base64(id:api_key)>
117+
```
118+
119+
Set the `ELASTIC_OTEL_OPAMP_HEADERS` environment variable to provide the API key to the EDOT SDK to be used by the OpAMP client.
120+
121+
122+
``` bash
123+
export ELASTIC_OTEL_OPAMP_HEADERS="Authorization=ApiKey <base64(id:api_key)>"
113124
```
114125

126+
#### Create an API key
127+
115128
An API key with the minimum required application permissions (as verified with the configuration above) can be created via Kibana by navigating to: `Observability → Applications → Settings → Agent Keys`, or by using the Elasticsearch Security API:
116129

117130
```bash
@@ -207,6 +220,8 @@ extensions:
207220
tls:
208221
cert_file: your/path/to/server.crt
209222
key_file: your/path/to/server.key
223+
service:
224+
extensions: [bearertokenauth, apmconfig, apikeyauth]
210225
```
211226

212227
The configuration snippet configures the `bearertokenauth` authenticator for the authentication of the Elasticsearch client, the `apikeyauth` authenticator for the OpAMP server, the Elasticsearch endpoint, and TLS for securing the connection between the OpAMP server and EDOT SDKs being the OpAMP client.
@@ -232,7 +247,7 @@ contain only one entry—and in this case, the key may be an empty string.
232247
field in the `AgentRemoteConfig` is set to `application/json`.
233248
- Each `AgentRemoteConfig` message should contain a [hash
234249
identifier](https://github.com/open-telemetry/opamp-spec/blob/v0.11.0/proto/opamp.proto#L929)
235-
that the Agent SHOULD include value in subsequent
250+
that the Agent SHOULD include in subsequent
236251
[RemoteConfigStatus](https://github.com/open-telemetry/opamp-spec/blob/v0.11.0/proto/opamp.proto#L751)
237252
messages in the `last_remote_config_hash` field. The server decides on which
238253
hash function to use, this extension will use the `etag` associated to each

0 commit comments

Comments
 (0)