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

Clarify view conflicts #2462

Merged
merged 14 commits into from
Apr 13, 2022
Merged
Changes from 3 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
19 changes: 12 additions & 7 deletions specification/metrics/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,11 @@ In order to avoid conflicts, views which specify a name SHOULD have an
instrument selector that selects at most one instrument. For the registration
mechanism described above, where selection is provided via configuration, the
SDK SHOULD NOT allow Views with a specified name to be declared with instrument
selectors that may select more than one instrument (e.g. wild card instrument name)
in the same Meter.
selectors that may select more than one instrument (e.g. wild card instrument
name) in the same Meter. For this and other cases where registering a view will
cause a conflict, SDKs MAY fail fast in accordance with
initialization [error handling principles](../error-handling.md#basic-error-handling-principles)
.
jack-berg marked this conversation as resolved.
Show resolved Hide resolved

The SDK SHOULD use the following logic to determine how to process Measurements
made with an Instrument:
Expand All @@ -210,11 +213,13 @@ made with an Instrument:
* If the `MeterProvider` has one or more `View`(s) registered:
* For each View, if the Instrument could match the instrument selection
criteria:
* Try to apply the View configuration. If there is an error or a conflict
(e.g. the View requires to export the metrics using a certain name, but
the name is already used by another View), provide a way to let the user
know (e.g. expose
[self-diagnostics logs](../error-handling.md#self-diagnostics)).
* Try to apply the View configuration. If applying the View results
cijothomas marked this conversation as resolved.
Show resolved Hide resolved
in [conflicting metric identities](./datamodel.md#exponentialhistogram-producer-recommendations)
jmacd marked this conversation as resolved.
Show resolved Hide resolved
the implementation SHOULD apply the View and emit a warning. If it is not
possible to apply the View without producing semantic errors (e.g. the
View sets an asynchronous instrument to use
the [Histogram aggregation](#histogram-aggregation)) the implementation
SHOULD drop the View and emit a warning.
reyang marked this conversation as resolved.
Show resolved Hide resolved
jack-berg marked this conversation as resolved.
Show resolved Hide resolved
* If the Instrument could not match with any of the registered `View`(s), the
SDK SHOULD enable the instrument using the default aggregation and temporality.
Users can configure match-all Views using [Drop aggregation](#drop-aggregation)
Expand Down