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

Tolerate both MP Metrics 4.0 and 5.0 APIs #611

Closed
wants to merge 5 commits into from

Conversation

Azquelt
Copy link
Member

@Azquelt Azquelt commented Oct 3, 2022

Tolerate the following breaking changes in MP Metrics 5.0, while retaining support for MP Metrics 4.0:

  • Methods removed from Snapshot
  • Gauge<T> changed to Gauge<T extends Number>
    • Breaks binary compatibility because method signatures are different
      after type erasure
  • MetricsRegistry injected with @RegistryScope instead of @RegistryType

- Methods removed from Snapshot
- Gauge<T> changed to Gauge<T extends Number>
  - Breaks binary compatibility because method signatures are different
    after type erasure
No longer needed since we now require MP Metrics 4.0
Reflection was for compatibility between MP Metrics 2 and 3 and is no
longer needed.
@Azquelt
Copy link
Member Author

Azquelt commented Oct 4, 2022

For some reason the github action builds are not using the latest commit. I'll force push again to see if that fixes it.

MP Metrics 5.0 uses RegistryScope instead of RegistryType to inject the
MetricRegistry for a particular metrics scope.

Add a BaseRegistry qualifier and create a different provider for the v4
and v5 metrics APIs.

Some code needs to be compiled against the Metrics 5.0 API, so separate
that out into a separate module.

The common code is in the 5.0 module so that it doesn't have a
dependency on the rest of the TCK so that it can be built before the TCK
and its classes included in the TCK jar.

The version of MP Metrics API in use is detected based on the presence
of the RegistryScope annotation, or can be overridden by setting a
system property.
@Azquelt
Copy link
Member Author

Azquelt commented Oct 5, 2022

MP Metrics 5.0 is going to deprecate and retain @RegistryType, so the changes in #612 are sufficient.

@Azquelt Azquelt closed this Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant