Caution
Grafana Agent has reached End-of-Life (EOL) on November 1, 2025. Agent is no longer receiving vendor support and will no longer receive security or bug fixes. Current users of Agent Static mode, Agent Flow mode, and Agent Operator should proceed with migrating to Grafana Alloy. If you have already migrated to Alloy, no further action is required. Read more about why we recommend migrating to Grafana Alloy.
otelcol.auth.basic
otelcol.auth.basic exposes a handler that can be used by other otelcol
components to authenticate requests using basic authentication.
This extension supports both server and client authentication.
NOTE:
otelcol.auth.basicis a wrapper over the upstream OpenTelemetry Collectorbasicauthextension. Bug reports or feature requests will be redirected to the upstream repository, if necessary.
Multiple otelcol.auth.basic components can be specified by giving them
different labels.
Usage
otelcol.auth.basic "LABEL" {
username = "USERNAME"
password = "PASSWORD"
}Arguments
otelcol.auth.basic supports the following arguments:
Exported fields
The following fields are exported and can be referenced by other components:
Component health
otelcol.auth.basic is only reported as unhealthy if given an invalid
configuration.
Debug information
otelcol.auth.basic does not expose any component-specific debug information.
Example
This example configures otelcol.exporter.otlp to use basic authentication:
otelcol.exporter.otlp "example" {
client {
endpoint = "my-otlp-grpc-server:4317"
auth = otelcol.auth.basic.creds.handler
}
}
otelcol.auth.basic "creds" {
username = "demo"
password = env("API_KEY")
}


