Skip to content

Commit

Permalink
Deprecate Micrometer Tracing code in favor of Lettuce's Micrometer su…
Browse files Browse the repository at this point in the history
…pport.

Closes #2561
  • Loading branch information
mp911de committed Sep 4, 2024
1 parent fb0f0bc commit 777f079
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -43,7 +46,7 @@ public KeyValues getLowCardinalityKeyValues(LettuceObservationContext context) {

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()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
*
* @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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
*
* @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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@
* @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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
*
* @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 {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 777f079

Please sign in to comment.