From 7d0ab74f1c8ab310af7ce6b9f8056dec5e6fda4a Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Thu, 25 Jul 2024 08:45:09 +0200 Subject: [PATCH] docs/otel-direct: add Python specific requirements (#4092) In the Python OTel agent Authorization header content must be url encoded. --- docs/en/observability/apm/otel-direct.asciidoc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/en/observability/apm/otel-direct.asciidoc b/docs/en/observability/apm/otel-direct.asciidoc index 8956b16446..6dabf8e1e3 100644 --- a/docs/en/observability/apm/otel-direct.asciidoc +++ b/docs/en/observability/apm/otel-direct.asciidoc @@ -115,6 +115,14 @@ For information on how to format an API key, see Please note the required space between `Bearer` and `an_apm_secret_token`, and `ApiKey` and `an_api_key`. +Some language implementations of the OpenTelemetry agent, namely Python, requires the content of the header to be URL encoded. For the `Bearer` token that would mean just substituting the space between `Bearer` an the token with `%20`, e.g. ``"Authorization=Bearer%20an_apm_secret_token"`, for an API Key you can use the following snippet to handle that: + +[source,python] +---- +from urllib.parse import quote +quote("ApiKey an_api_key") +---- + | `OTEL_METRICS_EXPORTER` | Metrics exporter to use. See https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#exporter-selection[exporter selection] for more information. | `OTEL_LOGS_EXPORTER` | Logs exporter to use. See https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#exporter-selection[exporter selection] for more information.