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

Support for MP Metrics 2.0 #992

Merged
merged 123 commits into from
Sep 10, 2019
Merged

Support for MP Metrics 2.0 #992

merged 123 commits into from
Sep 10, 2019

Conversation

tjquinno
Copy link
Member

@tjquinno tjquinno commented Sep 5, 2019

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: 

metrics2
    metrics2
    prometheus2
microprofile
   metrics2

Their original counterparts support the previous metrics version 1.1, as before:

metrics
   metrics
   prometheus
microprofile
   metrics

This PR updates examples, tests, and TCK drivers to use the newer metrics version with these exceptions:

  • MP static content example
  • MP security example
  • MP IDCS security example
  • zipkin integration test

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 on metrics2/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 be public which is unfortunate. This abstraction layer is not intended for developers using Helidon so its public classes and interfaces have Internal in their names to discourage developers from using them.

spericas and others added 30 commits August 9, 2019 10:08
…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]>
… 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]>
…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]>
@tjquinno tjquinno self-assigned this Sep 5, 2019
@tjquinno
Copy link
Member Author

tjquinno commented Sep 5, 2019

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
@tomas-langer
Copy link
Member

Currently the build error is because of failing TCK tests of metrics 2.0

@tjquinno tjquinno changed the title Support for MP Metrics 2.0 WIP: Support for MP Metrics 2.0 Sep 8, 2019
@tjquinno
Copy link
Member Author

tjquinno commented Sep 8, 2019

The TCK failures are known. I've been working on some things and have changed the title to WIP to reflect that.

…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
@tjquinno tjquinno changed the title WIP: Support for MP Metrics 2.0 Support for MP Metrics 2.0 Sep 9, 2019
@tjquinno
Copy link
Member Author

tjquinno commented Sep 9, 2019

Removed WIP from the title. TCKs passed locally for me so they should in the pipeline now also.

@spericas
Copy link
Member

spericas commented Sep 9, 2019

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.
Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Member Author

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.
Copy link
Member

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.

Copy link
Member Author

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.
Copy link
Member

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.

Copy link
Member Author

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.
Copy link
Member

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.

Copy link
Member Author

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.
Copy link
Member

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.

Copy link
Member Author

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.

if (!Objects.equals(this.delegate, other.delegate)) {
return false;
}
return true;
Copy link
Member

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)

Copy link
Member Author

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.

Copy link
Member Author

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.

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copy link
Member

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.

Copy link
Member Author

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.

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copy link
Member

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]>
Copy link
Member

@tomas-langer tomas-langer left a comment

Choose a reason for hiding this comment

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

LGTM

@tjquinno tjquinno merged commit 7708105 into helidon-io:master Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

MP Metrics 2.0
3 participants