Skip to content

Commit

Permalink
Deprecate Jersey server instrumentation
Browse files Browse the repository at this point in the history
Direct users to the jersey-micrometer module now released from the Jersey project.

Resolves gh-4100
  • Loading branch information
shakuzen committed Feb 6, 2024
1 parent 5c2646e commit 7e0fb8d
Show file tree
Hide file tree
Showing 21 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;

/**
* @deprecated since 1.13.0 use the jersey-micrometer module in the Jersey project instead
*/
@Deprecated
public interface AnnotationFinder {

AnnotationFinder DEFAULT = new AnnotationFinder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
*
* @author Marcin Grzejszczak
* @since 1.10.0
* @deprecated since 1.13.0 use the jersey-micrometer module in the Jersey project instead
*/
@Deprecated
public class DefaultJerseyObservationConvention implements JerseyObservationConvention {

private final String metricsName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
* @author Michael Weirauch
* @author Johnny Lim
* @since 1.8.0
* @deprecated since 1.13.0 use the jersey-micrometer module in the Jersey project instead
*/
@Deprecated
public final class DefaultJerseyTagsProvider implements JerseyTagsProvider {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
*
* @author Marcin Grzejszczak
* @since 1.10.0
* @deprecated since 1.13.0 use the jersey-micrometer module in the Jersey project instead
*/
@Deprecated
public class JerseyContext extends RequestReplyReceiverContext<ContainerRequest, ContainerResponse> {

private RequestEvent requestEvent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* Factory methods for {@link KeyValue KeyValues} associated with a request-response
* exchange that is handled by Jersey server.
*/
@SuppressWarnings("deprecation")
class JerseyKeyValues {

private static final KeyValue URI_NOT_FOUND = JerseyObservationDocumentation.JerseyLegacyLowCardinalityTags.URI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
*
* @author Marcin Grzejszczak
* @since 1.10.0
* @deprecated since 1.13.0 use the jersey-micrometer module in the Jersey project instead
*/
@Deprecated
public interface JerseyObservationConvention extends ObservationConvention<JerseyContext> {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
*
* @author Marcin Grzejszczak
* @since 1.10.0
* @deprecated since 1.13.0 use the jersey-micrometer module in the Jersey project instead
*/
@Deprecated
@NonNullApi
public enum JerseyObservationDocumentation implements ObservationDocumentation {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
* @author Michael Weirauch
* @author Johnny Lim
* @since 1.8.0
* @deprecated since 1.13.0 use the jersey-micrometer module in the Jersey project instead
*/
@Deprecated
public final class JerseyTags {

private static final Tag URI_NOT_FOUND = Tag.of("uri", "NOT_FOUND");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
*
* @author Michael Weirauch
* @since 1.8.0
* @deprecated since 1.13.0 use the jersey-micrometer module in the Jersey project instead
*/
@Deprecated
public interface JerseyTagsProvider {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
*
* @author Michael Weirauch
* @since 1.8.0
* @deprecated since 1.13.0 use the jersey-micrometer module in the Jersey project instead
*/
@Deprecated
public class MetricsApplicationEventListener implements ApplicationEventListener {

private final MeterRegistry meterRegistry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
* @author Michael Weirauch
* @author Jon Schneider
* @since 1.8.0
* @deprecated since 1.13.0 use the jersey-micrometer module in the Jersey project instead
*/
@Deprecated
public class MetricsRequestEventListener implements RequestEventListener {

private final Map<ContainerRequest, Timer.Sample> shortTaskSample = Collections
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
*
* @author Marcin Grzejszczak
* @since 1.10.0
* @deprecated since 1.13.0 use the jersey-micrometer module in the Jersey project instead
*/
@Deprecated
public class ObservationApplicationEventListener implements ApplicationEventListener {

private final ObservationRegistry observationRegistry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
*
* @author Marcin Grzejszczak
* @since 1.10.0
* @deprecated since 1.13.0 use the jersey-micrometer module in the Jersey project instead
*/
@Deprecated
public class ObservationRequestEventListener implements RequestEventListener {

private final Map<ContainerRequest, ObservationScopeAndContext> observations = Collections
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.Set;
import java.util.stream.Collectors;

@SuppressWarnings("deprecation")
class TimedFinder {

private final AnnotationFinder annotationFinder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@

/**
* Meter binders for Jersey.
* @deprecated since 1.13.0 use the jersey-micrometer module in the Jersey project instead
*/
package io.micrometer.core.instrument.binder.jersey.server;
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
* @author Michael Weirauch
* @author Johnny Lim
*/
@SuppressWarnings("deprecation")
class DefaultJerseyTagsProviderTest {

private final DefaultJerseyTagsProvider tagsProvider = new DefaultJerseyTagsProvider();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
* @author Michael Weirauch
* @author Johnny Lim
*/
@SuppressWarnings("deprecation")
class MetricsRequestEventListenerTest extends JerseyTest {

static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
/**
* @author Michael Weirauch
*/
@SuppressWarnings("deprecation")
class MetricsRequestEventListenerTimedTest extends JerseyTest {

static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import javax.ws.rs.core.Response;
import java.net.URI;

@SuppressWarnings("deprecation")
class JerseyServerTimingInstrumentationVerificationTests extends HttpServerTimingInstrumentationVerificationTests {

JerseyTest jerseyTest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.net.InetSocketAddress;
import java.time.Duration;

@SuppressWarnings("deprecation")
public class Jersey3Main {

public static void main(String[] args) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

import static org.assertj.core.api.Assertions.assertThat;

@SuppressWarnings("deprecation")
class Jersey3Test extends JerseyTest {

static final String TIMER_METRIC_NAME = "http.server.requests";
Expand Down

0 comments on commit 7e0fb8d

Please sign in to comment.