Skip to content
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

[receiver/zipkin] move global server configuration parameters to a separate parameter #35851

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

odubajDT
Copy link
Contributor

@odubajDT odubajDT commented Oct 17, 2024

Description

Move global server configuration parameters to a separate parameter under protocols parameter to allow future support of different protocols (like UDP), more context here

Link to tracking issue

Fixes #35730

Testing

Documentation

@github-actions github-actions bot added the receiver/zipkin Zipkin receiver label Oct 17, 2024
@odubajDT odubajDT changed the title [receiver/zipkin] move global server configuration parameters to a se… [receiver/zipkin] move global server configuration parameters to a separate parameter Oct 17, 2024
@odubajDT odubajDT marked this pull request as ready for review October 17, 2024 13:04
@odubajDT odubajDT requested a review from a team as a code owner October 17, 2024 13:04
@odubajDT
Copy link
Contributor Author

@andrzej-stencel would you please have time for a review?

# Use this changelog template to create an entry for release notes.

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

@andrzej-stencel andrzej-stencel Nov 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why marking this as a breaking change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's changing the configuration of the receiver even if it's changed behind a feature gate, but the user will be affected if the feature gate will be turned on/off. Do you consider this more as a deprecation?

odubajDT and others added 10 commits November 20, 2024 07:27
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
return fmt.Errorf(deprecationConfigMsg)
}
if isServerConfigDefined(cfg.Protocols.HTTP) {
return fmt.Errorf("cannot use .protocols.http together with default server config setup")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid that with the current implementation of this change, the collector will fail to start also when user does not specify the protocols::http configuration. This is because the protocols::http configuration is part of the default config. As a result, collector will fail to start with this config:

receivers:
  zipkin:
    endpoint: localhost:1234

To fix this, I propose to follow the approach that the OTLP receiver does here. It implements the Unmarshal method on the config where it removes the part of the default config that was not set by the user (the conf structure only contains config options set by the user).

)

const deprecationConfigMsg = "the inline setting of http server parameters has been deprecated, please use .protocols.http parameter instead."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const deprecationConfigMsg = "the inline setting of http server parameters has been deprecated, please use .protocols.http parameter instead."
const deprecationConfigMsg = "the inline setting of http server parameters has been deprecated, please use protocols::http parameter instead."

return fmt.Errorf(deprecationConfigMsg)
}
if isServerConfigDefined(cfg.Protocols.HTTP) {
return fmt.Errorf("cannot use .protocols.http together with default server config setup")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return fmt.Errorf("cannot use .protocols.http together with default server config setup")
return fmt.Errorf("cannot use protocols::http together with default server config setup")

}

var _ component.Config = (*Config)(nil)

// Validate checks the receiver configuration is valid
func (cfg *Config) Validate() error {
if isServerConfigDefined(cfg.ServerConfig) {
if disallowHTTPDefaultProtocol.IsEnabled() {
return fmt.Errorf(deprecationConfigMsg)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if re-using the deprecation warning message as the error message when the feature gate is enabled will be clear enough for the users when they see it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor Zipkin Receiver to include Protocols in Config
3 participants