Skip to content

Commit 780b3d8

Browse files
committed
elasticsearch metadata
1 parent 68a17ad commit 780b3d8

File tree

12 files changed

+841
-366
lines changed

12 files changed

+841
-366
lines changed

docs/instrumentation-list.yaml

Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,29 +1151,251 @@ libraries:
11511151
type: boolean
11521152
default: false
11531153
- name: elasticsearch-transport-5.0
1154+
description: |
1155+
This instrumentation provides client spans for Elasticsearch transport client requests. Each call produces a span named after the Elasticsearch action, enriched with transport-specific attributes.
11541156
source_path: instrumentation/elasticsearch/elasticsearch-transport-5.0
11551157
scope:
11561158
name: io.opentelemetry.elasticsearch-transport-5.0
11571159
target_versions:
11581160
javaagent:
11591161
- org.elasticsearch.client:transport:[5.0.0,5.3.0)
11601162
- org.elasticsearch:elasticsearch:[5.0.0,5.3.0)
1163+
configurations:
1164+
- name: otel.instrumentation.elasticsearch.experimental-span-attributes
1165+
description: Enable the capture of experimental span attributes.
1166+
type: boolean
1167+
default: false
1168+
telemetry:
1169+
- when: default
1170+
spans:
1171+
- span_kind: CLIENT
1172+
attributes:
1173+
- name: db.operation
1174+
type: STRING
1175+
- name: db.system
1176+
type: STRING
1177+
- name: network.peer.address
1178+
type: STRING
1179+
- name: network.peer.port
1180+
type: LONG
1181+
- when: otel.instrumentation.elasticsearch.experimental-span-attributes=true
1182+
spans:
1183+
- span_kind: CLIENT
1184+
attributes:
1185+
- name: db.operation
1186+
type: STRING
1187+
- name: db.system
1188+
type: STRING
1189+
- name: elasticsearch.action
1190+
type: STRING
1191+
- name: elasticsearch.id
1192+
type: STRING
1193+
- name: elasticsearch.request
1194+
type: STRING
1195+
- name: elasticsearch.request.indices
1196+
type: STRING
1197+
- name: elasticsearch.request.write.type
1198+
type: STRING
1199+
- name: elasticsearch.response.status
1200+
type: LONG
1201+
- name: elasticsearch.shard.replication.failed
1202+
type: LONG
1203+
- name: elasticsearch.shard.replication.successful
1204+
type: LONG
1205+
- name: elasticsearch.shard.replication.total
1206+
type: LONG
1207+
- name: elasticsearch.type
1208+
type: STRING
1209+
- name: elasticsearch.version
1210+
type: LONG
1211+
- name: network.peer.address
1212+
type: STRING
1213+
- name: network.peer.port
1214+
type: LONG
1215+
- when: otel.semconv-stability.opt-in=database
1216+
spans:
1217+
- span_kind: CLIENT
1218+
attributes:
1219+
- name: db.operation.name
1220+
type: STRING
1221+
- name: db.system.name
1222+
type: STRING
1223+
- name: error.type
1224+
type: STRING
1225+
- name: network.peer.address
1226+
type: STRING
1227+
- name: network.peer.port
1228+
type: LONG
11611229
- name: elasticsearch-transport-5.3
1230+
description: |
1231+
This instrumentation provides client spans for Elasticsearch transport client requests. Each call produces a span named after the Elasticsearch action, enriched with transport-specific attributes.
11621232
source_path: instrumentation/elasticsearch/elasticsearch-transport-5.3
11631233
scope:
11641234
name: io.opentelemetry.elasticsearch-transport-5.3
11651235
target_versions:
11661236
javaagent:
11671237
- org.elasticsearch.client:transport:[5.3.0,6.0.0)
11681238
- org.elasticsearch:elasticsearch:[5.3.0,6.0.0)
1239+
configurations:
1240+
- name: otel.instrumentation.elasticsearch.experimental-span-attributes
1241+
description: Enable the capture of experimental span attributes.
1242+
type: boolean
1243+
default: false
1244+
telemetry:
1245+
- when: default
1246+
spans:
1247+
- span_kind: CLIENT
1248+
attributes:
1249+
- name: db.operation
1250+
type: STRING
1251+
- name: db.system
1252+
type: STRING
1253+
- name: network.peer.address
1254+
type: STRING
1255+
- name: network.peer.port
1256+
type: LONG
1257+
- when: otel.instrumentation.elasticsearch.experimental-span-attributes=true
1258+
spans:
1259+
- span_kind: CLIENT
1260+
attributes:
1261+
- name: db.operation
1262+
type: STRING
1263+
- name: db.system
1264+
type: STRING
1265+
- name: elasticsearch.action
1266+
type: STRING
1267+
- name: elasticsearch.id
1268+
type: STRING
1269+
- name: elasticsearch.request
1270+
type: STRING
1271+
- name: elasticsearch.request.indices
1272+
type: STRING
1273+
- name: elasticsearch.request.search.types
1274+
type: STRING
1275+
- name: elasticsearch.request.write.type
1276+
type: STRING
1277+
- name: elasticsearch.request.write.version
1278+
type: LONG
1279+
- name: elasticsearch.response.status
1280+
type: LONG
1281+
- name: elasticsearch.shard.broadcast.failed
1282+
type: LONG
1283+
- name: elasticsearch.shard.broadcast.successful
1284+
type: LONG
1285+
- name: elasticsearch.shard.broadcast.total
1286+
type: LONG
1287+
- name: elasticsearch.shard.replication.failed
1288+
type: LONG
1289+
- name: elasticsearch.shard.replication.successful
1290+
type: LONG
1291+
- name: elasticsearch.shard.replication.total
1292+
type: LONG
1293+
- name: elasticsearch.type
1294+
type: STRING
1295+
- name: elasticsearch.version
1296+
type: LONG
1297+
- name: network.peer.address
1298+
type: STRING
1299+
- name: network.peer.port
1300+
type: LONG
1301+
- when: otel.semconv-stability.opt-in=database
1302+
spans:
1303+
- span_kind: CLIENT
1304+
attributes:
1305+
- name: db.operation.name
1306+
type: STRING
1307+
- name: db.system.name
1308+
type: STRING
1309+
- name: error.type
1310+
type: STRING
1311+
- name: network.peer.address
1312+
type: STRING
1313+
- name: network.peer.port
1314+
type: LONG
11691315
- name: elasticsearch-transport-6.0
1316+
description: |
1317+
This instrumentation provides client spans for Elasticsearch transport client requests. Each call produces a span named after the Elasticsearch action, enriched with transport-specific attributes.
11701318
source_path: instrumentation/elasticsearch/elasticsearch-transport-6.0
11711319
scope:
11721320
name: io.opentelemetry.elasticsearch-transport-6.0
11731321
target_versions:
11741322
javaagent:
11751323
- org.elasticsearch:elasticsearch:[6.0.0,8.0.0)
11761324
- org.elasticsearch.client:transport:[6.0.0,)
1325+
configurations:
1326+
- name: otel.instrumentation.elasticsearch.experimental-span-attributes
1327+
description: Enable the capture of experimental span attributes.
1328+
type: boolean
1329+
default: false
1330+
telemetry:
1331+
- when: default
1332+
spans:
1333+
- span_kind: CLIENT
1334+
attributes:
1335+
- name: db.operation
1336+
type: STRING
1337+
- name: db.system
1338+
type: STRING
1339+
- name: network.peer.address
1340+
type: STRING
1341+
- name: network.peer.port
1342+
type: LONG
1343+
- name: network.type
1344+
type: STRING
1345+
- when: otel.instrumentation.elasticsearch.experimental-span-attributes=true
1346+
spans:
1347+
- span_kind: CLIENT
1348+
attributes:
1349+
- name: db.operation
1350+
type: STRING
1351+
- name: db.system
1352+
type: STRING
1353+
- name: elasticsearch.action
1354+
type: STRING
1355+
- name: elasticsearch.id
1356+
type: STRING
1357+
- name: elasticsearch.request
1358+
type: STRING
1359+
- name: elasticsearch.request.indices
1360+
type: STRING
1361+
- name: elasticsearch.request.write.type
1362+
type: STRING
1363+
- name: elasticsearch.request.write.version
1364+
type: LONG
1365+
- name: elasticsearch.response.status
1366+
type: LONG
1367+
- name: elasticsearch.shard.replication.failed
1368+
type: LONG
1369+
- name: elasticsearch.shard.replication.successful
1370+
type: LONG
1371+
- name: elasticsearch.shard.replication.total
1372+
type: LONG
1373+
- name: elasticsearch.type
1374+
type: STRING
1375+
- name: elasticsearch.version
1376+
type: LONG
1377+
- name: network.peer.address
1378+
type: STRING
1379+
- name: network.peer.port
1380+
type: LONG
1381+
- name: network.type
1382+
type: STRING
1383+
- when: otel.semconv-stability.opt-in=database
1384+
spans:
1385+
- span_kind: CLIENT
1386+
attributes:
1387+
- name: db.operation.name
1388+
type: STRING
1389+
- name: db.system.name
1390+
type: STRING
1391+
- name: error.type
1392+
type: STRING
1393+
- name: network.peer.address
1394+
type: STRING
1395+
- name: network.peer.port
1396+
type: LONG
1397+
- name: network.type
1398+
type: STRING
11771399
executors:
11781400
- name: executors
11791401
description: |

