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

Switch to dw-metrics stable 4.x #118

Merged
merged 5 commits into from
Dec 13, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,17 @@ subprojects {
guice : "com.google.inject:guice:${guiceVersion}",
guava : 'com.google.guava:guava:30.1-jre',
jaxb_api : 'javax.xml.bind:jaxb-api:2.3.1',
dw_metrics : "com.palominolabs.metrics:metrics-guice:5.0.1",
dw_metrics_healthchecks : "io.dropwizard.metrics5:metrics-healthchecks:5.0.0",
dw_metrics_annotation : "io.dropwizard.metrics5:metrics-annotation:5.0.0",
dw_metrics : "com.palominolabs.metrics:metrics-guice:3.2.2",
dw_metrics_healthchecks : "io.dropwizard.metrics:metrics-healthchecks:4.2.0",
dw_metrics_annotation : "io.dropwizard.metrics:metrics-annotation:4.2.0",
grpc_netty : "io.grpc:grpc-netty:${grpcVersion}",
grpc_protobuf : "io.grpc:grpc-protobuf:${grpcVersion}",
grpc_services : "io.grpc:grpc-services:${grpcVersion}",
jersey : 'org.glassfish.jersey.containers:jersey-container-servlet:2.6',
jersey_freemarker : 'org.glassfish.jersey.ext:jersey-mvc-freemarker:2.6',
servlet : 'javax.servlet:javax.servlet-api:3.1.0',
jackson : "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:${jacksonVersion}",
jetty_metrics : 'io.dropwizard.metrics5:metrics-jetty9:5.0.0',
jetty_metrics : 'io.dropwizard.metrics:metrics-jetty9:4.2.29',
guice_validator : 'ru.vyarus:guice-validator:1.2.0',
hibernate_validator : 'org.hibernate:hibernate-validator:5.4.1.Final',
javax_el : 'org.glassfish:javax.el:3.0.1-b08',
Expand Down
10 changes: 5 additions & 5 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ dependencies {
implementation libraries.jackson_data_format
implementation 'net.sourceforge.argparse4j:argparse4j:0.8.1'
implementation 'com.github.wnameless:json-flattener:0.6.0'
implementation 'io.dropwizard.metrics5:metrics-jvm:5.0.0'
implementation 'io.dropwizard.metrics5:metrics-jmx:5.0.0'
implementation 'io.prometheus:prometheus-metrics-core:1.2.0'
implementation 'io.prometheus:prometheus-metrics-instrumentation-dropwizard5:1.2.0'
implementation 'io.prometheus:prometheus-metrics-exporter-common:1.2.0'
implementation 'io.dropwizard.metrics:metrics-jvm:4.2.0'
implementation 'io.dropwizard.metrics:metrics-jmx:4.2.0'
implementation 'io.prometheus:prometheus-metrics-core:1.3.5'
implementation 'io.prometheus:prometheus-metrics-instrumentation-dropwizard:1.3.5'
implementation 'io.prometheus:prometheus-metrics-exporter-common:1.3.5'
implementation libraries.grpc_stub
implementation libraries.grpc_services
implementation libraries.lombok
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/com/flipkart/gjex/core/Bundle.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import com.flipkart.gjex.core.job.ScheduledJob;
import org.glassfish.jersey.server.ResourceConfig;

import io.dropwizard.metrics5.health.HealthCheck;
import com.codahale.metrics.health.HealthCheck;
import com.flipkart.gjex.core.service.Service;
import com.flipkart.gjex.core.setup.Bootstrap;
import com.flipkart.gjex.core.setup.Environment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
import java.util.SortedMap;
import java.util.concurrent.ExecutorService;

import io.dropwizard.metrics5.health.HealthCheck;
import com.codahale.metrics.health.HealthCheck;

/**
* A sub-type of the io.dropwizard.metrics5.health.HealthCheckRegistry that runs health checks concurrently
* A sub-type of the com.codahale.metrics.health.HealthCheckRegistry that runs health checks concurrently
* @author regu.b
*
*/
public class HealthCheckRegistry extends io.dropwizard.metrics5.health.HealthCheckRegistry {
public class HealthCheckRegistry extends com.codahale.metrics.health.HealthCheckRegistry {

/** Name for this HealthCheckRegistry*/
public static final String HEALTHCHECK_REGISTRY_NAME = "GJEX_HealthCheckRegistry";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.flipkart.gjex.core.healthcheck;

import com.flipkart.gjex.core.logging.Logging;
import io.dropwizard.metrics5.health.HealthCheck;
import com.codahale.metrics.health.HealthCheck;

import javax.inject.Singleton;
import java.util.concurrent.atomic.AtomicBoolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.flipkart.gjex.core.setup;

import io.dropwizard.metrics5.MetricFilter;
import io.dropwizard.metrics5.MetricRegistry;
import io.dropwizard.metrics5.jmx.JmxReporter;
import io.dropwizard.metrics5.jvm.BufferPoolMetricSet;
import io.dropwizard.metrics5.jvm.GarbageCollectorMetricSet;
import io.dropwizard.metrics5.jvm.MemoryUsageGaugeSet;
import io.dropwizard.metrics5.jvm.ThreadStatesGaugeSet;
import io.prometheus.metrics.instrumentation.dropwizard5.DropwizardExports;
import com.codahale.metrics.MetricFilter;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.jmx.JmxReporter;
import com.codahale.metrics.jvm.BufferPoolMetricSet;
import com.codahale.metrics.jvm.GarbageCollectorMetricSet;
import com.codahale.metrics.jvm.MemoryUsageGaugeSet;
import com.codahale.metrics.jvm.ThreadStatesGaugeSet;
import io.prometheus.metrics.instrumentation.dropwizard.DropwizardExports;
import io.prometheus.metrics.model.registry.PrometheusRegistry;

import java.lang.management.ManagementFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import com.flipkart.gjex.core.util.Pair;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import io.dropwizard.metrics5.MetricRegistry;
import com.codahale.metrics.MetricRegistry;
import io.prometheus.metrics.model.registry.PrometheusRegistry;

import javax.validation.Validation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package com.flipkart.gjex.core.setup;

import com.flipkart.gjex.core.healthcheck.HealthCheckRegistry;
import io.dropwizard.metrics5.MetricRegistry;
import com.codahale.metrics.MetricRegistry;

import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package com.flipkart.gjex.core.web;

import com.flipkart.gjex.core.healthcheck.HealthCheckRegistry;
import io.dropwizard.metrics5.health.HealthCheck;
import com.codahale.metrics.health.HealthCheck;

import javax.inject.Named;
import javax.inject.Singleton;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package com.flipkart.gjex.core.web;

import com.flipkart.gjex.core.healthcheck.HealthCheckRegistry;
import io.dropwizard.metrics5.health.HealthCheck;
import com.codahale.metrics.health.HealthCheck;

import javax.inject.Named;
import javax.inject.Singleton;
Expand Down
6 changes: 3 additions & 3 deletions examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ dependencies {
implementation "io.grpc:grpc-netty-shaded:${grpcVersion}"
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
implementation "io.dropwizard.metrics5:metrics-healthchecks:5.0.0"
implementation "io.dropwizard.metrics5:metrics-annotation:5.0.0"
implementation "com.palominolabs.metrics:metrics-guice:5.0.1"
implementation "io.dropwizard.metrics:metrics-healthchecks:4.2.0"
implementation "io.dropwizard.metrics:metrics-annotation:4.2.0"
implementation "com.palominolabs.metrics:metrics-guice:3.2.2"
implementation ('ru.vyarus:guice-validator:1.2.0') {
exclude group: 'com.google.inject', module: 'guice'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import com.flipkart.gjex.core.context.GJEXContext;
import com.flipkart.gjex.examples.helloworld.filter.AuthFilter;
import io.dropwizard.metrics5.annotation.Timed;
import com.codahale.metrics.annotation.Timed;
import com.flipkart.gjex.core.filter.grpc.ApplicationHeaders;
import com.flipkart.gjex.core.filter.grpc.MethodFilters;
import com.flipkart.gjex.core.logging.Logging;
Expand Down
4 changes: 2 additions & 2 deletions grpc-jexpress-template/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<protoc.version>3.25.5</protoc.version>
<metrics-guice.version>5.0.1</metrics-guice.version>
<javax.servlet.version>3.1.0</javax.servlet.version>
<metrics-healthchecks.version>5.0.0</metrics-healthchecks.version>
<metrics-healthchecks.version>4.2.0</metrics-healthchecks.version>
<jexpress.version>1.41-SNAPSHOT</jexpress.version>
<proto-google-common-protos.version>1.12.0</proto-google-common-protos.version>
<guice.version>5.1.0</guice.version>
Expand Down Expand Up @@ -145,7 +145,7 @@
<version>${javax.servlet.version}</version>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics5</groupId>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-healthchecks</artifactId>
<version>${metrics-healthchecks.version}</version>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.flipkart.grpc.jexpress.module;

import io.dropwizard.metrics5.health.HealthCheck;
import com.codahale.metrics.health.HealthCheck;
import com.flipkart.gjex.core.filter.Filter;
import com.flipkart.gjex.core.tracing.TracingSampler;
import com.flipkart.grpc.jexpress.filter.CreateLoggingFilter;
Expand Down
2 changes: 1 addition & 1 deletion guice/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ dependencies {
implementation 'io.opentracing.brave:brave-opentracing:0.31.3'
implementation 'io.zipkin.reporter2:zipkin-sender-okhttp3:2.7.7'

implementation 'io.prometheus:prometheus-metrics-exporter-servlet-javax:1.2.0'
implementation 'io.prometheus:prometheus-metrics-exporter-servlet-javax:1.3.4'

testImplementation libraries.junit4
testImplementation libraries.assertj
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

import javax.inject.Inject;

import io.dropwizard.metrics5.MetricRegistry;
import io.dropwizard.metrics5.Timer;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.Timer;

import io.grpc.CallOptions;
import io.grpc.Channel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.flipkart.gjex.grpc.interceptor;

import io.dropwizard.metrics5.MetricRegistry;
import io.dropwizard.metrics5.annotation.ResponseMetered;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.annotation.ResponseMetered;
import com.flipkart.gjex.core.util.Pair;
import com.flipkart.gjex.grpc.utils.AnnotationUtils;
import com.google.inject.Inject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import com.google.inject.Module;
import com.google.inject.TypeLiteral;
import com.palominolabs.metrics.guice.MetricsInstrumentationModule;
import io.dropwizard.metrics5.health.HealthCheck;
import com.codahale.metrics.health.HealthCheck;
import io.grpc.BindableService;
import io.grpc.health.v1.HealthGrpc;
import org.glassfish.jersey.server.ResourceConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import com.google.inject.Provides;
import com.google.inject.matcher.AbstractMatcher;
import com.google.inject.matcher.Matchers;
import io.dropwizard.metrics5.health.HealthCheck;
import com.codahale.metrics.health.HealthCheck;
import io.grpc.BindableService;
import io.grpc.Context;
import org.aopalliance.intercept.MethodInterceptor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import com.google.inject.AbstractModule;
import com.google.inject.Provides;
import com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsStreamServlet;
import io.dropwizard.metrics5.jetty9.InstrumentedHandler;
import com.codahale.metrics.jetty9.InstrumentedHandler;
import io.prometheus.metrics.exporter.servlet.javax.PrometheusMetricsServlet;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
Expand Down
Loading