4.x: Neutral metrics API - revise MetricsFeature and rework Prometheus and JSON formatting#1
Open
tjquinno wants to merge 41 commits into
Open
4.x: Neutral metrics API - revise MetricsFeature and rework Prometheus and JSON formatting#1tjquinno wants to merge 41 commits into
tjquinno wants to merge 41 commits into
Conversation
…s; revise some method signatures; clean up a few things. More to come
…MP metrics so it will build while I work on the neutral metrics API
…Registry, and reworking factory and provider for obtaining a MeterRegistry from the highest-weight implementation. More work needed in the latter at least
…ough these changes will not build
… updates; still WIP--pushing for safe-keeping
…fig from MetricsConfig for use by Micrometer meter registry
…nit tests; some changes triggered by those tests
… fix he shared earlier
…ting in, needs tests
f570cc0 to
a8b1b46
Compare
db10c3f to
9eb9e92
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Continuing work on helidon-io#4868
This PR works forward from helidon-io#7261.
These changes update some of the basic classes (not drastically) and start the changes to the
MetricsFeatureto use the new API.Internal changes in how we format
/metricsoutputTo help keep dependencies cleaner, this PR rearranges how we format metrics output for the
/metricsendpoint. TheMetricsFeatureclass, primarily, needs to be able to format the output in arbitrary ways, selected by the media type. To do this without building hard dependencies from the feature module to Micrometer and the Micrometer Prometheus code (and potentially any other formatting approach), this PR introduces a service loader approach for formatting the output.The feature code now service-loads all
MeterRegistryFormatterProviderimplementations (the PR includes Micrometer Prometheus and JSON) and then invokes theformatter(MediaType)method on each. If the returnedOptional<MeterRegistryFormatter>is present then that provider handles that media type and the feature code uses that formatter. Otherwise the feature keeps looking for a provider that does handle the media type. If the feature finds none, then it returns a "406 - not acceptable" status.Documentation
See helidon-io#7381