This documentation has an index for AI agents at /llms.txt. A Markdown version of this page is available at https://explorer.opentelemetry.io/java-agent/instrumentation/elasticsearch-transport-6.0.md.

Elasticsearch Transport Client

OpenTelemetry Java agent instrumentation

This instrumentation enables database client spans and database client metrics for Elasticsearch transport client requests. Each call produces a span named after the Elasticsearch action, enriched with transport-specific attributes.

  • Name: elasticsearch-transport-6.0
  • Scope: io.opentelemetry.elasticsearch-transport-6.0
  • Target versions: org.elasticsearch.client:transport:[6.0.0,), org.elasticsearch:elasticsearch:[6.0.0,8.0.0)
  • Library: https://www.elastic.co/guide/en/elasticsearch/client/java-api/

Telemetry

When default

Spans

Span kindAttributes
CLIENTdb.operation (STRING), db.system (STRING), network.peer.address (STRING), network.peer.port (LONG), network.type (STRING)

When otel.instrumentation.elasticsearch.experimental-span-attributes=true

Spans

Span kindAttributes
CLIENTdb.operation (STRING), db.system (STRING), elasticsearch.action (STRING), elasticsearch.id (STRING), elasticsearch.request (STRING), elasticsearch.request.indices (STRING), elasticsearch.request.write.type (STRING), elasticsearch.request.write.version (LONG), elasticsearch.response.status (LONG), elasticsearch.shard.replication.failed (LONG), elasticsearch.shard.replication.successful (LONG), elasticsearch.shard.replication.total (LONG), elasticsearch.type (STRING), elasticsearch.version (LONG), network.peer.address (STRING), network.peer.port (LONG), network.type (STRING)

When otel.semconv-stability.opt-in=database

Metrics

MetricInstrumentTypeUnitDescription
db.client.operation.durationhistogramHISTOGRAMsDuration of database client operations.
MetricAttributes
db.client.operation.durationdb.operation.name (STRING), db.system.name (STRING)

Spans

Span kindAttributes
CLIENTdb.operation.name (STRING), db.system.name (STRING), error.type (STRING), network.peer.address (STRING), network.peer.port (LONG), server.address (STRING)

Configuration

OptionTypeDefaultDescription
otel.instrumentation.elasticsearch.experimental-span-attributesbooleanfalseEnable the capture of elasticsearch.action, elasticsearch.id, elasticsearch.request, elasticsearch.request.indices, elasticsearch.request.write.type, elasticsearch.request.write.version, elasticsearch.response.status, elasticsearch.shard.replication.failed, elasticsearch.shard.replication.successful, elasticsearch.shard.replication.total, elasticsearch.type, and elasticsearch.version experimental span attributes.

Data

  • JSON (latest): /data/javaagent/instrumentations/elasticsearch-transport-6.0/latest.json
  • JSON (pinned): /data/javaagent/instrumentations/elasticsearch-transport-6.0/elasticsearch-transport-6.0-f054617b1b1d.json
  • Explore: /java-agent/instrumentation/elasticsearch-transport-6.0