Skip to content

Commit 979b159

Browse files
committed
Merge branch 'main' into jdk-23
2 parents 74be3cc + f1faa01 commit 979b159

File tree

47 files changed

+2638
-2908
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2638
-2908
lines changed

instrumentation/elasticsearch/elasticsearch-transport-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/transport/v5_0/Elasticsearch5TransportExperimentalAttributesExtractor.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
package io.opentelemetry.javaagent.instrumentation.elasticsearch.transport.v5_0;
77

8+
import io.opentelemetry.api.common.AttributeKey;
89
import io.opentelemetry.api.common.AttributesBuilder;
910
import io.opentelemetry.context.Context;
1011
import io.opentelemetry.javaagent.instrumentation.elasticsearch.transport.ElasticTransportRequest;
@@ -14,6 +15,11 @@
1415
public class Elasticsearch5TransportExperimentalAttributesExtractor
1516
extends ElasticsearchTransportExperimentalAttributesExtractor {
1617

18+
private static final AttributeKey<String> ELASTICSEARCH_REQUEST_WRITE_TYPE =
19+
AttributeKey.stringKey("elasticsearch.request.write.type");
20+
private static final AttributeKey<String> ELASTICSEARCH_REQUEST_WRITE_ROUTING =
21+
AttributeKey.stringKey("elasticsearch.request.write.routing");
22+
1723
@Override
1824
public void onStart(
1925
AttributesBuilder attributes,
@@ -24,8 +30,8 @@ public void onStart(
2430
Object request = transportRequest.getRequest();
2531
if (request instanceof DocumentRequest) {
2632
DocumentRequest<?> req = (DocumentRequest<?>) request;
27-
attributes.put("elasticsearch.request.write.type", req.type());
28-
attributes.put("elasticsearch.request.write.routing", req.routing());
33+
attributes.put(ELASTICSEARCH_REQUEST_WRITE_TYPE, req.type());
34+
attributes.put(ELASTICSEARCH_REQUEST_WRITE_ROUTING, req.routing());
2935
}
3036
}
3137
}

instrumentation/elasticsearch/elasticsearch-transport-5.0/javaagent/src/test/groovy/Elasticsearch5NodeClientTest.groovy

Lines changed: 0 additions & 309 deletions
This file was deleted.

0 commit comments

Comments
 (0)