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

4.x Metrics followup #7547

Merged
merged 44 commits into from
Sep 13, 2023
Merged

4.x Metrics followup #7547

merged 44 commits into from
Sep 13, 2023

Conversation

tjquinno
Copy link
Member

@tjquinno tjquinno commented Sep 7, 2023

Description

Resolves #7506 (epic of TODO tasks from the M1 metrics work) and #7566 (issue for addressing all the epic task items).

This PR addresses the list of TODO items created as part of merging the neutral metrics API work into M2.

There are quite a few separate commits in this PR; I tried to separate the commits into related changes.

NOTE

In this PR components that depend on metrics, in many cases, now have these dependencies:

  • helidon-webserver-observe-metrics (which supports the /metrics endpoint and brings along the helidon-metrics-api andhelidon-metrics-providers-micrometer artifacts as transitive dependencies)
  • helidon-metrics-system-meters (the base meters that expose JVM and OS measurements) for those components that want them.

I made this adjustment after a discussion with several of the US folks but mostly Joe and Romain. This is consistent with the way components have dependencies on health in 4.x:

  • helidon-webserver-observe-health supports /health and brings along helidon-health (the API and the implementation)
  • helidon-health-checks separately provides the Helidon-provided built-in health checks for those components that want them.

As a separate, broader topic we should think about whether there are useful bundles for health and metrics that would make sense, esp. for developers who are new to Helidon.

General categories of changes

  1. Re-enabling disabled tests, including the MP metrics TCK.
  2. Make sure other components (esp. integrations, dbclient, etc.) with dep. on metrics have the correct dependencies: helidon-metrics-providers-micrometer and helidon-metrics-system-meters in many cases.
  3. Reinstate the ability to disable metrics by scope and name:
    1. Config changes (regex expressions to include and exclude used to be String; now are Pattern)
    2. Logic changes (in a few places) to check whether a meter is enabled or not.
    3. Update the way config is used to disable metrics to the new config syntax.
  4. Add support to the NoOpMeterRegistry to notify listeners when meters are added (or removed), primarily so the MP Registry can update the map between MP metrics and delegates. That's needed so we can return the same MP metric (rather than creating new no-op meters all the time) if the client retrieves by metric ID, for example.
  5. Slight correction in the Prometheus output formatter to properly apply the scope selection when it is present.
  6. Several of the system meters were declared as a functional counter when they should be gauges (or vice versa). The metrics TCK tells the difference.
  7. Add in MP validate of tags to catch illegal use of reserved tag names (mp_scope and mp_app).
  8. Some fixes in the JSON output formatter. Among other things, the JSON output no longer includes the scope tag and value; where suitable, meters of the same scope are grouped in the JSON object as before so the scope tag is superfluous and interfered with some tests.
  9. Support for clean-up between tests in the same JVM.

Documentation

No doc impact from this PR alone. Separate issue for metrics doc update.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Sep 7, 2023
@tjquinno tjquinno changed the title Metrics followup 4.x Metrics followup Sep 7, 2023
@tjquinno tjquinno marked this pull request as draft September 7, 2023 22:54
@tjquinno tjquinno self-assigned this Sep 7, 2023
This was linked to issues Sep 12, 2023
@tjquinno tjquinno marked this pull request as ready for review September 12, 2023 16:06
@tjquinno tjquinno added this to the 4.0.0-RC1 milestone Sep 12, 2023
@tjquinno tjquinno merged commit cb3e8bd into helidon-io:main Sep 13, 2023
12 checks passed
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.

4.x Complete metrics follow-up tasks Metrics follow-up items
2 participants