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 MetricReader interface #1888
Add MetricReader interface #1888
Changes from 21 commits
435c422
f50922d
38b61a4
7623003
b3f0fe0
0c2fa70
4e003a8
d60f4ff
6716bd7
c42cbc6
24379f2
b1b5b2c
1305453
ee5f5b8
104d65a
f6bff7c
fd9dfc4
5029131
ee04190
b2e2fad
86a2c6d
47f74e9
7977fbf
756d65c
68f4fdc
afafa2c
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.
We discussed offline that this section isn't necessarily providing anything over just the MetricReader interface.
I do think you might want to consider if the PrometheusExporter should be specified as a MetricReader or MetricExporter, or if you're leaving that up to SDKs. IIUC from our discussion, you're planning to leave that up to SDKs right now.
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've updated the wording for pull exporter (e.g. PrometheusExporter) in this commit.
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.
Fundamentally there's a few open questions here that I don't think are addressed in the verbage:
MetricExporter
, when it's a "Pull" exporter MUST be able to call some kind of "go collect things now"? IIUC BaseMetricReader offers that capability toMetricExporter
so you could have a Push->Pull adaptedMetricExporter
and manually callcollect
. I'm against forcing this on SDKs via the specification. If Push->Pull adaptation must go through interval metric reader, I think we have a much simpler system to maintain.MetricExporter
interface in the specification? I assume this will be answered in a follow up PR. I think forcing that will limit the utility ofMetricReader
for pull-export.Base exporting MetricReader
required for SDKs to implement?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: Can this example show with
PeriodicMetricReader
?I can't think of an example where you'd use just
Base
for this case over an explicit instance.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.
For example, I have a Console Exporter, and I don't want it to export data periodically, what I want is "only prints data to the stdout when I press the ENTER key".
If we force people to use
PeriodicMetricReader
, it could still work and I guess the workaround is to put the exporter interval to 1 million years.We might also step back and say "it seems to be an over design" and I'm fine to compromise.
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.
For your ConsoleExporter example (and any Push -> Pull adaptation), I'd argue what you want (instead of MetricReader) is to specify a helper/adapter for MetricExporter that stores metrics in-memory (performing additional aggregations every export interval) and when you press enter you get the data from the LAST export period.
I believe this is one of the ways the opentelemetry collecter can export to prometheus (the http endpoint).
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've updated the diagram to use
periodic exporting MetricReader
.I've moved the pull exporter examples and diagram to the pull exporter section and clarified that these are just examples so folks can do, but it is not required.