Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ release.

- Add development `maxExportBatchSize` parameter to Periodic exporting MetricReader.
([#4895](https://github.com/open-telemetry/opentelemetry-specification/pull/4895))
- Add development `exclude_attribute_keys` parameter to Stream Configuration.
([#4951](https://github.com/open-telemetry/opentelemetry-specification/pull/4951))
- Add development `Exclude_Attributes` parameter to Instrument Advisory.
([#4951](https://github.com/open-telemetry/opentelemetry-specification/pull/4951))

### Logs

Expand Down
9 changes: 9 additions & 0 deletions specification/metrics/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,15 @@ Applies to all instrument types.
`Attributes` (a list of [attribute keys](../common/README.md#attribute)) is
the recommended set of attribute keys to be used for the resulting metrics.

##### Instrument advisory parameter: `Exclude_Attributes`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't need this in the API/advisory. if something should not be used, then instrumentation can not provide it at all.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't opt-in/deprecated attributes reside in this advisory? That way if stream config doesn't specify included/excluded attributes the advisory can be used to exclude them with 0 zero config.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opt-in attributes are not emitted by instrumentation (because SDK respects it) by default — they only appear when the user explicitly opts in via Views. So there's nothing to exclude in the zero-config case.

For exclude_attributes, the instrumentation library itself should stop emitting them (or the semantic conventions should guide the migration). The fix belongs at the instrumentation layer, not as an SDK-side exclude hint.

The existing Attributes (include) advisory already covers the zero-config story: the instrumentation author lists the recommended attribute keys, and anything not on that list is implicitly not recommended.


**Status**: [Development](../document-status.md)

Applies to all instrument types.

`Exclude_Attributes` (a list of [attribute keys](../common/README.md#attribute)) is
the recommended set of attribute keys to not be used for the resulting metrics.

#### Synchronous and Asynchronous instruments

Instruments are categorized on whether they are synchronous or
Expand Down
13 changes: 11 additions & 2 deletions specification/metrics/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,22 @@ 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
* `exlude_attribute_keys`: This is, at a minimum, an exclude-list of attribute keys for
measurements captured in the metric stream.
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).

Users can provide `exclude_attribute_keys`, but it is up to their discretion.
Therefore, the stream configuration parameter needs to be structured to
accept `exclude_attribute_keys`, but MUST NOT obligate a user to provide them.
If the user does not provide any value, the SDK SHOULD use
the [`Exclude Attributes`](./api.md#instrument-advisory-parameters) advisory
parameter configured on the instrument instead. If the `Exclude Attributes`
advisory parameter is absent, all attributes MUST be kept.

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

Expand Down
Loading