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

Fix Fault Tolerance metrics via Micrometer #12414

Merged
merged 1 commit into from
Sep 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
<smallrye-common.version>1.4.0</smallrye-common.version>
<smallrye-config.version>1.9.0</smallrye-config.version>
<smallrye-health.version>2.2.3</smallrye-health.version>
<smallrye-metrics.version>2.4.3</smallrye-metrics.version>
<smallrye-metrics.version>2.4.4</smallrye-metrics.version>
<smallrye-open-api.version>2.0.9</smallrye-open-api.version>
<smallrye-graphql.version>1.0.11</smallrye-graphql.version>
<smallrye-opentracing.version>1.3.4</smallrye-opentracing.version>
<smallrye-fault-tolerance.version>4.3.0</smallrye-fault-tolerance.version>
<smallrye-fault-tolerance.version>4.3.1</smallrye-fault-tolerance.version>
<smallrye-jwt.version>2.3.0</smallrye-jwt.version>
<smallrye-context-propagation.version>1.0.13</smallrye-context-propagation.version>
<smallrye-reactive-streams-operators.version>1.0.13</smallrye-reactive-streams-operators.version>
Expand Down Expand Up @@ -2597,6 +2597,11 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-metrics-api</artifactId>
<version>${smallrye-metrics.version}</version>
</dependency>
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-open-api-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@

import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Tags;
import io.smallrye.metrics.api.FunctionGaugeSupport;

class MetricRegistryAdapter extends MetricRegistry {
class MetricRegistryAdapter extends MetricRegistry implements FunctionGaugeSupport {

final Type type;
final MeterRegistry registry;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package io.smallrye.metrics.api;

import java.util.function.Supplier;

import org.eclipse.microprofile.metrics.Gauge;
import org.eclipse.microprofile.metrics.Tag;

import io.smallrye.common.annotation.Experimental;

/**
* Temporary tool to support function gauges in 2.4.x even though they become part of the official API in 3.0.
* This is scheduled to be removed along with the upgrade to SmallRye Metrics 3.0.
*/
@Experimental("Temporarily backported API from Metrics 3.0 to support it in 2.4.x")
@Deprecated
public interface FunctionGaugeSupport {

<T extends Number> Gauge<T> gauge(String name, Supplier<T> supplier, Tag... tags);

}