instrumentation-docs/collect.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,21 @@ readonly INSTRUMENTATIONS=(
7272
"oshi:javaagent:testExperimental"
7373
"vibur-dbcp-11.0:javaagent:test"
7474
"vibur-dbcp-11.0:javaagent:testStableSemconv"
75+
"elasticsearch:elasticsearch-transport-5.0:javaagent:test"
76+
"elasticsearch:elasticsearch-transport-5.0:javaagent:testStableSemconv"
77+
"elasticsearch:elasticsearch-transport-5.0:javaagent:testExperimental"
78+
"elasticsearch:elasticsearch-transport-5.3:javaagent:test"
79+
"elasticsearch:elasticsearch-transport-5.3:javaagent:testStableSemconv"
80+
"elasticsearch:elasticsearch-transport-5.3:javaagent:testExperimental"
81+
"elasticsearch:elasticsearch-transport-6.0:javaagent:elasticsearch6Test"
82+
"elasticsearch:elasticsearch-transport-6.0:javaagent:elasticsearch6TestStableSemconv"
83+
"elasticsearch:elasticsearch-transport-6.0:javaagent:elasticsearch6TestExperimental"
84+
"elasticsearch:elasticsearch-transport-6.0:javaagent:elasticsearch65Test"
85+
"elasticsearch:elasticsearch-transport-6.0:javaagent:elasticsearch65TestStableSemconv"
86+
"elasticsearch:elasticsearch-transport-6.0:javaagent:elasticsearch65TestExperimental"
87+
"elasticsearch:elasticsearch-transport-6.0:javaagent:elasticsearch7Test"
88+
"elasticsearch:elasticsearch-transport-6.0:javaagent:elasticsearch7TestStableSemconv"
89+
"elasticsearch:elasticsearch-transport-6.0:javaagent:elasticsearch7TestExperimental"
7590
)
7691

7792
readonly TELEMETRY_DIR_NAME=".telemetry"

instrumentation/elasticsearch/elasticsearch-transport-5.0/javaagent/build.gradle.kts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,25 @@ dependencies {
5151

5252
tasks {
5353
withType<Test>().configureEach {
54-
// TODO run tests both with and without experimental span attributes
55-
jvmArgs("-Dotel.instrumentation.elasticsearch.experimental-span-attributes=true")
5654
// required on jdk17
5755
jvmArgs("--add-opens=java.base/java.nio=ALL-UNNAMED")
5856
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
57+
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
58+
systemProperty("collectSpans", true)
5959
}
6060

6161
val testStableSemconv by registering(Test::class) {
6262
jvmArgs("-Dotel.semconv-stability.opt-in=database")
63+
systemProperty("metaDataConfig", "otel.semconv-stability.opt-in=database")
64+
}
65+
66+
val testExperimental by registering(Test::class) {
67+
systemProperty("testExperimental", true)
68+
jvmArgs("-Dotel.instrumentation.elasticsearch.experimental-span-attributes=true")
69+
systemProperty("metaDataConfig", "otel.instrumentation.elasticsearch.experimental-span-attributes=true")
6370
}
6471

6572
check {
66-
dependsOn(testStableSemconv)
73+
dependsOn(testStableSemconv, testExperimental)
6774
}
6875
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
description: >
2+
This instrumentation provides client spans for Elasticsearch transport client requests. Each call
3+
produces a span named after the Elasticsearch action, enriched with transport-specific attributes.
4+
configurations:
5+
- name: otel.instrumentation.elasticsearch.experimental-span-attributes
6+
description: Enable the capture of experimental span attributes.
7+
type: boolean
8+
default: false

instrumentation/elasticsearch/elasticsearch-transport-5.3/javaagent/build.gradle.kts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,26 @@ tasks {
6969
withType<Test>().configureEach {
7070
systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean)
7171

72-
// TODO run tests both with and without experimental span attributes
73-
jvmArgs("-Dotel.instrumentation.elasticsearch.experimental-span-attributes=true")
74-
7572
// required on jdk17
7673
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
7774
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
75+
76+
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
77+
systemProperty("collectSpans", true)
7878
}
7979

8080
val testStableSemconv by registering(Test::class) {
8181
jvmArgs("-Dotel.semconv-stability.opt-in=database,code")
82+
systemProperty("metaDataConfig", "otel.semconv-stability.opt-in=database")
83+
}
84+
85+
val testExperimental by registering(Test::class) {
86+
systemProperty("testExperimental", true)
87+
jvmArgs("-Dotel.instrumentation.elasticsearch.experimental-span-attributes=true")
88+
systemProperty("metaDataConfig", "otel.instrumentation.elasticsearch.experimental-span-attributes=true")
8289
}
8390

8491
check {
85-
dependsOn(testStableSemconv)
92+
dependsOn(testStableSemconv, testExperimental)
8693
}
8794
}

0 commit comments

Comments
 (0)