|
16 | 16 |
|
17 | 17 | package com.google.cloud.spanner;
|
18 | 18 |
|
| 19 | +import com.google.api.gax.core.GaxProperties; |
19 | 20 | import com.google.cloud.spanner.Options.TagOption;
|
20 | 21 | import com.google.cloud.spanner.Options.TransactionOption;
|
21 | 22 | import com.google.cloud.spanner.SpannerOptions.TracingFramework;
|
@@ -46,6 +47,12 @@ class TraceWrapper {
|
46 | 47 | private static final AttributeKey<List<String>> DB_STATEMENT_ARRAY_KEY =
|
47 | 48 | AttributeKey.stringArrayKey("db.statement");
|
48 | 49 | private static final AttributeKey<String> DB_TABLE_NAME_KEY = AttributeKey.stringKey("db.table");
|
| 50 | + private static final AttributeKey<String> GCP_CLIENT_SERVICE_KEY = |
| 51 | + AttributeKey.stringKey("gcp.client.service"); |
| 52 | + private static final AttributeKey<String> GCP_CLIENT_VERSION_KEY = |
| 53 | + AttributeKey.stringKey("gcp.client.version"); |
| 54 | + private static final AttributeKey<String> GCP_CLIENT_REPO_KEY = |
| 55 | + AttributeKey.stringKey("gcp.client.repo"); |
49 | 56 | private static final AttributeKey<String> THREAD_NAME_KEY = AttributeKey.stringKey("thread.name");
|
50 | 57 |
|
51 | 58 | private final Tracer openCensusTracer;
|
@@ -204,6 +211,9 @@ Attributes createCommonAttributes(DatabaseId db) {
|
204 | 211 | AttributesBuilder builder = Attributes.builder();
|
205 | 212 | builder.put(DB_NAME_KEY, db.getDatabase());
|
206 | 213 | builder.put(INSTANCE_NAME_KEY, db.getInstanceId().getInstance());
|
| 214 | + builder.put(GCP_CLIENT_SERVICE_KEY, "spanner"); |
| 215 | + builder.put(GCP_CLIENT_REPO_KEY, "googleapis/java-spanner"); |
| 216 | + builder.put(GCP_CLIENT_VERSION_KEY, GaxProperties.getLibraryVersion(TraceWrapper.class)); |
207 | 217 | return builder.build();
|
208 | 218 | }
|
209 | 219 |
|
|
0 commit comments