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

Add Helidon Metrics integration with OCI #5829

Conversation

klustria
Copy link
Member

The change includes the following:

  1. Port of PR Add Helidon Metrics integration with OCI #4003 that adds the Helidon Metrics to OCI integration
  2. Port of PR Fixed race condition in the OCI Metrics integration test between retrieval of metrics from registry and asserting that from expected results #4897 that fixes race condition in the unit test
  3. Adjust code to deal with MP metrics API changes
  4. Change endpoint to the ingestion endpoint when posting the metrics as this is not handled anymore by the OCI SDK integration due to changes in the OCI Java SDK v3.
  5. Change MonitoringClient.class to Monitoring.class for mocking using Mockito in the unit test as the OCI Java SDK v3 converted some of the methods in MonitoringClient as Final making them difficult to mock.
  6. Trim the OCI Metadata value which contains the metric description if the value exceeds 256 characters, otherwise it will fail.
  7. OCI Monitoring service only allows a maximum of 50 metrics per posting, hence additional configuration parameters were added to control sending metrics in batches. The configuration parameters are: a. batchSize - Maximum no. of metrics to send in a batch. Defaults to 50 which is what OCI allows b. batchDelay - Interval between batch posting For example if there are 51 metrics and batchSize is set to 25 and batchDelay to 5 seconds, the Helidon metric integration module will divide the posting to 3 batches sending 25 metrics on the 1st and 2nd batches and 1 metric on the 3rd batch with 5 seconds interval between batch posting.
  8. Refactor OciMetricsCdiExtension to add a new bean (OciMetricsBean) to handle the Observer method which will inject Monitoring. Previous code of OciMetricsCdiExtension cannot independently handle instantiation of Monitoring client via CDI.
  9. Add unit tests to verify batch posting feature and the use of ingestion endpoint.

The change includes the following:
1. Port of PR helidon-io#4003 that adds the Helidon Metrics to OCI integration
2. Port of PR helidon-io#4897 that fixes race condition in the unit test
3. Adjust code to deal with MP metrics API changes
4. Change endpoint to the ingestion endpoint when posting the metrics as this is not handled anymore by the OCI SDK integration due to changes in the OCI Java SDK v3.
5. Change MonitoringClient.class to Monitoring.class for mocking using Mockito in the unit test as the OCI Java SDK v3 converted some of the methods in MonitoringClient as Final making them difficult to mock.
6. Trim the OCI Metadata value which contains the metric description if the value exceeds 256 characters, otherwise it will fail.
7. OCI Monitoring service only allows a maximum of 50 metrics per posting, hence additional configuration parameters were added to control sending metrics in batches. The configuration parameters are:
   a. batchSize - Maximum no. of metrics to send in a batch. Defaults to 50 which is what OCI allows
   b. batchDelay - Interval between batch posting
   For example if there are 51 metrics and batchSize is set to 25 and batchDelay to 5 seconds, the Helidon metric integration module will divide the posting to 3 batches sending 25 metrics on the 1st and 2nd batches and 1 metric on the 3rd batch with 5 seconds interval between batch posting.
8. Refactor OciMetricsCdiExtension to add a new bean (OciMetricsBean) to handle the Observer method which will inject Monitoring. Previous code of OciMetricsCdiExtension cannot independently handle instantiation of Monitoring client via CDI.
9. Add unit tests to verify batch posting feature and the use of ingestion endpoint.
@klustria klustria self-assigned this Jan 11, 2023
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jan 11, 2023
Copy link
Member

@tjquinno tjquinno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few notes.

…use of stream in list, execute rule.onNewWebserver only if enabled, add default value on @ConfigProperty and validate builder methods' parameters are not null
@klustria klustria merged commit 34842fa into helidon-io:helidon-3.x Jan 13, 2023
@klustria klustria added the 3.x Issues for 3.x version branch label Jan 13, 2023
klustria added a commit to klustria/helidon that referenced this pull request Jan 23, 2023
The change includes the following:
1. Port of v3 PR helidon-io#5829 that includes additional changes and fixes.
2. Changes related to OciMetricsSupport use of Nima instead of SE Webserver dependency.
klustria added a commit that referenced this pull request Jan 24, 2023
* Add Helidon Metrics integration with OCI

The change includes the following:
1. Port of v3 PR #5829 that includes additional changes and fixes.
2. Changes related to OciMetricsSupport use of Nima instead of SE Webserver dependency.
3. Fix pipeline error due to javadoc link that cannot be referenced
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Issues for 3.x version branch OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants