Deprecate Micrometer Tracing code in favor of Lettuce's Micrometer support.

Closes #2561
This commit is contained in:
Mark Paluch
2024-09-04 10:41:40 +02:00
parent fb0f0bc07c
commit 777f079114
6 changed files with 25 additions and 7 deletions

View File

@@ -15,22 +15,25 @@
*/
package org.springframework.data.redis.connection.lettuce.observability;
import io.lettuce.core.protocol.RedisCommand;
import io.lettuce.core.tracing.Tracing.Endpoint;
import io.micrometer.common.KeyValues;
import java.net.InetSocketAddress;
import java.util.Locale;
import org.springframework.data.redis.connection.lettuce.observability.RedisObservation.HighCardinalityCommandKeyNames;
import org.springframework.data.redis.connection.lettuce.observability.RedisObservation.LowCardinalityCommandKeyNames;
import io.lettuce.core.protocol.RedisCommand;
import io.lettuce.core.tracing.Tracing.Endpoint;
import io.micrometer.common.KeyValues;
/**
* Default {@link LettuceObservationConvention} implementation.
*
* @author Mark Paluch
* @since 3.0
* @deprecated since 3.4 for removal with the next major revision. Use Lettuce's Micrometer integration through
* {@link io.lettuce.core.tracing.MicrometerTracing}.
*/
@Deprecated(since = "3.4", forRemoval = true)
record DefaultLettuceObservationConvention(
boolean includeCommandArgsInSpanTags) implements LettuceObservationConvention {
@@ -43,7 +46,7 @@ record DefaultLettuceObservationConvention(
if (ep instanceof SocketAddressEndpoint endpoint) {
if (endpoint.socketAddress()instanceof InetSocketAddress inet) {
if (endpoint.socketAddress() instanceof InetSocketAddress inet) {
keyValues = keyValues
.and(KeyValues.of(LowCardinalityCommandKeyNames.NET_SOCK_PEER_ADDR.withValue(inet.getHostString()),
LowCardinalityCommandKeyNames.NET_SOCK_PEER_PORT.withValue("" + inet.getPort()),

View File

@@ -28,7 +28,10 @@ import org.springframework.lang.Nullable;
*
* @author Mark Paluch
* @since 3.0
* @deprecated since 3.4 for removal with the next major revision. Use Lettuce's Micrometer integration through
* {@link io.lettuce.core.tracing.MicrometerTracing}.
*/
@Deprecated(since = "3.4", forRemoval = true)
public class LettuceObservationContext extends SenderContext<Object> {
private volatile @Nullable RedisCommand<?, ?, ?> command;

View File

@@ -23,7 +23,10 @@ import io.micrometer.observation.ObservationConvention;
*
* @author Mark Paluch
* @since 3.0
* @deprecated since 3.4 for removal with the next major revision. Use Lettuce's Micrometer integration through
* {@link io.lettuce.core.tracing.MicrometerTracing}.
*/
@Deprecated(since = "3.4", forRemoval = true)
interface LettuceObservationConvention extends ObservationConvention<LettuceObservationContext> {
@Override

View File

@@ -46,7 +46,10 @@ import org.springframework.lang.Nullable;
* @author Mark Paluch
* @author Yanming Zhou
* @since 3.0
* @deprecated since 3.4 for removal with the next major revision. Use Lettuce's Micrometer integration through
* {@link io.lettuce.core.tracing.MicrometerTracing}.
*/
@Deprecated(since = "3.4", forRemoval = true)
public class MicrometerTracingAdapter implements Tracing {
private static final Log log = LogFactory.getLog(MicrometerTracingAdapter.class);

View File

@@ -23,7 +23,10 @@ import io.micrometer.observation.docs.ObservationDocumentation;
*
* @author Mark Paluch
* @since 3.0
* @deprecated since 3.4 for removal with the next major revision. Use Lettuce's Micrometer integration through
* {@link io.lettuce.core.tracing.MicrometerTracing}.
*/
@Deprecated(since = "3.4", forRemoval = true)
public enum RedisObservation implements ObservationDocumentation {
/**

View File

@@ -15,14 +15,17 @@
*/
package org.springframework.data.redis.connection.lettuce.observability;
import io.lettuce.core.tracing.Tracing.Endpoint;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import io.lettuce.core.tracing.Tracing.Endpoint;
/**
* @author Mark Paluch
* @deprecated since 3.4 for removal with the next major revision. Use Lettuce's Micrometer integration through
* {@link io.lettuce.core.tracing.MicrometerTracing}.
*/
@Deprecated(since = "3.4", forRemoval = true)
record SocketAddressEndpoint(SocketAddress socketAddress) implements Endpoint {
@Override