Skip to content

Commit

Permalink
addressed nit comments
Browse files Browse the repository at this point in the history
  • Loading branch information
akats7 committed Nov 27, 2024
1 parent d2b7fed commit b86f2de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

public class DynamoDbAttributesExtractor implements AttributesExtractor<Request<?>, Response<?>> {

// copied from DbIncubatingAttributes.DbSystemIncubatingValues
private static final AttributeKey<String> DB_SYSTEM = AttributeKey.stringKey("db.system");
private static final AttributeKey<List<String>> AWS_DYNAMODB_TABLE_NAMES =
AttributeKey.stringArrayKey("aws.dynamodb.table_names");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ final class TracingRequestHandler extends RequestHandler2 {
ContextKey.named(TracingRequestHandler.class.getName() + ".Timer");
private static final ContextKey<Boolean> REQUEST_SPAN_SUPPRESSED_KEY =
ContextKey.named(TracingRequestHandler.class.getName() + ".RequestSpanSuppressed");
private static final String SEND_MESSAGE_REQUEST =
private static final String SEND_MESSAGE_REQUEST_CLASS =
"com.amazonaws.services.sqs.model.SendMessageRequest";
private static final String DYNAMODBV2 = "com.amazonaws.services.dynamodbv2.model.";
private static final String DYNAMODBV2_CLASS_PREFIX = "com.amazonaws.services.dynamodbv2.model.";

private final Instrumenter<Request<?>, Response<?>> requestInstrumenter;
private final Instrumenter<SqsReceiveRequest, Response<?>> consumerReceiveInstrumenter;
Expand Down Expand Up @@ -162,10 +162,10 @@ private void finish(Request<?> request, Response<?> response, @Nullable Throwabl

private Instrumenter<Request<?>, Response<?>> getInstrumenter(Request<?> request) {
String className = request.getOriginalRequest().getClass().getName();
if (className.startsWith(DYNAMODBV2)) {
if (className.startsWith(DYNAMODBV2_CLASS_PREFIX)) {
return dynamoDbInstrumenter;
}
if (className.equals(SEND_MESSAGE_REQUEST)) {
if (className.equals(SEND_MESSAGE_REQUEST_CLASS)) {
return producerInstrumenter;
}
return requestInstrumenter;
Expand Down

0 comments on commit b86f2de

Please sign in to comment.