|
16 | 16 | import io.opentelemetry.contrib.awsxray.propagator.AwsXrayPropagator; |
17 | 17 | import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; |
18 | 18 | import io.opentelemetry.instrumentation.api.internal.InstrumenterUtil; |
| 19 | +import io.opentelemetry.instrumentation.api.internal.SemconvStability; |
19 | 20 | import io.opentelemetry.instrumentation.api.internal.Timer; |
20 | 21 | import io.opentelemetry.semconv.HttpAttributes; |
21 | 22 | import java.io.BufferedReader; |
@@ -50,6 +51,8 @@ public final class TracingExecutionInterceptor implements ExecutionInterceptor { |
50 | 51 |
|
51 | 52 | // copied from DbIncubatingAttributes |
52 | 53 | private static final AttributeKey<String> DB_OPERATION = AttributeKey.stringKey("db.operation"); |
| 54 | + private static final AttributeKey<String> DB_OPERATION_NAME = |
| 55 | + AttributeKey.stringKey("db.operation.name"); |
53 | 56 | private static final AttributeKey<String> DB_SYSTEM = AttributeKey.stringKey("db.system"); |
54 | 57 | // copied from DbIncubatingAttributes.DbSystemIncubatingValues |
55 | 58 | private static final String DB_SYSTEM_DYNAMODB = "dynamodb"; |
@@ -331,7 +334,11 @@ private void populateRequestAttributes( |
331 | 334 | span.setAttribute(DB_SYSTEM, DB_SYSTEM_DYNAMODB); |
332 | 335 | String operation = attributes.getAttribute(SdkExecutionAttribute.OPERATION_NAME); |
333 | 336 | if (operation != null) { |
334 | | - span.setAttribute(DB_OPERATION, operation); |
| 337 | + if (SemconvStability.emitStableDatabaseSemconv()) { |
| 338 | + span.setAttribute(DB_OPERATION_NAME, operation); |
| 339 | + } else { |
| 340 | + span.setAttribute(DB_OPERATION, operation); |
| 341 | + } |
335 | 342 | } |
336 | 343 | } |
337 | 344 | } |
|
0 commit comments