Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

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

import io.opentelemetry.api.common.AttributeKey;
import io.opentelemetry.api.common.AttributesBuilder;
import io.opentelemetry.context.Context;
import io.opentelemetry.javaagent.instrumentation.elasticsearch.transport.ElasticTransportRequest;
Expand All @@ -14,6 +15,11 @@
public class Elasticsearch5TransportExperimentalAttributesExtractor
extends ElasticsearchTransportExperimentalAttributesExtractor {

private static final AttributeKey<String> ELASTICSEARCH_REQUEST_WRITE_TYPE =
AttributeKey.stringKey("elasticsearch.request.write.type");
private static final AttributeKey<String> ELASTICSEARCH_REQUEST_WRITE_ROUTING =
AttributeKey.stringKey("elasticsearch.request.write.routing");

@Override
public void onStart(
AttributesBuilder attributes,
Expand All @@ -24,8 +30,8 @@ public void onStart(
Object request = transportRequest.getRequest();
if (request instanceof DocumentRequest) {
DocumentRequest<?> req = (DocumentRequest<?>) request;
attributes.put("elasticsearch.request.write.type", req.type());
attributes.put("elasticsearch.request.write.routing", req.routing());
attributes.put(ELASTICSEARCH_REQUEST_WRITE_TYPE, req.type());
attributes.put(ELASTICSEARCH_REQUEST_WRITE_ROUTING, req.routing());
}
}
}

This file was deleted.

Loading
Loading