Skip to content

Commit 81968ea

Browse files
committed
kafka: deprecate redundant auth.plain_text
If `auth.plain_text` is configured, internally SASL/PLAIN is configured. This config is redundant and makes things harder to understand: as a user, should I configure auth.plain_text, or auth.sasl with mechanism PLAIN? If I set plain_text I can't specify the SASL protocol version, why not? So let's simplify, at the expense of slightly more verbose, but more explicit, configuration. Instead of configuring: ```yaml auth: plain_text: username: alice password: bob ``` ... you should configure this instead: ```yaml auth: sasl: mechanism: PLAIN username: alice password: bob ```
1 parent 53f70a2 commit 81968ea

File tree

9 files changed

+122
-5
lines changed

9 files changed

+122
-5
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: deprecation
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: kafkaexporter
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Deprecate `auth.plain_text` configuration. Use `auth.sasl` with mechanism set to PLAIN instead.
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [38883]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [user]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: deprecation
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: kafkametricsreceiver
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Deprecate `auth.plain_text` configuration. Use `auth.sasl` with mechanism set to PLAIN instead.
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [38883]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [user]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: deprecation
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: kafkareceiver
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Deprecate `auth.plain_text` configuration. Use `auth.sasl` with mechanism set to PLAIN instead.
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [38883]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [user]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: deprecation
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: kafkatopicsobserverextension
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Deprecate `auth.plain_text` configuration. Use `auth.sasl` with mechanism set to PLAIN instead.
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [38883]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [user]

exporter/kafkaexporter/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The following settings can be optionally configured:
4040
- `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.
4141
- `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.
4242
- `auth`
43-
- `plain_text`
43+
- `plain_text` (Deprecated in v0.123.0: use sasl with mechanism set to PLAIN instead.)
4444
- `username`: The username to use.
4545
- `password`: The password to use
4646
- `sasl`

extension/observer/kafkatopicsobserver/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The following settings can be optionally configured:
2929
- `client_id` (default = "otel-collector"): The client ID to configure the Kafka client with.
3030
- `topics_sync_interval` (default 5s)
3131
- `auth`
32-
- `plain_text`
32+
- `plain_text` (Deprecated in v0.123.0: use sasl with mechanism set to PLAIN instead.)
3333
- `username`: The username to use.
3434
- `password`: The password to use
3535
- `sasl`

internal/kafka/configkafka/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,9 @@ func NewDefaultMetadataConfig() MetadataConfig {
260260

261261
// AuthenticationConfig defines authentication-related configuration.
262262
type AuthenticationConfig struct {
263+
// PlainText is an alias for SASL/PLAIN authentication.
264+
//
265+
// Deprecated [v0.123.0]: use SASL with Mechanism set to PLAIN instead.
263266
PlainText *PlainTextConfig `mapstructure:"plain_text"`
264267
SASL *SASLConfig `mapstructure:"sasl"`
265268
TLS *configtls.ClientConfig `mapstructure:"tls"`

receiver/kafkametricsreceiver/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,15 @@ Optional Settings (with defaults):
4444
- `collection_interval` (default = 1m): frequency of metric collection/scraping.
4545
- `initial_delay` (default = `1s`): defines how long this receiver waits before starting.
4646
- `auth` (default none)
47-
- `plain_text`
47+
- `plain_text` (Deprecated in v0.123.0: use sasl with mechanism set to PLAIN instead.)
4848
- `username`: The username to use.
4949
- `password`: The password to use
50+
- `sasl`
51+
- `username`: The username to use.
52+
- `password`: The password to use.
53+
- `mechanism`: The sasl mechanism to use (SCRAM-SHA-256, SCRAM-SHA-512, AWS_MSK_IAM, AWS_MSK_IAM_OAUTHBEARER or PLAIN)
54+
- `aws_msk.region`: AWS Region in case of AWS_MSK_IAM or AWS_MSK_IAM_OAUTHBEARER mechanism
55+
- `aws_msk.broker_addr`: MSK Broker address in case of AWS_MSK_IAM mechanism
5056
- `tls`
5157
- `ca_file`: path to the CA cert. For a client this verifies the server certificate. Should only be used
5258
if `insecure` is set to true.

receiver/kafkareceiver/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ The following settings can be optionally configured:
5050
- `default_fetch_size` (default = `1048576`): The default number of message bytes to fetch in a request, defaults to 1MB.
5151
- `max_fetch_size` (default = `0`): The maximum number of message bytes to fetch in a request, defaults to unlimited.
5252
- `auth`
53-
- `plain_text`
53+
- `plain_text` (Deprecated in v0.123.0: use sasl with mechanism set to PLAIN instead.)
5454
- `username`: The username to use.
5555
- `password`: The password to use
5656
- `sasl`
5757
- `username`: The username to use.
58-
- `password`: The password to use
58+
- `password`: The password to use.
5959
- `mechanism`: The sasl mechanism to use (SCRAM-SHA-256, SCRAM-SHA-512, AWS_MSK_IAM, AWS_MSK_IAM_OAUTHBEARER or PLAIN)
6060
- `aws_msk.region`: AWS Region in case of AWS_MSK_IAM or AWS_MSK_IAM_OAUTHBEARER mechanism
6161
- `aws_msk.broker_addr`: MSK Broker address in case of AWS_MSK_IAM mechanism

0 commit comments

Comments
 (0)