-
Notifications
You must be signed in to change notification settings - Fork 36
Description
(Per @theletterf's request to open an issue to track this.)
There was some internal discussion recently that highlighted that it can be confusing to users what auth mechanism is appropriate to use for the Authorization header (e.g. when configuring the OTEL_EXPORTER_OTLP_HEADERS envvar for opentelemetry SDKs). There are two mechanisms:
- Bearer token auth, using a "secret token". This requires ingest API requests (whether that is the APM server intake APIs or the various OTLP endpoints) to include the
Authorization: Bearer $SECRET_TOKENheader. - API key auth, for which the
Authorization: ApiKey $API_KEYheader is needed.
Current support in various products/services:
- APM server's intake v2 API supports both mechanisms -- which means Elastic Cloud Hosted (ECH) and self-hosted support both mechanisms.
- APM server's OTLP endpoint supports both mechanisms. (I'm pretty sure of this, but not 100% confident.)
- EDOT Collector (handled by the https://github.com/elastic/opentelemetry-collector-components/tree/main/extension/apikeyauthextension/ collector extension) supports API key auth. (AFAIK, "Bearer" secret token auth is not supported.)
- Managed OTLP (mOTLP) supports only API key auth. (IIUC, mOTLP covers both the OTLP ingest endpoint for a serverless project and the OTLP endpoint for ECH. Again, I am not 100% confident on this part.)
Historically, Bearer token auth (using a secret token) was the initial auth mechanism. API key auth support came later and a clear migration was never heavily pushed or forced on customers.
Pros/Cons:
- API key auth is supported in all products/services.
- A "secret token" is created automatically when creating an ECH or self-hosted deployment, so there is one less step in a "getting started" guide when using Bearer token auth. A user must create an API key after the deployment is created for API key auth.
- API keys are revocable, support finer-grained permissions; you can have multiple API keys.
Note that this isn't just about docs. There are built-in getting-started flows in Kibana that default to one auth mechanisms or the other. So if docs are documenting what Kibana does, then a change must come in the Kibana flow first.