-
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
Fix jaeger agent embedded reporter builder bug #570
Conversation
- When overriding the collector service name using the agent app builder's embedded `WithCollectorServiceName`, the service name is stored in the embedded struct and not in the outer struct. - When constructing an agent using `createAgent`, `GetHttpServer` reads the outer struct leading to different behavior when reading configuration from a file, as opposed to using the builder. - This change uses go-yaml's `inline` keyword to deserialize embedded structs. Signed-off-by: Prithvi Raj <p.r@uber.com>
@@ -71,12 +68,7 @@ type Builder struct { | |||
HTTPServer HTTPServerConfiguration `yaml:"httpServer"` | |||
Metrics jmetrics.Builder `yaml:"metrics"` | |||
|
|||
// These 3 fields are copied from tchreporter.Builder because yaml does not parse embedded structs |
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.
CollectorServiceName string `yaml:"collectorServiceName"` | ||
|
||
tchreporter.Builder | ||
tchreporter.Builder `yaml:",inline"` |
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.
this is awesome. Could you search the rest of the code for this though? I think there may be other examples of this copy-pasta.
btw, why comma before inline
?
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.
btw, why comma before inline?
It declares an empty yaml tag for tchreporter.Builder
. Simply using inline
doesn't work.
Could you search the rest of the code for this though? I think there may be other examples of this copy-pasta.
I wasn't able to come up with a good way of searching for anonymous structs; Nothing else seems to have similar comments.
When overriding the collector service name using the agent app builder's embedded
WithCollectorServiceName
, the service name is stored in the embedded struct andnot in the outer struct.
When constructing an agent using
createAgent
,GetHttpServer
reads the outerstruct leading to different behavior when reading configuration from a file, as
opposed to using the builder.
This change uses go-yaml's
inline
keyword to deserialize embedded structs.Signed-off-by: Prithvi Raj p.r@uber.com