Refactor OCI metrics for current builder/config and for extension#11320
Draft
tjquinno wants to merge 4 commits intohelidon-io:helidon-4.xfrom
Draft
Refactor OCI metrics for current builder/config and for extension#11320tjquinno wants to merge 4 commits intohelidon-io:helidon-4.xfrom
tjquinno wants to merge 4 commits intohelidon-io:helidon-4.xfrom
Conversation
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
Resolves #11319
The existing OCI Metrics integration uses the older-style builder and config approach, and also uses camel-cased instead of hyphenated config keys.
This PR re-implements the integration:
Adds the
OciMetricsConfigBlueprintwhich constructs the newOciMetricsService(intended to be functionally equivalent to the now-deprecatedOciMetricsSupport). The config part now uses the current builder/config style and hyphenated config keys for the properties.The metrics "push" feature now primarily appears as a metrics publisher. Settings would appear like this:
As before, the OCI metrics settings control the use of the
Monitoringinstance which actually connects to the backend; these settings do not set up theMonitoringinstance itself.The developer can programmatically provide the
Monitoringinstance to the builder. If not, the code gets theMonitoringinstance from the service registry.The pre-existing
OciMetricsSupportclass now delegates to the newOciMetricsServiceclass so we have the logic in one place, butOciMetricsSupportpresents the existing public API to the users (API and config keys).The new class is not an
HttpService. The old one was so it could be informed of webserver start-up and shutdown. Instead, the new class sets up the scheduled executor to send the data upon construction of the runtime object and registers as a Helidon shutdown hook so it can stop the executor when the server is shutting down.The new class also participates in CRaC so the publisher resumes pushing when the service is resumed.
The test directory includes a blueprint and a configured provider which make sure we can extend the public OCI metrics types in a way that provides synonyms for certain configured properties.
The original API remains intact for backward compatibility although is marked as deprecated.
Documentation
Coming soon.