-
Notifications
You must be signed in to change notification settings - Fork 565
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
Support for MP Metrics 2.0 #992
Conversation
…roduced here. A lot of TODO's added for now. Signed-off-by: Santiago Pericas-Geertsen <[email protected]>
Signed-off-by: Santiago Pericas-Geertsen <[email protected]>
Signed-off-by: Santiago Pericas-Geertsen <[email protected]>
Signed-off-by: Santiago Pericas-Geertsen <[email protected]>
Signed-off-by: Santiago Pericas-Geertsen <[email protected]>
Signed-off-by: Santiago Pericas-Geertsen <[email protected]>
Signed-off-by: Santiago Pericas-Geertsen <[email protected]>
…try. Signed-off-by: Santiago Pericas-Geertsen <[email protected]>
… copyright issues. Signed-off-by: Santiago Pericas-Geertsen <[email protected]>
Signed-off-by: Santiago Pericas-Geertsen <[email protected]>
Signed-off-by: Santiago Pericas-Geertsen <[email protected]>
Signed-off-by: Santiago Pericas-Geertsen <[email protected]>
…ities in Registry about passing null to varargs argument
…name, not a single metric of that name with no tags
… was not replaced, and tag qualifiers were added to the metric name instead of to each value name within the metric (when the metric had multiple values such as max, min, count)
…mentation of concurrent gauges. Signed-off-by: Santiago Pericas-Geertsen <[email protected]>
BTW, the wercker/build failure is due to wercker timing out, not due to errors in the build. |
…e helidon-microprofile-2.2 bundle to use MP metrics 1.1 (instead of the new, backward-incompatible 2.0) API *without* having to do anything else to use the correct MP metrics API
Currently the build error is because of failing TCK tests of metrics 2.0 |
The TCK failures are known. I've been working on some things and have changed the title to WIP to reflect that. |
…tted the fix for Metered
…etricsCdiExtension
…d metadata more separately; revise metadata consistency checking during re-registration; revise reuse enforcement during metric look-up; suppress CDI-triggered registration of metrics for subclasses due to annotations on superclass methods; implement name-based lookup (rather than complete metadata consistency checking) of registrations due to @Metric annotations
Removed WIP from the title. TCKs passed locally for me so they should in the pipeline now also. |
Just to clarify, the TCKs were passing, then an issue was found and some fixes cause the TCKs to fail temporarily. After Tim's latest commit all TCKs are passing again like at the time the PR was submitted. |
… old 2.2 bundle in Helidon. Signed-off-by: Santiago Pericas-Geertsen <[email protected]>
@@ -1,5 +1,5 @@ | |||
/* | |||
* Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. | |||
* Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that only copyright was changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were intervening changes along the way that turned out to be unnecessary. Leaving the copyright changed was an oversight. We'll revert this and other similar files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working on this. Still haven't found a way to restore a version with the correct copyright that also passes the copyright checker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have heard from others who have wrestled with this same problem in other projects. They have also not found a way to solve this. So it seems we might have to live with copyrights that are later than the actual changes in the 8 (I think) affected files. This is unfortunate but not easily avoided at this point.
@@ -1,5 +1,5 @@ | |||
/* | |||
* Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. | |||
* Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that only copyright was changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems we need to live with this.
@@ -1,5 +1,5 @@ | |||
/* | |||
* Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. | |||
* Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that only copyright was changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems we need to live with this.
@@ -1,5 +1,5 @@ | |||
/* | |||
* Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. | |||
* Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that only copyright was changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems we need to live with this.
@@ -1,5 +1,5 @@ | |||
/* | |||
* Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. | |||
* Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that only copyright was changed.
There are many cases like this, please revert all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems we need to live with this. See the extensive notes on the first comment about copyrights above.
metrics2/metrics2/src/main/java/io/helidon/metrics/ExponentiallyDecayingReservoir.java
Show resolved
Hide resolved
if (!Objects.equals(this.delegate, other.delegate)) { | ||
return false; | ||
} | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last four lines can be replaced with
return Objects.equals(this.delegate, other.delegate)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in a pending commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed. Similar change also in the metrics/metrics
impl class of the same name.
metrics2/prometheus2/pom.xml
Outdated
@@ -0,0 +1,64 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!-- | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is there a Prometheus 2 - this does not depend on MP metrics at all, only on prometheus itself.
This module should not have been duplicated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the earlier comment about ease of removing the older metrics
and microprofile/metrics
modules later.
…-api artifact from example poms
@@ -0,0 +1,36 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!-- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This module should not exist.
Please move metrics2
submodule to $root/metrics
The resulting structure should be:
metrics/metrics
metrics/metrics2
metrics/prometheus
The groupId is already following this, so the directory structure should as well.
Also Prometheus should not be touched by this change at all.
Signed-off-by: Santiago Pericas-Geertsen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Resolves #833 (MP Metrics 2.0) and #939 (verify new metrics with FT).
These changes add support for MP metrics 2.0, including a Helidon bundle for MP 3.0.
The following new modules support the new version of metrics:
Their original counterparts support the previous metrics version 1.1, as before:
This PR updates examples, tests, and TCK drivers to use the newer metrics version with these exceptions:
Because MP Metrics 2.0 is incompatible with 1.1, Helidon allows developers with existing metrics-based apps to use the latest Helidon release with the older MP metrics version by depending on the helidon-microprofile-2.2 bundle.
Helidon SE apps that use metrics can continue to depend on the
metrics/metrics
artifact to use the older metrics implementation. Or, to use the newer SE metrics implementation, they can depend onmetrics2/metrics2
.Helidon contains the following internal metrics clients:
fault tolerance
grpc metrics
These have been changed so they can work with either version of metrics.
To accomplish this a new metrics abstraction layer exists in the new module
common/metrics
, a separate module because the abstraction layer is used by more than one module. Therefore its key contents have to bepublic
which is unfortunate. This abstraction layer is not intended for developers using Helidon so its public classes and interfaces haveInternal
in their names to discourage developers from using them.