Update lettuce-4.0 to Instrumenter API
MODIFY
instrumentation/lettuce/lettuce-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v4_0/InstrumentationPoints.java
instrumentation/lettuce/lettuce-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v4_0/InstrumentationPoints.java
@@ -8,7 +8,7 @@ package io.opentelemetry.javaagent.instrumentation.lettuce.v4_0;
import static com.lambdaworks.redis.protocol.CommandKeyword.SEGFAULT;
import static com.lambdaworks.redis.protocol.CommandType.DEBUG;
import static com.lambdaworks.redis.protocol.CommandType.SHUTDOWN;
-import static io.opentelemetry.javaagent.instrumentation.lettuce.v4_0.LettuceDatabaseClientTracer.tracer;
+import static io.opentelemetry.javaagent.instrumentation.lettuce.v4_0.LettuceInstrumenters.instrumenter;
import com.lambdaworks.redis.protocol.AsyncCommand;
import com.lambdaworks.redis.protocol.CommandType;
@@ -35,26 +35,24 @@ public final class InstrumentationPoints {
Throwable throwable,
AsyncCommand<?, ?, ?> asyncCommand) {
if (throwable != null) {
- tracer().endExceptionally(context, throwable);
+ instrumenter().end(context, command, null, throwable);
} else if (expectsResponse(command)) {
asyncCommand.handleAsync(
(value, ex) -> {
- if (ex == null) {
- tracer().end(context);
- } else if (ex instanceof CancellationException) {
+ if (ex instanceof CancellationException) {
if (CAPTURE_EXPERIMENTAL_SPAN_ATTRIBUTES) {
Span span = Span.fromContext(context);
span.setAttribute("lettuce.command.cancelled", true);
}
- tracer().end(context);
- } else {
- tracer().endExceptionally(context, ex);
+ // and don't report this as an error
+ ex = null;
}
+ instrumenter().end(context, command, null, ex);
return null;
});
} else {
// No response is expected, so we must finish the span now.
- tracer().end(context);
+ instrumenter().end(context, command, null, null);
}
}

DELETE
instrumentation/lettuce/lettuce-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v4_0/LettuceAbstractDatabaseClientTracer.java
-/*
- * Copyright The OpenTelemetry Authors
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package io.opentelemetry.javaagent.instrumentation.lettuce.v4_0;
-
-import com.lambdaworks.redis.RedisURI;
-import io.opentelemetry.api.trace.SpanBuilder;
-import io.opentelemetry.instrumentation.api.tracer.DatabaseClientTracer;
-import io.opentelemetry.instrumentation.api.tracer.net.NetPeerAttributes;
-import io.opentelemetry.semconv.trace.attributes.SemanticAttributes;
-import io.opentelemetry.semconv.trace.attributes.SemanticAttributes.DbSystemValues;
-import java.net.InetSocketAddress;
-
-public abstract class LettuceAbstractDatabaseClientTracer<STATEMENT>
- extends DatabaseClientTracer<RedisURI, STATEMENT, String> {
-
- protected LettuceAbstractDatabaseClientTracer() {
- super(NetPeerAttributes.INSTANCE);
- }
-
- @Override
- protected String spanName(RedisURI connection, STATEMENT statement, String operation) {
- return operation;
- }
-
- @Override
- public void onConnection(SpanBuilder span, RedisURI connection) {
- if (connection != null && connection.getDatabase() != 0) {
- span.setAttribute(
- SemanticAttributes.DB_REDIS_DATABASE_INDEX, (long) connection.getDatabase());
- }
- super.onConnection(span, connection);
- }
-
- @Override
- protected String dbSystem(RedisURI connection) {
- return DbSystemValues.REDIS;
- }
-
- @Override
- protected InetSocketAddress peerAddress(RedisURI redisUri) {
- return new InetSocketAddress(redisUri.getHost(), redisUri.getPort());
- }
-
- @Override
- protected String dbStatement(RedisURI connection, STATEMENT statement, String operation) {
- return operation;
- }
-
- @Override
- protected String getInstrumentationName() {
- return "io.opentelemetry.javaagent.lettuce-4.0";
- }
-}

MODIFY
instrumentation/lettuce/lettuce-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v4_0/LettuceAsyncCommandsInstrumentation.java
instrumentation/lettuce/lettuce-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v4_0/LettuceAsyncCommandsInstrumentation.java
package io.opentelemetry.javaagent.instrumentation.lettuce.v4_0;
import static io.opentelemetry.javaagent.instrumentation.api.Java8BytecodeBridge.currentContext;
-import static io.opentelemetry.javaagent.instrumentation.lettuce.v4_0.LettuceDatabaseClientTracer.tracer;
+import static io.opentelemetry.javaagent.instrumentation.lettuce.v4_0.LettuceInstrumenters.instrumenter;
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
import static net.bytebuddy.matcher.ElementMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
@@ -44,7 +44,7 @@ public class LettuceAsyncCommandsInstrumentation implements TypeInstrumentation
@Advice.Argument(0) RedisCommand<?, ?, ?> command,
@Advice.Local("otelContext") Context context,
@Advice.Local("otelScope") Scope scope) {
- context = tracer().startSpan(currentContext(), null, command);
+ context = instrumenter().start(currentContext(), command);
scope = context.makeCurrent();
}

ADD
instrumentation/lettuce/lettuce-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v4_0/LettuceConnectAttributesExtractor.java
+/*
+ * Copyright The OpenTelemetry Authors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+package io.opentelemetry.javaagent.instrumentation.lettuce.v4_0;
+
+import com.lambdaworks.redis.RedisURI;
+import io.opentelemetry.api.common.AttributesBuilder;
+import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor;
+import io.opentelemetry.semconv.trace.attributes.SemanticAttributes;
+
+final class LettuceConnectAttributesExtractor extends AttributesExtractor<RedisURI, Void> {
+
+ @Override
+ protected void onStart(AttributesBuilder attributes, RedisURI redisUri) {
+ attributes.put(SemanticAttributes.DB_SYSTEM, SemanticAttributes.DbSystemValues.REDIS);
+
+ int database = redisUri.getDatabase();
+ if (database != 0) {
+ attributes.put(SemanticAttributes.DB_REDIS_DATABASE_INDEX, (long) database);
+ }
+ }
+
+ @Override
+ protected void onEnd(AttributesBuilder attributes, RedisURI redisUri, Void ignored) {}
+}

RENAME
instrumentation/lettuce/lettuce-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v4_0/LettuceClientInstrumentation.java
instrumentation/lettuce/lettuce-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v4_0/LettuceConnectInstrumentation.java
package io.opentelemetry.javaagent.instrumentation.lettuce.v4_0;
import static io.opentelemetry.javaagent.instrumentation.api.Java8BytecodeBridge.currentContext;
-import static io.opentelemetry.javaagent.instrumentation.lettuce.v4_0.LettuceConnectionDatabaseClientTracer.tracer;
+import static io.opentelemetry.javaagent.instrumentation.lettuce.v4_0.LettuceInstrumenters.connectInstrumenter;
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
import static net.bytebuddy.matcher.ElementMatchers.named;
@@ -19,7 +19,7 @@ import net.bytebuddy.asm.Advice;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.matcher.ElementMatcher;
-public class LettuceClientInstrumentation implements TypeInstrumentation {
+public class LettuceConnectInstrumentation implements TypeInstrumentation {
@Override
public ElementMatcher<TypeDescription> typeMatcher() {
@@ -30,7 +30,7 @@ public class LettuceClientInstrumentation implements TypeInstrumentation {
public void transform(TypeTransformer transformer) {
transformer.applyAdviceToMethod(
isMethod().and(named("connectStandalone")),
- LettuceClientInstrumentation.class.getName() + "$ConnectAdvice");
+ LettuceConnectInstrumentation.class.getName() + "$ConnectAdvice");
}
public static class ConnectAdvice {
@@ -40,21 +40,18 @@ public class LettuceClientInstrumentation implements TypeInstrumentation {
@Advice.Argument(1) RedisURI redisUri,
@Advice.Local("otelContext") Context context,
@Advice.Local("otelScope") Scope scope) {
- context = tracer().startSpan(currentContext(), redisUri, "CONNECT");
+ context = connectInstrumenter().start(currentContext(), redisUri);
scope = context.makeCurrent();
}
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
public static void onExit(
+ @Advice.Argument(1) RedisURI redisUri,
@Advice.Thrown Throwable throwable,
@Advice.Local("otelContext") Context context,
@Advice.Local("otelScope") Scope scope) {
scope.close();
- if (throwable != null) {
- tracer().endExceptionally(context, throwable);
- } else {
- tracer().end(context);
- }
+ connectInstrumenter().end(context, redisUri, null, throwable);
}
}
}

DELETE
instrumentation/lettuce/lettuce-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v4_0/LettuceConnectionDatabaseClientTracer.java
-/*
- * Copyright The OpenTelemetry Authors
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package io.opentelemetry.javaagent.instrumentation.lettuce.v4_0;
-
-public class LettuceConnectionDatabaseClientTracer
- extends LettuceAbstractDatabaseClientTracer<String> {
-
- private static final LettuceConnectionDatabaseClientTracer TRACER =
- new LettuceConnectionDatabaseClientTracer();
-
- public static LettuceConnectionDatabaseClientTracer tracer() {
- return TRACER;
- }
-
- @Override
- protected String sanitizeStatement(String command) {
- return command;
- }
-}

DELETE
instrumentation/lettuce/lettuce-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v4_0/LettuceDatabaseClientTracer.java
-/*
- * Copyright The OpenTelemetry Authors
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package io.opentelemetry.javaagent.instrumentation.lettuce.v4_0;
-
-import com.lambdaworks.redis.protocol.RedisCommand;
-
-public class LettuceDatabaseClientTracer
- extends LettuceAbstractDatabaseClientTracer<RedisCommand<?, ?, ?>> {
-
- private static final LettuceDatabaseClientTracer TRACER = new LettuceDatabaseClientTracer();
-
- public static LettuceDatabaseClientTracer tracer() {
- return TRACER;
- }
-
- @Override
- protected String sanitizeStatement(RedisCommand<?, ?, ?> command) {
- return command.getType().name();
- }
-}

ADD
instrumentation/lettuce/lettuce-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v4_0/LettuceDbAttributesExtractor.java
+/*
+ * Copyright The OpenTelemetry Authors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+package io.opentelemetry.javaagent.instrumentation.lettuce.v4_0;
+
+import com.lambdaworks.redis.protocol.RedisCommand;
+import io.opentelemetry.instrumentation.api.instrumenter.db.DbAttributesExtractor;
+import io.opentelemetry.semconv.trace.attributes.SemanticAttributes;
+import org.checkerframework.checker.nullness.qual.Nullable;
+
+final class LettuceDbAttributesExtractor extends DbAttributesExtractor<RedisCommand<?, ?, ?>> {
+ @Override
+ protected String system(RedisCommand<?, ?, ?> request) {
+ return SemanticAttributes.DbSystemValues.REDIS;
+ }
+
+ @Override
+ @Nullable
+ protected String user(RedisCommand<?, ?, ?> request) {
+ return null;
+ }
+
+ @Override
+ @Nullable
+ protected String name(RedisCommand<?, ?, ?> request) {
+ return null;
+ }
+
+ @Override
+ @Nullable
+ protected String connectionString(RedisCommand<?, ?, ?> request) {
+ return null;
+ }
+
+ @Override
+ protected String statement(RedisCommand<?, ?, ?> request) {
+ return request.getType().name();
+ }
+
+ @Override
+ protected String operation(RedisCommand<?, ?, ?> request) {
+ return request.getType().name();
+ }
+}

MODIFY
instrumentation/lettuce/lettuce-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v4_0/LettuceInstrumentationModule.java
instrumentation/lettuce/lettuce-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v4_0/LettuceInstrumentationModule.java
@@ -20,6 +20,6 @@ public class LettuceInstrumentationModule extends InstrumentationModule {
@Override
public List<TypeInstrumentation> typeInstrumentations() {
- return asList(new LettuceClientInstrumentation(), new LettuceAsyncCommandsInstrumentation());
+ return asList(new LettuceConnectInstrumentation(), new LettuceAsyncCommandsInstrumentation());
}
}

ADD
instrumentation/lettuce/lettuce-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v4_0/LettuceInstrumenters.java
+/*
+ * Copyright The OpenTelemetry Authors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+package io.opentelemetry.javaagent.instrumentation.lettuce.v4_0;
+
+import com.lambdaworks.redis.RedisURI;
+import com.lambdaworks.redis.protocol.RedisCommand;
+import io.opentelemetry.api.GlobalOpenTelemetry;
+import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
+import io.opentelemetry.instrumentation.api.instrumenter.SpanKindExtractor;
+import io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor;
+import io.opentelemetry.instrumentation.api.instrumenter.db.DbAttributesExtractor;
+import io.opentelemetry.instrumentation.api.instrumenter.db.DbSpanNameExtractor;
+
+public final class LettuceInstrumenters {
+ private static final String INSTRUMENTATION_NAME = "io.opentelemetry.javaagent.jedis-1.4";
+
+ private static final Instrumenter<RedisCommand<?, ?, ?>, Void> INSTRUMENTER;
+
+ private static final Instrumenter<RedisURI, Void> CONNECT_INSTRUMENTER;
+
+ static {
+ DbAttributesExtractor<RedisCommand<?, ?, ?>> attributesExtractor =
+ new LettuceDbAttributesExtractor();
+ SpanNameExtractor<RedisCommand<?, ?, ?>> spanName =
+ DbSpanNameExtractor.create(attributesExtractor);
+
+ INSTRUMENTER =
+ Instrumenter.<RedisCommand<?, ?, ?>, Void>newBuilder(
+ GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, spanName)
+ .addAttributesExtractor(attributesExtractor)
+ .newInstrumenter(SpanKindExtractor.alwaysClient());
+
+ CONNECT_INSTRUMENTER =
+ Instrumenter.<RedisURI, Void>newBuilder(
+ GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, redisUri -> "CONNECT")
+ .addAttributesExtractor(new LettuceNetAttributesExtractor())
+ .addAttributesExtractor(new LettuceConnectAttributesExtractor())
+ .newInstrumenter(SpanKindExtractor.alwaysClient());
+ }
+
+ public static Instrumenter<RedisCommand<?, ?, ?>, Void> instrumenter() {
+ return INSTRUMENTER;
+ }
+
+ public static Instrumenter<RedisURI, Void> connectInstrumenter() {
+ return CONNECT_INSTRUMENTER;
+ }
+
+ private LettuceInstrumenters() {}
+}

ADD
instrumentation/lettuce/lettuce-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v4_0/LettuceNetAttributesExtractor.java
+/*
+ * Copyright The OpenTelemetry Authors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+package io.opentelemetry.javaagent.instrumentation.lettuce.v4_0;
+
+import com.lambdaworks.redis.RedisURI;
+import io.opentelemetry.instrumentation.api.instrumenter.net.NetAttributesExtractor;
+import org.checkerframework.checker.nullness.qual.Nullable;
+
+final class LettuceNetAttributesExtractor extends NetAttributesExtractor<RedisURI, Void> {
+
+ @Override
+ @Nullable
+ protected String transport(RedisURI redisUri) {
+ return null;
+ }
+
+ @Override
+ protected String peerName(RedisURI redisUri, @Nullable Void ignored) {
+ return redisUri.getHost();
+ }
+
+ @Override
+ protected Integer peerPort(RedisURI redisUri, @Nullable Void ignored) {
+ return redisUri.getPort();
+ }
+
+ @Override
+ @Nullable
+ protected String peerIp(RedisURI redisUri, @Nullable Void ignored) {
+ return null;
+ }
+}

MODIFY
instrumentation/lettuce/lettuce-4.0/javaagent/src/test/groovy/LettuceAsyncClientTest.groovy
instrumentation/lettuce/lettuce-4.0/javaagent/src/test/groovy/LettuceAsyncClientTest.groovy
@@ -112,10 +112,8 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
kind CLIENT
attributes {
"${SemanticAttributes.NET_PEER_NAME.key}" HOST
- "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" port
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
- "${SemanticAttributes.DB_STATEMENT.key}" "CONNECT"
}
}
}
@@ -146,10 +144,8 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
errorEvent RedisConnectionException, String
attributes {
"${SemanticAttributes.NET_PEER_NAME.key}" HOST
- "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" incorrectPort
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
- "${SemanticAttributes.DB_STATEMENT.key}" "CONNECT"
}
}
}
@@ -170,6 +166,7 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
kind CLIENT
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
+ "${SemanticAttributes.DB_OPERATION.key}" "SET"
"${SemanticAttributes.DB_STATEMENT.key}" "SET"
}
}
@@ -202,6 +199,7 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
kind CLIENT
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
+ "${SemanticAttributes.DB_OPERATION.key}" "GET"
"${SemanticAttributes.DB_STATEMENT.key}" "GET"
}
}
@@ -248,6 +246,7 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
kind CLIENT
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
+ "${SemanticAttributes.DB_OPERATION.key}" "GET"
"${SemanticAttributes.DB_STATEMENT.key}" "GET"
}
}
@@ -280,6 +279,7 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
kind CLIENT
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
+ "${SemanticAttributes.DB_OPERATION.key}" "RANDOMKEY"
"${SemanticAttributes.DB_STATEMENT.key}" "RANDOMKEY"
}
}
@@ -331,6 +331,7 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
kind CLIENT
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
+ "${SemanticAttributes.DB_OPERATION.key}" "HMSET"
"${SemanticAttributes.DB_STATEMENT.key}" "HMSET"
}
}
@@ -341,6 +342,7 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
kind CLIENT
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
+ "${SemanticAttributes.DB_OPERATION.key}" "HGETALL"
"${SemanticAttributes.DB_STATEMENT.key}" "HGETALL"
}
}
@@ -383,6 +385,7 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
errorEvent(IllegalStateException, "TestException")
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
+ "${SemanticAttributes.DB_OPERATION.key}" "DEL"
"${SemanticAttributes.DB_STATEMENT.key}" "DEL"
}
}
@@ -417,6 +420,7 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
kind CLIENT
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
+ "${SemanticAttributes.DB_OPERATION.key}" "SADD"
"${SemanticAttributes.DB_STATEMENT.key}" "SADD"
"lettuce.command.cancelled" true
}
@@ -437,6 +441,7 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
kind CLIENT
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
+ "${SemanticAttributes.DB_OPERATION.key}" "DEBUG"
"${SemanticAttributes.DB_STATEMENT.key}" "DEBUG"
}
}
@@ -457,6 +462,7 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
kind CLIENT
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
+ "${SemanticAttributes.DB_OPERATION.key}" "SHUTDOWN"
"${SemanticAttributes.DB_STATEMENT.key}" "SHUTDOWN"
}
}

MODIFY
instrumentation/lettuce/lettuce-4.0/javaagent/src/test/groovy/LettuceSyncClientTest.groovy
instrumentation/lettuce/lettuce-4.0/javaagent/src/test/groovy/LettuceSyncClientTest.groovy
@@ -97,10 +97,8 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
kind CLIENT
attributes {
"${SemanticAttributes.NET_PEER_NAME.key}" HOST
- "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" port
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
- "${SemanticAttributes.DB_STATEMENT.key}" "CONNECT"
}
}
}
@@ -129,10 +127,8 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
errorEvent RedisConnectionException, String
attributes {
"${SemanticAttributes.NET_PEER_NAME.key}" HOST
- "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" incorrectPort
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
- "${SemanticAttributes.DB_STATEMENT.key}" "CONNECT"
}
}
}
@@ -152,6 +148,7 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
kind CLIENT
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
+ "${SemanticAttributes.DB_OPERATION.key}" "SET"
"${SemanticAttributes.DB_STATEMENT.key}" "SET"
}
}
@@ -172,6 +169,7 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
kind CLIENT
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
+ "${SemanticAttributes.DB_OPERATION.key}" "GET"
"${SemanticAttributes.DB_STATEMENT.key}" "GET"
}
}
@@ -192,6 +190,7 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
kind CLIENT
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
+ "${SemanticAttributes.DB_OPERATION.key}" "GET"
"${SemanticAttributes.DB_STATEMENT.key}" "GET"
}
}
@@ -212,6 +211,7 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
kind CLIENT
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
+ "${SemanticAttributes.DB_OPERATION.key}" "RANDOMKEY"
"${SemanticAttributes.DB_STATEMENT.key}" "RANDOMKEY"
}
}
@@ -232,6 +232,7 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
kind CLIENT
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
+ "${SemanticAttributes.DB_OPERATION.key}" "LPUSH"
"${SemanticAttributes.DB_STATEMENT.key}" "LPUSH"
}
}
@@ -252,6 +253,7 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
kind CLIENT
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
+ "${SemanticAttributes.DB_OPERATION.key}" "HMSET"
"${SemanticAttributes.DB_STATEMENT.key}" "HMSET"
}
}
@@ -272,6 +274,7 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
kind CLIENT
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
+ "${SemanticAttributes.DB_OPERATION.key}" "HGETALL"
"${SemanticAttributes.DB_STATEMENT.key}" "HGETALL"
}
}
@@ -291,6 +294,7 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
kind CLIENT
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
+ "${SemanticAttributes.DB_OPERATION.key}" "DEBUG"
"${SemanticAttributes.DB_STATEMENT.key}" "DEBUG"
}
}
@@ -310,6 +314,7 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
kind CLIENT
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
+ "${SemanticAttributes.DB_OPERATION.key}" "SHUTDOWN"
"${SemanticAttributes.DB_STATEMENT.key}" "SHUTDOWN"
}
}

Update lettuce-4.0 to Instrumenter API (#3068)