-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[exporter/kafka] move kafka configures authentication to internal pkg #27289
Conversation
19b488c
to
03255c4
Compare
.github/dependabot.yml
Outdated
@@ -1097,8 +1102,3 @@ updates: | |||
schedule: | |||
interval: "weekly" | |||
day: "wednesday" | |||
- package-ecosystem: "gomod" | |||
directory: "/receiver/solacereceiver" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this part is removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not deleted it purposely, it
seems make gendependabot
do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest you revert this unrelated change if possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I've no idea whether we need to revert this merged PR, as mentioned by @dmitryax below, there are different suggestions.
@@ -103,7 +105,7 @@ func (cfg *Config) Validate() error { | |||
return validateSASLConfig(cfg.Authentication.SASL) | |||
} | |||
|
|||
func validateSASLConfig(c *SASLConfig) error { | |||
func validateSASLConfig(c *kafka.SASLConfig) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Speaking of validation, how about defining a common validation function for kafka.Authentication
in internal/kafka
package, which can be reused by kafkametricsreceiver
, kafkareceiver
and kafkaexporter
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It sounds great, it seems duplicate logic
in between validateSASLConfig
and configureSASL
, maybe we can defining a common validation function as you said :), and we can make a separate issue to follow up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you help create an issue for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! I am glad to do that, i will make it a few days later since without bringing laptop currently
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you help create an issue for this?
Sorry for delay, #27486
03255c4
to
7e7e45f
Compare
c965d6b
to
f9fb48b
Compare
@MovieStoreGuy @dmitryax could you help review about this pr? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks @sakulali!
I just realized I missed something important thing after merging the PR. It definitely makes to remove the dependency on the exporter from other components and move the code to a common package, but I don't believe we can move configuration parts to internal package. Doing it, we are making it impossible to setup the kafka components programmatically, which I believe we should allow cc @atoulme, I don't think |
To properly reflect change in open-telemetry#27289
Checkapi only checks for functions, not structs. |
Thanks for the thorough review @dmitryax! If you believe that moving the configuration to the internal package is not a reasonable approach, should I revert the merged PR and consider placing the configuration in a different package or location? I think that if we place it in the pkg module, it can be used by other repositories as well. |
To properly reflect change in #27289
No, I think it's not that big of an issue. I see we have other components with config options in the internal package, e.g. k8s ones. Let's see if someone complains after this change :)
Right, I'd suggest we handle this generically with other components like |
…open-telemetry#27289) **Description:** Move kafka configures authentication to internal pkg, make references become clearer. Additionally, avoid to use export function `kafkaexporter.ConfigureAuthentication` to pass checkapi. **Link to tracking Issue:** open-telemetry#27093
To properly reflect change in open-telemetry#27289
I was just writing an issue about this, I'm trying to simplify a project that I've made by using structs from the collector project directly instead of having the serialize and make my own struct replicating what the project has already created. I'm making something that simplifies the process of configuring the collector for the company I work for, I want to do prefills and have the option for either grpc or kafka. With the core structs for grpc I can just use all for the config structs without any issues which helps me reduce complexity. With the kafka implementation I find that the Authentication field breaks due to it being in a internal folder. Thus im either stuck at an older version or have to revert to my own struct that implements the same fields as the struct im trying to use from Could we revisit this and move the code to a |
I am encountering this very issue. I'm attempting to use the kafka exporter for a custom collector that I'm building and I want to export to AWS MSK, only issue is that I this requires token authentication which I can't configure because the Authentication field is referencing a struct that is in an internal package, see here. IMHO I think it makes sense to have this authentication logic in |
Description:
Move kafka configures authentication to internal pkg, make references become clearer. Additionally, avoid to use export function
kafkaexporter.ConfigureAuthentication
to pass checkapi.Link to tracking Issue:
#27093
Testing:
make gotidy
make golint
make crosslink
make multimod-verify
make gendependabot
make genotelcontribcol
make docker-otelcontribcol
go test for kafkaexporter
go test for kafkametricsreceiver
go test for kafkareceiver
go test for internal/kafka
Documentation: