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

Emit correct warning for duplicate instrument conflict #4203

Closed
MrAlias opened this issue Jun 5, 2023 · 0 comments · Fixed by #4349
Closed

Emit correct warning for duplicate instrument conflict #4203

MrAlias opened this issue Jun 5, 2023 · 0 comments · Fixed by #4349
Assignees
Labels
area:metrics Part of OpenTelemetry Metrics pkg:SDK Related to an SDK package

Comments

@MrAlias
Copy link
Contributor

MrAlias commented Jun 5, 2023

From the specification:

The emitted warning SHOULD include information for the user on how to resolve the conflict, if possible.

  1. If the potential conflict involves multiple description properties, setting the description through a configured View SHOULD avoid the warning.
  2. If the potential conflict involves instruments that can be distinguished by a supported View selector (e.g., instrument type) a renaming View recipe SHOULD be included in the warning.
  3. Otherwise (e.g., use of multiple units), the SDK SHOULD pass through the data by reporting both Metric objects and emit a generic warning describing the duplicate instrument registration.

The first two items are not done.

global.Info(
"duplicate metric stream definitions",
"names", fmt.Sprintf("%q, %q", existing.Name, id.Name),
"descriptions", fmt.Sprintf("%q, %q", existing.Description, id.Description),
"units", fmt.Sprintf("%s, %s", existing.Unit, id.Unit),
"numbers", fmt.Sprintf("%s, %s", existing.Number, id.Number),
"aggregations", fmt.Sprintf("%s, %s", existing.Aggregation, id.Aggregation),
"monotonics", fmt.Sprintf("%t, %t", existing.Monotonic, id.Monotonic),
"temporalities", fmt.Sprintf("%s, %s", existing.Temporality.String(), id.Temporality.String()),
)

Originally posted by @MrAlias in #3653 (comment)

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 pkg:SDK Related to an SDK package
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

1 participant