Skip to content

Refactor OCI metrics for current builder/config and for extension#11320

Draft
tjquinno wants to merge 4 commits intohelidon-io:helidon-4.xfrom
tjquinno:4.x-refactor-oci-metrics-config
Draft

Refactor OCI metrics for current builder/config and for extension#11320
tjquinno wants to merge 4 commits intohelidon-io:helidon-4.xfrom
tjquinno:4.x-refactor-oci-metrics-config

Conversation

@tjquinno
Copy link
Member

@tjquinno tjquinno commented Mar 12, 2026

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 OciMetricsConfigBlueprint which constructs the new OciMetricsService (intended to be functionally equivalent to the now-deprecated OciMetricsSupport). 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:

    metrics:
      publishers:
        - type: oci
          compartment-id: my-compartment
          resource-group: my-rg
          initial-delay: PT5S
          delay: PT2.5S

    As before, the OCI metrics settings control the use of the Monitoring instance which actually connects to the backend; these settings do not set up the Monitoring instance itself.

  • The developer can programmatically provide the Monitoring instance to the builder. If not, the code gets the Monitoring instance from the service registry.

  • The pre-existing OciMetricsSupport class now delegates to the new OciMetricsService class so we have the logic in one place, but OciMetricsSupport presents 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.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Mar 12, 2026
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.

1 participant