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
[metrics][storage] Move metrics reader decorator to metrics storage factory #6287
[metrics][storage] Move metrics reader decorator to metrics storage factory #6287
Changes from 5 commits
a5cfa58
b7c9f59
449f08a
e7eb7cd
1144fe4
aa0323d
f2f6714
0d0921f
4842837
df0de70
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.
plugin/metrics
is a bad name, we should rename it toplugin/metricstore
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.
@yurishkuro I can do that in a follow-up PR
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.
we can also rename storage/metricsstore to storage/metricstore (single
s
)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.
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 we add a test?
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.
@yurishkuro We'll need to dip into the implementation of
prometheusstore.NewMetricsReader
to force an error here. Is that fine? Also, since we're just decorating the reader, do we want to force returning a nil if there is an error? My thinking was that we just pass along whatever it is we get without decorating the reader.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.
You can simulate the error easily by passing a TLS config with "foobar" for some of the certificates.
It is convention to return
nil, err
in case of errors. It's probably what you would get from the factory already, but when you returnmr, err
you are returning a typed nil, so the nil check may actually fail in the caller.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.
@yurishkuro sounds good! i'll also go back and do the same for the other factories in a follow-up PR
Check warning on line 63 in plugin/metrics/prometheus/factory.go
Codecov / codecov/patch
plugin/metrics/prometheus/factory.go#L62-L63
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.