Skip to content

kafka: deprecate redundant auth.plain_text #38883

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .chloggen/kafka-deprecate-plaintext-kafkaexporter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: deprecation

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: kafkaexporter

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Deprecate `auth.plain_text` configuration. Use `auth.sasl` with mechanism set to PLAIN instead.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [38883]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
27 changes: 27 additions & 0 deletions .chloggen/kafka-deprecate-plaintext-kafkametricsreceiver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: deprecation

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: kafkametricsreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Deprecate `auth.plain_text` configuration. Use `auth.sasl` with mechanism set to PLAIN instead.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [38883]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
27 changes: 27 additions & 0 deletions .chloggen/kafka-deprecate-plaintext-kafkareceiver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: deprecation

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: kafkareceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Deprecate `auth.plain_text` configuration. Use `auth.sasl` with mechanism set to PLAIN instead.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [38883]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
27 changes: 27 additions & 0 deletions .chloggen/kafka-deprecate-plaintext-kafkatopicsobserver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: deprecation

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: kafkatopicsobserverextension

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Deprecate `auth.plain_text` configuration. Use `auth.sasl` with mechanism set to PLAIN instead.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [38883]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
2 changes: 1 addition & 1 deletion exporter/kafkaexporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The following settings can be optionally configured:
- `partition_metrics_by_resource_attributes` (default = false) configures the exporter to include the hash of sorted resource attributes as the message partitioning key in metric messages sent to kafka.
- `partition_logs_by_resource_attributes` (default = false) configures the exporter to include the hash of sorted resource attributes as the message partitioning key in log messages sent to kafka.
- `auth`
- `plain_text`
- `plain_text` (Deprecated in v0.123.0: use sasl with mechanism set to PLAIN instead.)
- `username`: The username to use.
- `password`: The password to use
- `sasl`
Expand Down
2 changes: 1 addition & 1 deletion extension/observer/kafkatopicsobserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The following settings can be optionally configured:
- `client_id` (default = "otel-collector"): The client ID to configure the Kafka client with.
- `topics_sync_interval` (default 5s)
- `auth`
- `plain_text`
- `plain_text` (Deprecated in v0.123.0: use sasl with mechanism set to PLAIN instead.)
- `username`: The username to use.
- `password`: The password to use
- `sasl`
Expand Down
3 changes: 3 additions & 0 deletions internal/kafka/configkafka/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ func NewDefaultMetadataConfig() MetadataConfig {

// AuthenticationConfig defines authentication-related configuration.
type AuthenticationConfig struct {
// PlainText is an alias for SASL/PLAIN authentication.
//
// Deprecated [v0.123.0]: use SASL with Mechanism set to PLAIN instead.
PlainText *PlainTextConfig `mapstructure:"plain_text"`
SASL *SASLConfig `mapstructure:"sasl"`
TLS *configtls.ClientConfig `mapstructure:"tls"`
Expand Down
8 changes: 7 additions & 1 deletion receiver/kafkametricsreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,15 @@ Optional Settings (with defaults):
- `collection_interval` (default = 1m): frequency of metric collection/scraping.
- `initial_delay` (default = `1s`): defines how long this receiver waits before starting.
- `auth` (default none)
- `plain_text`
- `plain_text` (Deprecated in v0.123.0: use sasl with mechanism set to PLAIN instead.)
- `username`: The username to use.
- `password`: The password to use
- `sasl`
- `username`: The username to use.
- `password`: The password to use.
- `mechanism`: The sasl mechanism to use (SCRAM-SHA-256, SCRAM-SHA-512, AWS_MSK_IAM, AWS_MSK_IAM_OAUTHBEARER or PLAIN)
- `aws_msk.region`: AWS Region in case of AWS_MSK_IAM or AWS_MSK_IAM_OAUTHBEARER mechanism
- `aws_msk.broker_addr`: MSK Broker address in case of AWS_MSK_IAM mechanism
- `tls`
- `ca_file`: path to the CA cert. For a client this verifies the server certificate. Should only be used
if `insecure` is set to true.
Expand Down
4 changes: 2 additions & 2 deletions receiver/kafkareceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ The following settings can be optionally configured:
- `default_fetch_size` (default = `1048576`): The default number of message bytes to fetch in a request, defaults to 1MB.
- `max_fetch_size` (default = `0`): The maximum number of message bytes to fetch in a request, defaults to unlimited.
- `auth`
- `plain_text`
- `plain_text` (Deprecated in v0.123.0: use sasl with mechanism set to PLAIN instead.)
- `username`: The username to use.
- `password`: The password to use
- `sasl`
- `username`: The username to use.
- `password`: The password to use
- `password`: The password to use.
- `mechanism`: The sasl mechanism to use (SCRAM-SHA-256, SCRAM-SHA-512, AWS_MSK_IAM, AWS_MSK_IAM_OAUTHBEARER or PLAIN)
- `aws_msk.region`: AWS Region in case of AWS_MSK_IAM or AWS_MSK_IAM_OAUTHBEARER mechanism
- `aws_msk.broker_addr`: MSK Broker address in case of AWS_MSK_IAM mechanism
Expand Down
Loading