Skip to content

Commit

Permalink
Update Micrometer dependencies to 1.10.0-SNAPSHOT before RC1 (#2526)
Browse files Browse the repository at this point in the history
Update Micrometer Tracing dependency to version 1.0.0-SNAPSHOT
Update Micrometer Docs Generator dependency to version 1.0.0-SNAPSHOT
Update Context Propagation dependency to version 1.0.0-SNAPSHOT
  • Loading branch information
violetagg committed Oct 6, 2022
1 parent 9c90ff1 commit b43871b
Show file tree
Hide file tree
Showing 22 changed files with 74 additions and 43 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Expand Up @@ -84,11 +84,11 @@ ext {
}

//Metrics
micrometerVersion = '1.10.0-M6' //optional baseline
micrometerTracingVersion = '1.0.0-M8' //optional baseline
micrometerDocsVersion = '1.0.0-M7' //optional baseline
micrometerVersion = '1.10.0-SNAPSHOT' // was M6 //optional baseline
micrometerTracingVersion = '1.0.0-SNAPSHOT' // was M8 //optional baseline
micrometerDocsVersion = '1.0.0-SNAPSHOT' // was M7 //optional baseline

contextPropagationVersion = '1.0.0-M5'
contextPropagationVersion = '1.0.0-SNAPSHOT' // was M5 //optional baseline

braveVersion = '5.14.1'

Expand Down
Expand Up @@ -17,7 +17,7 @@

import io.micrometer.common.docs.KeyName;
import io.micrometer.core.instrument.Meter;
import io.micrometer.core.instrument.docs.DocumentedMeter;
import io.micrometer.core.instrument.docs.MeterDocumentation;

/**
* Channel meters.
Expand All @@ -26,7 +26,7 @@
* @author Violeta Georgieva
* @since 1.1.0
*/
public enum ChannelMeters implements DocumentedMeter {
public enum ChannelMeters implements MeterDocumentation {

/**
* The number of all opened connections on the server.
Expand Down
Expand Up @@ -16,7 +16,7 @@
package reactor.netty.channel;

import io.micrometer.common.docs.KeyName;
import io.micrometer.observation.docs.DocumentedObservation;
import io.micrometer.observation.docs.ObservationDocumentation;

/**
* Connect observations.
Expand All @@ -25,7 +25,7 @@
* @author Violeta Georgieva
* @since 1.1.0
*/
enum ConnectObservations implements DocumentedObservation {
enum ConnectObservations implements ObservationDocumentation {

/**
* Connect metric.
Expand Down
Expand Up @@ -16,7 +16,7 @@
package reactor.netty.channel;

import io.micrometer.common.docs.KeyName;
import io.micrometer.tracing.docs.DocumentedSpan;
import io.micrometer.tracing.docs.SpanDocumentation;

/**
* Connect spans.
Expand All @@ -25,7 +25,7 @@
* @author Violeta Georgieva
* @since 1.1.0
*/
enum ConnectSpans implements DocumentedSpan {
enum ConnectSpans implements SpanDocumentation {

/**
* Connect Span.
Expand Down
Expand Up @@ -30,6 +30,7 @@
import reactor.util.context.ContextView;

import java.net.SocketAddress;
import java.util.function.Supplier;

import static reactor.netty.Metrics.CONNECT_TIME;
import static reactor.netty.Metrics.ERROR;
Expand Down Expand Up @@ -79,7 +80,8 @@ public MicrometerChannelMetricsRecorder recorder() {
// ConnectMetricsHandler is Observation.Context and ChannelOutboundHandler in order to reduce allocations,
// this is invoked on every connection establishment
// This handler is not shared and as such it is different object per connection.
static final class ConnectMetricsHandler extends Observation.Context implements ReactorNettyHandlerContext, ChannelOutboundHandler {
static final class ConnectMetricsHandler extends Observation.Context
implements ReactorNettyHandlerContext, ChannelOutboundHandler, Supplier<Observation.Context> {
static final String CONTEXTUAL_NAME = "connect";
static final String TYPE = "client";

Expand All @@ -93,6 +95,11 @@ static final class ConnectMetricsHandler extends Observation.Context implements
this.recorder = recorder;
}

@Override
public Observation.Context get() {
return this;
}

@Override
public Timer getTimer() {
return recorder.getConnectTimer(getName(), remoteAddress, status);
Expand Down Expand Up @@ -204,7 +211,8 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)
}
}

static final class TlsMetricsHandler extends Observation.Context implements ReactorNettyHandlerContext, ChannelInboundHandler {
static final class TlsMetricsHandler extends Observation.Context
implements ReactorNettyHandlerContext, ChannelInboundHandler, Supplier<Observation.Context> {
static final String CONTEXTUAL_NAME = "tls handshake";
static final String TYPE_CLIENT = "client";
static final String TYPE_SERVER = "server";
Expand Down Expand Up @@ -281,6 +289,11 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
ctx.fireExceptionCaught(cause);
}

@Override
public Observation.Context get() {
return this;
}

@Override
public String getContextualName() {
return CONTEXTUAL_NAME;
Expand Down
Expand Up @@ -17,15 +17,15 @@

import io.micrometer.common.docs.KeyName;
import io.micrometer.core.instrument.Meter;
import io.micrometer.core.instrument.docs.DocumentedMeter;
import io.micrometer.core.instrument.docs.MeterDocumentation;

/**
* {@link ConnectionProvider} meters.
*
* @author Violeta Georgieva
* @since 1.1.0
*/
enum ConnectionProviderMeters implements DocumentedMeter {
enum ConnectionProviderMeters implements MeterDocumentation {

/**
* The number of the connections in the connection pool that have been successfully acquired and are in active use.
Expand Down
Expand Up @@ -16,15 +16,15 @@
package reactor.netty.tcp;

import io.micrometer.common.docs.KeyName;
import io.micrometer.observation.docs.DocumentedObservation;
import io.micrometer.observation.docs.ObservationDocumentation;

/**
* TLS handshake observations.
*
* @author Violeta Georgieva
* @since 1.1.0
*/
enum TlsHandshakeObservations implements DocumentedObservation {
enum TlsHandshakeObservations implements ObservationDocumentation {

/**
* TLS handshake metric.
Expand Down
Expand Up @@ -16,15 +16,15 @@
package reactor.netty.tcp;

import io.micrometer.common.docs.KeyName;
import io.micrometer.tracing.docs.DocumentedSpan;
import io.micrometer.tracing.docs.SpanDocumentation;

/**
* TLS handshake spans.
*
* @author Violeta Georgieva
* @since 1.1.0
*/
enum TlsHandshakeSpans implements DocumentedSpan {
enum TlsHandshakeSpans implements SpanDocumentation {

/**
* TLS Handshake Span.
Expand Down
Expand Up @@ -17,15 +17,15 @@

import io.micrometer.common.docs.KeyName;
import io.micrometer.core.instrument.Meter;
import io.micrometer.core.instrument.docs.DocumentedMeter;
import io.micrometer.core.instrument.docs.MeterDocumentation;

/**
* {@link io.netty.buffer.ByteBufAllocator} meters.
*
* @author Violeta Georgieva
* @since 1.1.0
*/
enum ByteBufAllocatorMeters implements DocumentedMeter {
enum ByteBufAllocatorMeters implements MeterDocumentation {

/**
* The actual bytes consumed by in-use buffers allocated from direct buffer pools.
Expand Down
Expand Up @@ -17,15 +17,15 @@

import io.micrometer.common.docs.KeyName;
import io.micrometer.core.instrument.Meter;
import io.micrometer.core.instrument.docs.DocumentedMeter;
import io.micrometer.core.instrument.docs.MeterDocumentation;

/**
* {@link io.netty.channel.EventLoop} meters.
*
* @author Violeta Georgieva
* @since 1.1.0
*/
enum EventLoopMeters implements DocumentedMeter {
enum EventLoopMeters implements MeterDocumentation {

/**
* Event loop pending scheduled tasks.
Expand Down
Expand Up @@ -16,15 +16,15 @@
package reactor.netty.transport;

import io.micrometer.common.docs.KeyName;
import io.micrometer.observation.docs.DocumentedObservation;
import io.micrometer.observation.docs.ObservationDocumentation;

/**
* Hostname resolution observations.
*
* @author Violeta Georgieva
* @since 1.1.0
*/
enum HostnameResolutionObservations implements DocumentedObservation {
enum HostnameResolutionObservations implements ObservationDocumentation {

/**
* Hostname resolution metric.
Expand Down
Expand Up @@ -16,15 +16,15 @@
package reactor.netty.transport;

import io.micrometer.common.docs.KeyName;
import io.micrometer.tracing.docs.DocumentedSpan;
import io.micrometer.tracing.docs.SpanDocumentation;

/**
* Hostname resolution spans.
*
* @author Violeta Georgieva
* @since 1.1.0
*/
enum HostnameResolutionSpans implements DocumentedSpan {
enum HostnameResolutionSpans implements SpanDocumentation {

/**
* Hostname Resolution Span.
Expand Down
Expand Up @@ -70,7 +70,8 @@ protected AddressResolver<T> newResolver(EventExecutor executor) {
return new MicrometerDelegatingAddressResolver<>((MicrometerChannelMetricsRecorder) recorder, resolverGroup.getResolver(executor));
}

static final class FutureHandlerContext extends Observation.Context implements ReactorNettyHandlerContext {
static final class FutureHandlerContext extends Observation.Context
implements ReactorNettyHandlerContext, Supplier<Observation.Context> {
static final String CONTEXTUAL_NAME = "hostname resolution";
static final String TYPE = "client";

Expand All @@ -85,6 +86,11 @@ static final class FutureHandlerContext extends Observation.Context implements R
this.remoteAddress = remoteAddress;
}

@Override
public Observation.Context get() {
return this;
}

@Override
public Timer getTimer() {
return recorder.getResolveAddressTimer(getName(), remoteAddress, status);
Expand Down
Expand Up @@ -17,15 +17,15 @@

import io.micrometer.common.docs.KeyName;
import io.micrometer.core.instrument.Meter;
import io.micrometer.core.instrument.docs.DocumentedMeter;
import io.micrometer.core.instrument.docs.MeterDocumentation;

/**
* HTTP/2 {@link reactor.netty.resources.ConnectionProvider} meters.
*
* @author Violeta Georgieva
* @since 1.1.0
*/
enum Http2ConnectionProviderMeters implements DocumentedMeter {
enum Http2ConnectionProviderMeters implements MeterDocumentation {

/**
* The number of the connections in the connection pool that have been successfully acquired and are in active use.
Expand Down
Expand Up @@ -17,15 +17,15 @@

import io.micrometer.common.docs.KeyName;
import io.micrometer.core.instrument.Meter;
import io.micrometer.core.instrument.docs.DocumentedMeter;
import io.micrometer.core.instrument.docs.MeterDocumentation;

/**
* {@link HttpClient} meters.
*
* @author Violeta Georgieva
* @since 1.1.0
*/
enum HttpClientMeters implements DocumentedMeter {
enum HttpClientMeters implements MeterDocumentation {

/**
* Time spent in consuming incoming data on the client.
Expand Down
Expand Up @@ -16,15 +16,15 @@
package reactor.netty.http.client;

import io.micrometer.common.docs.KeyName;
import io.micrometer.observation.docs.DocumentedObservation;
import io.micrometer.observation.docs.ObservationDocumentation;

/**
* {@link HttpClient} observations.
*
* @author Violeta Georgieva
* @since 1.1.0
*/
enum HttpClientObservations implements DocumentedObservation {
enum HttpClientObservations implements ObservationDocumentation {

/**
* Response metric.
Expand Down
Expand Up @@ -16,15 +16,15 @@
package reactor.netty.http.client;

import io.micrometer.common.docs.KeyName;
import io.micrometer.tracing.docs.DocumentedSpan;
import io.micrometer.tracing.docs.SpanDocumentation;

/**
* {@link HttpClient} spans.
*
* @author Violeta Georgieva
* @since 1.1.0
*/
enum HttpClientSpans implements DocumentedSpan {
enum HttpClientSpans implements SpanDocumentation {

/**
* Response Span.
Expand Down
Expand Up @@ -30,6 +30,7 @@
import java.time.Duration;
import java.util.Objects;
import java.util.function.Function;
import java.util.function.Supplier;

import static reactor.netty.Metrics.OBSERVATION_KEY;
import static reactor.netty.Metrics.OBSERVATION_REGISTRY;
Expand Down Expand Up @@ -120,7 +121,7 @@ protected void startWrite(HttpRequest msg, Channel channel, @Nullable ContextVie
}

static final class ResponseTimeHandlerContext extends RequestReplySenderContext<HttpRequest, HttpResponse>
implements ReactorNettyHandlerContext {
implements ReactorNettyHandlerContext, Supplier<Observation.Context> {
static final String TYPE = "client";

final String method;
Expand All @@ -142,6 +143,11 @@ static final class ResponseTimeHandlerContext extends RequestReplySenderContext<
setContextualName(this.method);
}

@Override
public Observation.Context get() {
return this;
}

@Override
public Timer getTimer() {
return recorder.getResponseTimeTimer(getName(), remoteAddress, path, method, status);
Expand Down
Expand Up @@ -17,15 +17,15 @@

import io.micrometer.common.docs.KeyName;
import io.micrometer.core.instrument.Meter;
import io.micrometer.core.instrument.docs.DocumentedMeter;
import io.micrometer.core.instrument.docs.MeterDocumentation;

/**
* {@link HttpServer} meters.
*
* @author Violeta Georgieva
* @since 1.1.0
*/
enum HttpServerMeters implements DocumentedMeter {
enum HttpServerMeters implements MeterDocumentation {

/**
* The number of http connections, on the server, currently processing requests.
Expand Down

0 comments on commit b43871b

Please sign in to comment.