OpenTelemetry Tracing
Latest stable Based on Bluetape4k release 1.11.0
Problem
Section titled “Problem”OpenTelemetry is an observability framework for cloud-native software. This module provides Kotlin extension functions and utilities that make it easier and more idiomatic to use OpenTelemetry on the JVM. This manual connects that purpose to the current build, source entry points, tests, configuration resources, and lifecycle evidence instead of duplicating the README feature list.
When to use
Section titled “When to use”Use bluetape4k-opentelemetry when the application needs client lifecycle, reconnect policy, backpressure, retries, and observability. Start with the source entry points below and confirm that their ownership and failure contracts match the calling component. Prefer a smaller standard-library or already-adopted module when it satisfies the same contract without another runtime boundary.
Coordinates
Section titled “Coordinates”dependencies { implementation(platform("io.github.bluetape4k:bluetape4k-dependencies:<version>")) implementation("io.github.bluetape4k:bluetape4k-opentelemetry")}Gradle project path: :bluetape4k-opentelemetry. Source directory: infra/opentelemetry.
Concepts
Section titled “Concepts”The first source-level concepts to inspect are ContextExtensions, OpenTelemetrySupport, AttributeKeySupport, AttributesSupport, CompletableResultCodeSupport, ContextCoroutineSupport, FlowSpanSupport, and SpanCoroutineSupport. File names are navigation anchors; read each declaration and its tests before treating it as a public contract.
Quick start
Section titled “Quick start”Add the coordinate above, refresh Gradle, and start from the smallest entry point that owns the required task. Open ContextExtensions first; it is a concrete source entry point for the module.
API by task
Section titled “API by task”| Entry point | What to verify |
|---|---|
ContextExtensions | Inspect this declaration’s constructors, functions, and ownership contract. |
OpenTelemetrySupport | Inspect this declaration’s constructors, functions, and ownership contract. |
AttributeKeySupport | Inspect this declaration’s constructors, functions, and ownership contract. |
AttributesSupport | Inspect this declaration’s constructors, functions, and ownership contract. |
CompletableResultCodeSupport | Inspect this declaration’s constructors, functions, and ownership contract. |
ContextCoroutineSupport | Inspect this declaration’s constructors, functions, and ownership contract. |
FlowSpanSupport | Inspect this declaration’s constructors, functions, and ownership contract. |
SpanCoroutineSupport | Inspect this declaration’s constructors, functions, and ownership contract. |
MeterProviderSupport | Inspect this declaration’s constructors, functions, and ownership contract. |
MetricExporterSupport | Inspect this declaration’s constructors, functions, and ownership contract. |
Patterns
Section titled “Patterns”The README evidence is organized around Features, Architecture Diagrams, Core Class Structure, Component Overview, Span Lifecycle in a Coroutine Context, Distributed Trace Propagation, Dependency, Key Features, 1. OpenTelemetry SDK Setup, and 2. Creating Tracers and Managing Spans. Use those topics as a navigation map, then confirm behavior in source and tests. Keep adoption narrow and connect owned resources to the caller lifecycle.
Integrations
Section titled “Integrations”The current build declares these integration edges:
implementation(platform(libs.spring.boot.dependencies))api(project(":bluetape4k-io"))implementation(project(":bluetape4k-netty"))api(libs.opentelemetry.api)api(libs.opentelemetry.sdk)api(libs.opentelemetry.extension.kotlin)compileOnly(libs.opentelemetry.sdk.extensions.autoconfigure)compileOnly(libs.opentelemetry.sdk.metrics)compileOnly(libs.opentelemetry.sdk.logs)compileOnly(libs.opentelemetry.sdk.trace)compileOnly(libs.opentelemetry.sdk.testing)compileOnly(libs.opentelemetry.exporter.logging)Treat compileOnly edges as caller-provided capabilities and verify runtime availability before using their APIs.
Configuration
Section titled “Configuration”No module-level configuration resource was found under src/main/resources. Configuration is supplied through constructors, builders, function arguments, or the integrating framework; confirm defaults in source.
Failures
Section titled “Failures”Failure semantics are defined by the linked entry points and tests, not inferred from the artifact name. Keep cancellation and timeout signals intact, close owned resources, and translate backend exceptions only at a boundary that can add a stable domain contract. Use the test anchors below to verify the exact behavior before adding retries or fallbacks.
Operations
Section titled “Operations”Track connection state, queue depth, retries, timeouts, remote errors, and graceful shutdown. Keep capacity, timeout, retry, and shutdown settings next to the component that owns the resource; avoid process-wide defaults that hide which caller accepted the trade-off.
Testing
Section titled “Testing”Run the module test task:
./gradlew :bluetape4k-opentelemetry:test --no-configuration-cacheRepresentative test anchors:
AbstractOtelTestRedactionAssertionsAttributeKeySupportTestAttributesSupportTestCoroutineSupportTestFlowSpanSupportTestSpanCoroutineSupportTestTracerWithSpanTest
Workshops
Section titled “Workshops”No dedicated workshop path is registered in the manual manifest. Use the module README and the representative tests above as runnable evidence.
Limitations
Section titled “Limitations”This page documents the repository state represented by the linked source and tests. It does not turn optional backends into application defaults or claim performance without a benchmark artifact. Re-check compatibility and lifecycle notes when the module version changes.
Release diagrams
Section titled “Release diagrams”These diagrams are loaded directly from README assets published with the 1.11.0 release and pinned to its immutable commit. They describe this manual’s released structure and runtime flows, not later Snapshot changes. Select a preview to open the SVG at the same release commit.
Core Class Structure diagram
Section titled “Core Class Structure diagram”Release README: infra/opentelemetry/README.md
Component Overview diagram
Section titled “Component Overview diagram”Release README: infra/opentelemetry/README.md
Distributed Trace Propagation diagram
Section titled “Distributed Trace Propagation diagram”Release README: infra/opentelemetry/README.md
Span Lifecycle in a Coroutine Context diagram
Section titled “Span Lifecycle in a Coroutine Context diagram”Release README: infra/opentelemetry/README.md



