Skip to content
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 support for filtering metric label sets #1047

Merged
merged 8 commits into from
Aug 11, 2020

Conversation

jmacd
Copy link
Contributor

@jmacd jmacd commented Aug 9, 2020

This PR adds a label.Set.Filter() method used to reduce label set dimensionality in a metric Processor. The Filter is a func(string) bool that includes labels when true and excludes labels when false.

This was demonstrated in #1023, as being potentially useful in the Accumulator to avoid accumulation of synchronous instrument records by filtering at every metric event. Note that label filtering requires the fix in #1024 whether performed in the Accumulator or a Processor.

A companion PR #1048 adds a label set dimensionality-reducing Processor.

@jmacd jmacd added the area:metrics Part of OpenTelemetry Metrics label Aug 9, 2020
api/label/set.go Outdated Show resolved Hide resolved
api/label/set.go Outdated Show resolved Hide resolved
api/label/set.go Outdated Show resolved Hide resolved
api/label/set.go Outdated Show resolved Hide resolved
api/label/set.go Outdated Show resolved Hide resolved
Thank you @MrAlias.

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
@jmacd jmacd merged commit b7df554 into open-telemetry:master Aug 11, 2020
@jmacd jmacd deleted the jmacd/label_filter branch August 11, 2020 18:00
@Aneurysm9 Aneurysm9 mentioned this pull request Aug 24, 2020
evantorrie pushed a commit to evantorrie/opentelemetry-go that referenced this pull request Sep 10, 2020
* Add support for filtering label sets

* Restore test

* Fix Value() bug

* Pass kv.KeyValue

* Apply suggestions from code review

Thank you @MrAlias.

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:metrics Part of OpenTelemetry Metrics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants