Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add node id/name to config #17750
Add node id/name to config #17750
Changes from 4 commits
45b1ceb
0701d01
507286f
1d0b2dd
f2eb143
6fd48dd
c70fe10
3f8550e
80ff6d3
896e04e
d50a6ae
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
nit: don't think this should ever be empty since it gets generated in setup.go!
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.
Yeah just being safe here.
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.
nit: moving this up here would make the Scada init logs have a named prefix of
sink.scada
. We could move it to line 41 before MetricsClient initializationThere 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.
Pulling out the metrics client instantion allows us to pass the configuration in as a CloudConfig instead of an interface as is done for the NewMetricsClient. This allows us to actually access configuration values stored in the config struct.
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.
Sounds good. We could honestly even remove the interface for the MetricsClient. In my initial implementation, it felt like the easiest way to test, but I have some alternate ideas. We could do that in a follow up PR maybe! Ideally we also cleanup / refactor and test the config object (a rabbit hole :p)!
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 correct?
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.
Yes, we build up the labels based off the configuration passed in. Likely we will need more configuration values in the future so I opted to pass the whole cfg object now so as more are requested we can just update the cfg and the key inside the DefaultLabels func
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 no longer applies since we don't initialize the metrics client inside the sink.