Skip to content

Commit

Permalink
Add support for filtering attribute keys for streams via an exclude l…
Browse files Browse the repository at this point in the history
…ist (#4188)

## Changes

This change adds details around supporting the creation of a stream with
a set of excluded attribute keys. This functionality is supported in the
[Go
implementation](https://github.com/open-telemetry/opentelemetry-go/blob/main/sdk/metric/instrument.go#L146)
via the use of filters. The proposal in this PR is to address an issue
in the configuration working group:
open-telemetry/opentelemetry-configuration#112

Please provide a brief description of the changes here.

For non-trivial changes, follow the [change proposal
process](https://github.com/open-telemetry/opentelemetry-specification/blob/main/CONTRIBUTING.md#proposing-a-change).

* [x] Links to the prototypes (when adding or changing features) 
* [x]
[`CHANGELOG.md`](https://github.com/open-telemetry/opentelemetry-specification/blob/main/CHANGELOG.md)
file updated for non-trivial changes
* [x]
[`spec-compliance-matrix.md`](https://github.com/open-telemetry/opentelemetry-specification/blob/main/spec-compliance-matrix.md)
updated if necessary

---------

Signed-off-by: Alex Boten <[email protected]>
  • Loading branch information
codeboten authored Sep 18, 2024
1 parent 0a87e2f commit ed85e12
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ release.

### Metrics

- Add support for filtering attribute keys for streams via an exclude list.
([#4188](https://github.com/open-telemetry/opentelemetry-specification/pull/4188))
- Clarify that `Enabled` only applies to synchronous instruments.
([#4211](https://github.com/open-telemetry/opentelemetry-specification/pull/4211))

Expand Down
1 change: 1 addition & 0 deletions spec-compliance-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ formats is required. Implementing more than one format is optional.
| The `View` instrument selection criteria supports the match-all wildcard. | | | + | + | + | | + | | + | + | + | |
| The name of the `View` can be specified. | | | + | + | + | | + | + | | + | + | |
| The `View` allows configuring the name, description, attributes keys and aggregation of the resulting metric stream. | | | + | + | + | | + | + | + | + | - | |
| The `View` allows configuring excluded attribute keys of resulting metric stream. | | + | | | | | | | | | | |
| The `View` allows configuring the exemplar reservoir of resulting metric stream. | X | | - | | - | | - | | | | - | |
| The SDK allows more than one `View` to be specified per instrument. | X | | + | + | + | | + | | + | + | + | |
| The `Drop` aggregation is available. | | + | + | + | + | | + | | + | + | + | |
Expand Down
7 changes: 7 additions & 0 deletions specification/metrics/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,13 @@ The SDK MUST accept the following stream configuration parameters:
parameter configured on the instrument instead. If the `Attributes`
advisory parameter is absent, all attributes MUST be kept.

Additionally, implementations SHOULD support configuring an exclude-list of
attribute keys. The exclude-list contains attribute keys that identify the
attributes that MUST be excluded, all other attributes MUST be kept. If an
attribute key is both included and excluded, the SDK MAY fail fast in
accordance with initialization [error handling
principles](../error-handling.md#basic-error-handling-principles).

* `aggregation`: The name of an [aggregation](#aggregation) function to use in
aggregating the metric stream data.

Expand Down

0 comments on commit ed85e12

Please sign in to comment.