Skip to content

Commit 04d2d75

Browse files
committed
KCBC-198 Support configuring observabilitySemanticConventions via code
Motivation ---------- Prior to this change, a user could configure the convention via the `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable or the `observabilitySemanticConventions` connection string parameter. For parity with other JVM SDKs, we also want to support configuration via code. Change-Id: Ibcfc41a0f5383f6df3f39f91c4c304989de5c292 Reviewed-on: https://review.couchbase.org/c/couchbase-jvm-clients/+/239740 Tested-by: Build Bot <[email protected]> Reviewed-by: Graham Pople <[email protected]> (cherry picked from commit 9182b27) Reviewed-on: https://review.couchbase.org/c/couchbase-jvm-clients/+/239895 Reviewed-by: David Nault <[email protected]>
1 parent 28ce6ba commit 04d2d75

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

kotlin-client/src/main/kotlin/com/couchbase/client/kotlin/env/dsl/ClusterEnvironmentDslBuilder.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package com.couchbase.client.kotlin.env.dsl
1919
import com.couchbase.client.core.cnc.EventBus
2020
import com.couchbase.client.core.cnc.Meter
2121
import com.couchbase.client.core.cnc.RequestTracer
22+
import com.couchbase.client.core.cnc.tracing.ObservabilitySemanticConvention
2223
import com.couchbase.client.core.encryption.CryptoManager
2324
import com.couchbase.client.core.env.CoreEnvironment
2425
import com.couchbase.client.core.env.CoreEnvironment.DEFAULT_DISABLE_APP_TELEMETRY
@@ -193,5 +194,11 @@ public class ClusterEnvironmentDslBuilder {
193194
public var disableAppTelemetry: Boolean
194195
by observable(DEFAULT_DISABLE_APP_TELEMETRY) { _, _, it -> wrapped.disableAppTelemetry(it) }
195196

197+
/**
198+
* @see CoreEnvironment.Builder.observabilitySemanticConventions
199+
*/
200+
public var observabilitySemanticConventions: List<ObservabilitySemanticConvention>
201+
by observable(listOf()) { _, _, it -> wrapped.observabilitySemanticConventions(it) }
202+
196203
internal fun toCore() = wrapped
197204
}

0 commit comments

Comments
 (0)