Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/main/java/io/kurrent/dbclient/ClientTelemetry.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static CompletableFuture<WriteResult> traceAppend(
SpanKind.CLIENT,
null,
ClientTelemetryTags.builder()
.withRequiredTag(ClientTelemetryAttributes.Kurrent.STREAM, streamId)
.withRequiredTag(ClientTelemetryAttributes.KurrentDB.STREAM, streamId)
.withServerTagsFromGrpcChannel(channel)
.withServerTagsFromClientSettings(settings)
.withOptionalDatabaseUserTag(settings.getDefaultCredentials())
Expand Down Expand Up @@ -139,10 +139,10 @@ static void traceSubscribe(Runnable tracedOperation, String subscriptionId, Mana
SpanKind.CONSUMER,
remoteParentContext,
ClientTelemetryTags.builder()
.withRequiredTag(ClientTelemetryAttributes.Kurrent.STREAM, event.getStreamId())
.withRequiredTag(ClientTelemetryAttributes.Kurrent.SUBSCRIPTION_ID, subscriptionId)
.withRequiredTag(ClientTelemetryAttributes.Kurrent.EVENT_ID, event.getEventId().toString())
.withRequiredTag(ClientTelemetryAttributes.Kurrent.EVENT_TYPE, event.getEventType())
.withRequiredTag(ClientTelemetryAttributes.KurrentDB.STREAM, event.getStreamId())
.withRequiredTag(ClientTelemetryAttributes.KurrentDB.SUBSCRIPTION_ID, subscriptionId)
.withRequiredTag(ClientTelemetryAttributes.KurrentDB.EVENT_ID, event.getEventId().toString())
.withRequiredTag(ClientTelemetryAttributes.KurrentDB.EVENT_TYPE, event.getEventType())
.withServerTagsFromGrpcChannel(channel)
.withServerTagsFromClientSettings(settings)
.withOptionalDatabaseUserTag(settings.getDefaultCredentials())
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/io/kurrent/dbclient/ClientTelemetryAttributes.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ public static class Exceptions {
public static final String STACK_TRACE = ExceptionAttributes.EXCEPTION_STACKTRACE.getKey();
}

public static class Kurrent {
public static final String STREAM = "db.kurrent.stream";
public static final String SUBSCRIPTION_ID = "db.kurrent.subscription.id";
public static final String EVENT_ID = "db.kurrent.event.id";
public static final String EVENT_TYPE = "db.kurrent.event.type";
public static class KurrentDB {
public static final String STREAM = "db.kurrentdb.stream";
public static final String SUBSCRIPTION_ID = "db.kurrentdb.subscription.id";
public static final String EVENT_ID = "db.kurrentdb.event.id";
public static final String EVENT_TYPE = "db.kurrentdb.event.type";
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.kurrent.dbclient;

public class ClientTelemetryConstants {
public static final String INSTRUMENTATION_NAME = "kurrent";
public static final String INSTRUMENTATION_NAME = "kurrentdb";

public static class Metadata {
public static final String TRACE_ID = "$traceId";
Expand Down
10 changes: 5 additions & 5 deletions src/test/java/io/kurrent/dbclient/telemetry/TelemetryAware.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public interface TelemetryAware extends ConnectionAware {
default void assertAppendSpanHasExpectedAttributes(ReadableSpan span, String streamName) {
assertSpanAttributeEquals(span, ClientTelemetryAttributes.Database.SYSTEM, ClientTelemetryConstants.INSTRUMENTATION_NAME);
assertSpanAttributeEquals(span, ClientTelemetryAttributes.Database.OPERATION, ClientTelemetryConstants.Operations.APPEND);
assertSpanAttributeEquals(span, ClientTelemetryAttributes.Kurrent.STREAM, streamName);
assertSpanAttributeEquals(span, ClientTelemetryAttributes.KurrentDB.STREAM, streamName);
assertSpanAttributeEquals(span, ClientTelemetryAttributes.Database.USER, "admin");
Assertions.assertEquals(StatusCode.OK, span.toSpanData().getStatus().getStatusCode());
Assertions.assertEquals(SpanKind.CLIENT, span.getKind());
Expand All @@ -42,10 +42,10 @@ default void assertSubscriptionActivityHasExpectedAttributes(ReadableSpan span,
assertSpanAttributeEquals(span, ClientTelemetryAttributes.Database.SYSTEM, ClientTelemetryConstants.INSTRUMENTATION_NAME);
assertSpanAttributeEquals(span, ClientTelemetryAttributes.Database.OPERATION, ClientTelemetryConstants.Operations.SUBSCRIBE);
assertSpanAttributeEquals(span, ClientTelemetryAttributes.Database.USER, "admin");
assertSpanAttributeEquals(span, ClientTelemetryAttributes.Kurrent.STREAM, streamName);
assertSpanAttributeEquals(span, ClientTelemetryAttributes.Kurrent.SUBSCRIPTION_ID, subscriptionId);
assertSpanAttributeEquals(span, ClientTelemetryAttributes.Kurrent.EVENT_ID, eventId);
assertSpanAttributeEquals(span, ClientTelemetryAttributes.Kurrent.EVENT_TYPE, eventType);
assertSpanAttributeEquals(span, ClientTelemetryAttributes.KurrentDB.STREAM, streamName);
assertSpanAttributeEquals(span, ClientTelemetryAttributes.KurrentDB.SUBSCRIPTION_ID, subscriptionId);
assertSpanAttributeEquals(span, ClientTelemetryAttributes.KurrentDB.EVENT_ID, eventId);
assertSpanAttributeEquals(span, ClientTelemetryAttributes.KurrentDB.EVENT_TYPE, eventType);
Assertions.assertEquals(StatusCode.OK, span.toSpanData().getStatus().getStatusCode());
Assertions.assertEquals(SpanKind.CONSUMER, span.getKind());
}
Expand Down
Loading