-
Notifications
You must be signed in to change notification settings - Fork 889
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 predicate to MetricReader and MetricProducer #3566
Conversation
@reyang @jack-berg Following our Zoom call, here is the PR I've prepared to match the proposal detailed in the issue #3324. @reyang In our discussion you mentioned a different model where we will have a processor which will have an optional filter associated with it, so we can know whether we should stream metric data point to the processor, from the metric producer. You said you will think about it. |
…iew doesn't allow selecting an instrument based on description
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
I'm working on a big adjustment to it, please don't close it |
… as filter rules.
@reyang @jack-berg I've revamped the PR in the last commit, following the filter rules approach. Your feedback is much appreciated. |
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.
Thanks for driving this, I support this change.
My only comment here is about naming, to open up the possibility to also have predicates and filters on meters as a whole, not individual metrics.
Please consider renaming like:
Filter
->InstrumentFilter
orMetricFilter
Predicate
->InstrumentPredicate
orMetricPredicate
etc.
Of course, Meter predicates will be an entirely separate discussion and PR, not to take place here, but I just would like to prevent future naming collisions.
Co-authored-by: Reiley Yang <reyang@microsoft.com>
Does a prototype exist for this anywhere? The contribution guidelines specify that prototypes are required to help evaluate. We recently re-affirmed this expectation in #3574. I ask because the motivation for this is primarily performance oriented. As we've discussed, there's presumably some performance overhead for a reader accessing the aggregated state of all instruments, and for invoking all the callbacks. The predicate stands to avoid some of this overhead. The iteration of this PR which includes rules seems adds a lot of surface area relative to the original version which just required implementations to expose some way to specify a predicate to readers. I want to know what kind of performance improvement we stand to gain by introducing this new surface area. To be frank, its a lot of new surface area / concepts for what I currently view as a niche use case. |
@dashpole Did I add the changelog and compliance matrix correctly? |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
@dashpole Did I add the changelog and compliance matrix correctly? |
Changelog and matrix look correct. |
So, what is the next step before merging @dashpole ? |
Fixes #3324
Changes
As described in #3324 , there is a need to have the ability to filter out selected (instrument, attribute) pairs at the
MetricReader
Collect
operation. For efficiency reasons, this needs to be pushed down to theMetricProducer
(s) - both the SDK's one and the registered external ones. Implementations are encouraged to use thepredicate
to avoid allocating memory allocation for the resulting data point if the predicate filters it out.TODO