-
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
[receiver/zipkin] move global server configuration parameters to a separate parameter #35851
base: main
Are you sure you want to change the base?
Conversation
19be99b
to
d7fe5ae
Compare
@andrzej-stencel would you please have time for a review? |
0fc263b
to
ca05388
Compare
# Use this changelog template to create an entry for release notes. | ||
|
||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: breaking |
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.
Can you explain why marking this as a breaking change?
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'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?
4a31165
to
8a59a9a
Compare
…parate parameter 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]>
Signed-off-by: odubajDT <[email protected]>
Co-authored-by: Andrzej Stencel <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
5c8e10f
to
c476c08
Compare
return fmt.Errorf(deprecationConfigMsg) | ||
} | ||
if isServerConfigDefined(cfg.Protocols.HTTP) { | ||
return fmt.Errorf("cannot use .protocols.http together with default server config setup") |
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'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." |
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.
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") |
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.
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) |
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'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.
Description
Move global server configuration parameters to a separate parameter under
protocols
parameter to allow future support of different protocols (like UDP), more context hereLink to tracking issue
Fixes #35730
Testing
Documentation