-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[ASCII-2428] Create a metaCollector singleton #30772
Conversation
That way we no longer need to provide an optional workloadmeta when calling the tagger functions This would allow us to fully decouple the different tagger implementation into separate packages, and ensuring the remote tagger implementation do not have a reference to the workloadmeta component
Test changes on VMUse this command from test-infra-definitions to manually test this PR changes on a VM: inv create-vm --pipeline-id=48328531 --os-family=ubuntu Note: This applies to commit 3465c8f |
) | ||
|
||
func TestStartCommand(t *testing.T) { | ||
fxutil.TestOneShotSubcommand(t, | ||
[]*cobra.Command{MakeCommand("defaultLogFile")}, | ||
[]string{"start", "--cfgpath", "PATH"}, | ||
[]string{"start"}, |
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.
Is this change really necessary for workloadmeta decoupling?
@@ -81,7 +79,7 @@ func newParser(cfg model.Reader, float64List *float64ListPool, workerNum int, wm | |||
readTimestamps: readTimestamps, | |||
float64List: float64List, | |||
dsdOriginEnabled: cfg.GetBool("dogstatsd_origin_detection_client"), | |||
provider: provider.GetProvider(wmeta), | |||
provider: provider.GetMetaCollector(), |
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 seems unnecessarily fragile. Before this change the provider was made sure to be initialized whenever it was used, now this depends on the code scattered around cmd
for this. (GetProvider
starts a background process that feeds data into the meta collector, but GetMetaCollector
does not). I get the need to decouple the tagger component from the workloadmeta, but is there really any need to decouple the dogstatsd server?
What does this PR do?
Create a metaCollector singleton
Motivation
That way we no longer need to provide an optional workloadmeta when calling the tagger functions
This would allow us to fully decouple the different tagger implementation into separate packages, and ensuring the remote tagger implementation do not have a reference to the workloadmeta component
The last three commits also refactor a few places in the codebase that there were passing an optional workloadmeta. component to get the
MetaCollector
pkg/flare
The future
Ideally the
util/containers/metrics
should become its own component. That would avoid the usage of globals. Creating the component is a much bigger change. This change unblocks us from splitting the tagger component into multiple implementations, but ideally, we should create a separate component and pass it as a dependency to the places that used it.Describe how to test/QA your changes
Unit tests are updated
[TBD] How to to test origin detection mode
Possible Drawbacks / Trade-offs
Additional Notes