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

Fix multiple registration of Jaeger-related gauges #6013

Merged
merged 1 commit into from
Jan 31, 2023

Conversation

tjquinno
Copy link
Member

Resolves #5811

The Helidon Jaeger tracing integration registers metrics on behalf of Jaeger by acting as a Jaeger MetricsFactory. In doing so, Helidon defines the metrics metadata to be reusable so if multiple components and/or the developer's own app use Jaeger tracing we don't define duplicate metrics.

But, Helidon gauges (consistent with MicroProfile metrics) are never reusable, regardless of what the metadata says. Jaeger requests the creation of gauges, and with multiple traceable components present the second attempt to register the same gauge fails, as reported in the issue.

This fix explicitly checks for the existence of a gauge (metric name and tags) before registering it to avoid this problem.

Because of the Jaeger SPI we implement, we need to be able to find the Jaeger-typed Gauge which corresponds to each Helidon Gauge so the PR adds a map. (The way we implement gauges internally does not allow us to simply store a reference to the Jaeger gauge in our own gauge and then retrieve the Jaeger gauge from it; hence the need for the map.)

Signed-off-by: [email protected] [email protected]

@tjquinno tjquinno self-assigned this Jan 31, 2023
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jan 31, 2023
@tjquinno tjquinno merged commit 43893aa into helidon-io:helidon-2.x Jan 31, 2023
@tjquinno tjquinno deleted the jaeger-trace-2.x branch January 31, 2023 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants