Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
185 changes: 184 additions & 1 deletion docs/instrumentation-list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2759,13 +2759,21 @@ libraries:
- name: couchbase-2.0
description: |
This instrumentation enables database client spans and database client metrics for Couchbase 2.0 operations. It automatically traces key-value operations (get, upsert, replace, remove), view queries, N1QL queries, and cluster management operations.
semantic_conventions:
- DATABASE_CLIENT_SPANS
- DATABASE_CLIENT_METRICS
library_link: https://github.com/couchbase/couchbase-java-client
source_path: instrumentation/couchbase/couchbase-2.0
scope:
name: io.opentelemetry.couchbase-2.0
target_versions:
javaagent:
- com.couchbase.client:java-client:[2,3)
configurations:
- name: otel.instrumentation.common.db-statement-sanitizer.enabled
description: Enables statement sanitization for database queries.
type: boolean
default: true
telemetry:
- when: default
spans:
Expand Down Expand Up @@ -2804,6 +2812,9 @@ libraries:
- name: couchbase-2.6
description: |
This instrumentation enables database client spans and database client metrics for Couchbase 2.6 operations. It automatically traces key-value operations (get, upsert, replace, remove), view queries, N1QL queries, and cluster management operations.
semantic_conventions:
- DATABASE_CLIENT_SPANS
- DATABASE_CLIENT_METRICS
library_link: https://github.com/couchbase/couchbase-java-client
source_path: instrumentation/couchbase/couchbase-2.6
scope:
Expand All @@ -2817,6 +2828,10 @@ libraries:
Enables experimental span attributes `couchbase.operation_id` and `couchbase.local.address`. Different operation types receive different experimental attributes.
type: boolean
default: false
- name: otel.instrumentation.common.db-statement-sanitizer.enabled
description: Enables statement sanitization for database queries.
type: boolean
default: true
telemetry:
- when: default
spans:
Expand Down Expand Up @@ -2893,33 +2908,201 @@ libraries:
- name: couchbase-3.1
description: |
Couchbase instrumentation is owned by the Couchbase project for versions 3+. This instrumentation automatically configures the instrumentation provided by the Couchbase library.
semantic_conventions:
- DATABASE_CLIENT_SPANS
library_link: https://github.com/couchbase/couchbase-java-client
features:
- AUTO_INSTRUMENTATION_SHIM
source_path: instrumentation/couchbase/couchbase-3.1
scope:
name: io.opentelemetry.couchbase-3.1
target_versions:
javaagent:
- com.couchbase.client:java-client:[3.1,3.1.6)
telemetry:
- when: default
spans:
- span_kind: INTERNAL
attributes:
- name: db.couchbase.collection
type: STRING
- name: db.couchbase.local_id
type: STRING
- name: db.couchbase.operation_id
type: LONG
- name: db.couchbase.scope
type: STRING
- name: db.couchbase.server_duration
type: LONG
- name: db.couchbase.service
type: STRING
- name: db.name
type: STRING
- name: db.operation
type: STRING
- name: db.system
type: STRING
- name: net.host.name
type: STRING
- name: net.host.port
type: LONG
- name: net.peer.name
type: STRING
- name: net.peer.port
type: LONG
- name: net.transport
type: STRING
- name: couchbase-3.1.6
description: |
Couchbase instrumentation is owned by the Couchbase project for versions 3+. This instrumentation automatically configures the instrumentation provided by the Couchbase library.
semantic_conventions:
- DATABASE_CLIENT_SPANS
library_link: https://github.com/couchbase/couchbase-java-client
features:
- AUTO_INSTRUMENTATION_SHIM
source_path: instrumentation/couchbase/couchbase-3.1.6
scope:
name: io.opentelemetry.couchbase-3.1.6
target_versions:
javaagent:
- com.couchbase.client:java-client:[3.1.6,3.2.0)
telemetry:
- when: default
spans:
- span_kind: INTERNAL
attributes:
- name: db.couchbase.collection
type: STRING
- name: db.couchbase.local_id
type: STRING
- name: db.couchbase.operation_id
type: LONG
- name: db.couchbase.retries
type: LONG
- name: db.couchbase.scope
type: STRING
- name: db.couchbase.server_duration
type: LONG
- name: db.couchbase.service
type: STRING
- name: db.name
type: STRING
- name: db.operation
type: STRING
- name: db.system
type: STRING
- name: net.host.name
type: STRING
- name: net.host.port
type: LONG
- name: net.peer.name
type: STRING
- name: net.peer.port
type: LONG
- name: net.transport
type: STRING
- name: couchbase-3.2
description: |
Couchbase instrumentation is owned by the Couchbase project for versions 3+. This instrumentation automatically configures the instrumentation provided by the Couchbase library.
semantic_conventions:
- DATABASE_CLIENT_SPANS
library_link: https://github.com/couchbase/couchbase-java-client
features:
- AUTO_INSTRUMENTATION_SHIM
source_path: instrumentation/couchbase/couchbase-3.2
scope:
name: io.opentelemetry.couchbase-3.2
target_versions:
javaagent:
- com.couchbase.client:java-client:[3.2.0,)
- com.couchbase.client:java-client:[3.2.0,3.4.0)
telemetry:
- when: default
spans:
- span_kind: INTERNAL
attributes:
- name: db.couchbase.collection
type: STRING
- name: db.couchbase.document_id
type: STRING
- name: db.couchbase.local_id
type: STRING
- name: db.couchbase.operation_id
type: LONG
- name: db.couchbase.retries
type: LONG
- name: db.couchbase.scope
type: STRING
- name: db.couchbase.server_duration
type: LONG
- name: db.couchbase.service
type: STRING
- name: db.name
type: STRING
- name: db.operation
type: STRING
- name: db.system
type: STRING
- name: net.host.name
type: STRING
- name: net.host.port
type: LONG
- name: net.peer.name
type: STRING
- name: net.peer.port
type: LONG
- name: net.transport
type: STRING
- name: couchbase-3.4
description: |
Couchbase instrumentation is owned by the Couchbase project for versions 3+. This instrumentation automatically configures the instrumentation provided by the Couchbase library.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for 3.2 the description was changed

semantic_conventions:
- DATABASE_CLIENT_SPANS
library_link: https://github.com/couchbase/couchbase-java-client
features:
- AUTO_INSTRUMENTATION_SHIM
source_path: instrumentation/couchbase/couchbase-3.4
scope:
name: io.opentelemetry.couchbase-3.4
target_versions:
javaagent:
- com.couchbase.client:java-client:[3.4.0,)
telemetry:
- when: default
spans:
- span_kind: CLIENT
attributes:
- name: db.couchbase.collection
type: STRING
- name: db.couchbase.document_id
type: STRING
- name: db.couchbase.local_id
type: STRING
- name: db.couchbase.operation_id
type: LONG
- name: db.couchbase.retries
type: LONG
- name: db.couchbase.scope
type: STRING
- name: db.couchbase.server_duration
type: LONG
- name: db.couchbase.service
type: STRING
- name: db.name
type: STRING
- name: db.operation
type: STRING
- name: db.system
type: STRING
- name: net.host.name
type: STRING
- name: net.host.port
type: LONG
- name: net.peer.name
type: STRING
- name: net.peer.port
type: LONG
- name: net.transport
type: STRING
dropwizard:
- name: dropwizard-metrics-4.0
description: |
Expand Down
4 changes: 4 additions & 0 deletions instrumentation-docs/instrumentations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ readonly INSTRUMENTATIONS=(
"couchbase:couchbase-2.6:javaagent:test"
"couchbase:couchbase-2.6:javaagent:testExperimental"
"couchbase:couchbase-2.6:javaagent:testStableSemconv"
"couchbase:couchbase-3.1:javaagent:test"
"couchbase:couchbase-3.1.6:javaagent:test"
"couchbase:couchbase-3.2:javaagent:test"
"couchbase:couchbase-3.4:javaagent:test"
"dropwizard:dropwizard-views-0.7:javaagent:test"
"elasticsearch:elasticsearch-api-client-7.16:javaagent:test"
"elasticsearch:elasticsearch-api-client-7.16:javaagent:testStableSemconv"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,56 @@

package io.opentelemetry.instrumentation.docs.parsers;

import static java.util.Collections.emptySet;
import static java.util.Collections.singleton;
import static java.util.Map.entry;

import java.util.Map;
import java.util.Set;

class TelemetryParser {

// Key is the scope of the module being analyzed, value is a set of additional allowed scopes.
private static final Map<String, Set<String>> scopeAllowList =
Map.of(
// armeria-grpc uses grpc-1.6 instrumenter.
"io.opentelemetry.armeria-grpc-1.14", Set.of("io.opentelemetry.grpc-1.6"),
// couchbase-2.6 extends couchbase-2.0 instrumentation with more attributes.
"io.opentelemetry.couchbase-2.6", Set.of("io.opentelemetry.couchbase-2.0"),
// elasticsearch-rest-7.0 extends elasticsearch-api-client-7.16 with more attributes.
"io.opentelemetry.elasticsearch-api-client-7.16",
Set.of("io.opentelemetry.elasticsearch-rest-7.0"),
// jaxrs instrumentations add attributes to the jaxrs-2.0-annotations scope.
"io.opentelemetry.jaxrs-2.0-cxf-3.2", Set.of("io.opentelemetry.jaxrs-2.0-annotations"),
"io.opentelemetry.jaxrs-2.0-jersey-2.0", Set.of("io.opentelemetry.jaxrs-2.0-annotations"),
"io.opentelemetry.jaxrs-2.0-resteasy-3.0",
Set.of("io.opentelemetry.jaxrs-2.0-annotations"),
"io.opentelemetry.jaxrs-2.0-resteasy-3.1",
Set.of("io.opentelemetry.jaxrs-2.0-annotations"),
"io.opentelemetry.jaxrs-3.0-jersey-3.0", Set.of("io.opentelemetry.jaxrs-3.0-annotations"),
"io.opentelemetry.jaxrs-3.0-resteasy-6.0",
Set.of("io.opentelemetry.jaxrs-3.0-annotations"));
private static final Map<String, Set<String>> scopeAllowList;

static {
scopeAllowList =
Map.ofEntries(
// armeria-grpc uses grpc-1.6 instrumenter.
entry("io.opentelemetry.armeria-grpc-1.14", singleton("io.opentelemetry.grpc-1.6")),
// couchbase-2.6 extends couchbase-2.0 instrumentation with more attributes.
entry("io.opentelemetry.couchbase-2.6", singleton("io.opentelemetry.couchbase-2.0")),
// elasticsearch-rest-7.0 extends elasticsearch-api-client-7.16 with more attributes.
entry(
"io.opentelemetry.elasticsearch-api-client-7.16",
singleton("io.opentelemetry.elasticsearch-rest-7.0")),
// jaxrs instrumentations add attributes to the jaxrs-2.0-annotations scope.
entry(
"io.opentelemetry.jaxrs-2.0-cxf-3.2",
singleton("io.opentelemetry.jaxrs-2.0-annotations")),
entry(
"io.opentelemetry.jaxrs-2.0-jersey-2.0",
singleton("io.opentelemetry.jaxrs-2.0-annotations")),
entry(
"io.opentelemetry.jaxrs-2.0-resteasy-3.0",
singleton("io.opentelemetry.jaxrs-2.0-annotations")),
entry(
"io.opentelemetry.jaxrs-2.0-resteasy-3.1",
singleton("io.opentelemetry.jaxrs-2.0-annotations")),
entry(
"io.opentelemetry.jaxrs-3.0-jersey-3.0",
singleton("io.opentelemetry.jaxrs-3.0-annotations")),
entry(
"io.opentelemetry.jaxrs-3.0-resteasy-6.0",
singleton("io.opentelemetry.jaxrs-3.0-annotations")),
// couchbase-3.x instrumentations are auto-instrumentation shims
entry(
"io.opentelemetry.couchbase-3.1",
singleton("io.opentelemetry.javaagent.couchbase-3.1")),
entry("io.opentelemetry.couchbase-3.1.6", singleton("com.couchbase.client.jvm")),
entry("io.opentelemetry.couchbase-3.2", singleton("com.couchbase.client.jvm")),
entry("io.opentelemetry.couchbase-3.4", singleton("com.couchbase.client.jvm")));
}

/**
* Checks if the given telemetry scope is valid for the specified module scope.
Expand All @@ -45,7 +70,7 @@ class TelemetryParser {
*/
static boolean scopeIsValid(String telemetryScope, String moduleScope) {
return telemetryScope.equals(moduleScope)
|| scopeAllowList.getOrDefault(moduleScope, Set.of()).contains(telemetryScope);
|| scopeAllowList.getOrDefault(moduleScope, emptySet()).contains(telemetryScope);
}

private TelemetryParser() {}
Expand Down
8 changes: 8 additions & 0 deletions instrumentation/couchbase/couchbase-2.0/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@ description: >
This instrumentation enables database client spans and database client metrics for Couchbase 2.0
operations. It automatically traces key-value operations (get, upsert, replace, remove), view
queries, N1QL queries, and cluster management operations.
semantic_conventions:
- DATABASE_CLIENT_SPANS
- DATABASE_CLIENT_METRICS
library_link: https://github.com/couchbase/couchbase-java-client
configurations:
- name: otel.instrumentation.common.db-statement-sanitizer.enabled
description: Enables statement sanitization for database queries.
type: boolean
default: true
7 changes: 7 additions & 0 deletions instrumentation/couchbase/couchbase-2.6/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ description: >
This instrumentation enables database client spans and database client metrics for Couchbase 2.6
operations. It automatically traces key-value operations (get, upsert, replace, remove), view
queries, N1QL queries, and cluster management operations.
semantic_conventions:
- DATABASE_CLIENT_SPANS
- DATABASE_CLIENT_METRICS
library_link: https://github.com/couchbase/couchbase-java-client
configurations:
- name: otel.instrumentation.couchbase.experimental-span-attributes
Expand All @@ -10,3 +13,7 @@ configurations:
Different operation types receive different experimental attributes.
type: boolean
default: false
- name: otel.instrumentation.common.db-statement-sanitizer.enabled
description: Enables statement sanitization for database queries.
type: boolean
default: true
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,6 @@ dependencies {
tasks {
withType<Test>().configureEach {
usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)
}

val testStableSemconv by registering(Test::class) {
testClassesDirs = sourceSets.test.get().output.classesDirs
classpath = sourceSets.test.get().runtimeClasspath

jvmArgs("-Dotel.semconv-stability.opt-in=database")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i didn't think these tests were necessary since we don't own the instrumentation

}

check {
dependsOn(testStableSemconv)
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
}
}
4 changes: 4 additions & 0 deletions instrumentation/couchbase/couchbase-3.1.6/metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
description: >
Couchbase instrumentation is owned by the Couchbase project for versions 3+. This instrumentation
automatically configures the instrumentation provided by the Couchbase library.
semantic_conventions:
- DATABASE_CLIENT_SPANS
library_link: https://github.com/couchbase/couchbase-java-client
features:
- AUTO_INSTRUMENTATION_SHIM
Loading
Loading