otelcol.auth.basic
otelcol.auth.basic
exposes a handler
that other otelcol
components can use to authenticate requests using basic authentication.
This component supports both server and client authentication.
Note
otelcol.auth.basic
is a wrapper over the upstream OpenTelemetry Collectorbasicauth
extension. Bug reports or feature requests will be redirected to the upstream repository, if necessary.
You can specify multiple otelcol.auth.basic
components by giving them different labels.
Usage
otelcol.auth.basic "<LABEL>" {
username = "<USERNAME>"
password = "<PASSWORD>"
}
Arguments
You can use the following arguments with otelcol.auth.basic
:
Blocks
You can use the following block with otelcol.auth.basic
:
debug_metrics
The debug_metrics
block configures the metrics that this component generates to monitor its state.
The following arguments are supported:
disable_high_cardinality_metrics
is the Alloy equivalent to the telemetry.disableHighCardinalityMetrics
feature gate in the OpenTelemetry Collector.
It removes attributes that could cause high cardinality metrics.
For example, attributes with IP addresses and port numbers in metrics about HTTP and gRPC connections are removed.
Note
If configured,
disable_high_cardinality_metrics
only applies tootelcol.exporter.*
andotelcol.receiver.*
components.
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
doesn’t 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 = sys.env("API_KEY")
}