Skip to content

Add support for filtering metric label sets#1047

Merged
jmacd merged 8 commits intoopen-telemetry:masterfrom
jmacd:jmacd/label_filter
Aug 11, 2020
Merged

Add support for filtering metric label sets#1047
jmacd merged 8 commits intoopen-telemetry:masterfrom
jmacd:jmacd/label_filter

Conversation

@jmacd
Copy link
Copy Markdown
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
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>
@pellared pellared added this to the untracked milestone Nov 8, 2024
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.

4 participants