Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Aleksandrov <dmitry.aleksandrov@oracle.com>
  • Loading branch information
dalexandrov committed Oct 5, 2023
1 parent 8989d53 commit 1ebb9b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
* This interceptor is added through Java Service loader.
*/
public class DbClientTracing extends DbClientServiceBase {
private static final Tag<? super String> DBCLIENT_TAG = Tag.COMPONENT.create("dbclient");

private DbClientTracing(Builder builder) {
super(builder);
}
Expand Down Expand Up @@ -89,7 +91,8 @@ protected Single<DbClientServiceContext> apply(DbClientServiceContext serviceCon
if (spanConfig.logEnabled("statement", true)) {
Tag.DB_STATEMENT.create(serviceContext.statement()).apply(span);
}
Tag.COMPONENT.create("dbclient").apply(span);

DBCLIENT_TAG.apply(span);
Tag.DB_TYPE.create(serviceContext.dbType()).apply(span);

serviceContext.statementFuture().thenAccept(nothing -> {
Expand All @@ -105,11 +108,7 @@ protected Single<DbClientServiceContext> apply(DbClientServiceContext serviceCon
}
span.end();
}).exceptionally(throwable -> {
Tag.ERROR.create(Boolean.TRUE).apply(span);
span.addEvent("error", Map.of("error.kind", "Exception",
"error.object", throwable,
"message", throwable.getMessage()));
span.end();
span.end(throwable);
return null;
});

Expand Down
4 changes: 0 additions & 4 deletions tracing/tracing/src/main/java/io/helidon/tracing/Tag.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ public abstract class Tag<T> {
*/
public static final TagSource<String> DB_STATEMENT = new StringTagSource("db.statement");

/**
* Tag marking an Error.
*/
public static final TagSource<Boolean> ERROR = new BooleanTagSource("error");
private final String key;
private final T value;

Expand Down

0 comments on commit 1ebb9b5

Please sign in to comment.