OpenTelemetry OTLP tracer: real, exportable distributed tracing behind the
ITracer port. Spans are exported over OTLP/HTTP (protobuf) to any
OpenTelemetry collector — SigNoz, Grafana Tempo, Jaeger, Honeycomb, or a
Datadog OTel endpoint. Only the endpoint changes; there is no backend-specific
code here (that is the whole point of OTLP).
Transport is OTLP/HTTP protobuf via the okhttp sender bundled with
opentelemetry-exporter-otlp. gRPC is intentionally not bundled (it would add
grpc-netty to every app's classpath) — use :protocol :http/protobuf.
Context propagation uses W3C traceparent, so nested with-span calls and
spans started on the current thread become parent/child automatically. The
span handle returned by start-span! is the OpenTelemetry Span.
OpenTelemetry OTLP tracer: real, exportable distributed tracing behind the `ITracer` port. Spans are exported over OTLP/HTTP (protobuf) to any OpenTelemetry collector — SigNoz, Grafana Tempo, Jaeger, Honeycomb, or a Datadog OTel endpoint. Only the endpoint changes; there is no backend-specific code here (that is the whole point of OTLP). Transport is OTLP/HTTP protobuf via the okhttp sender bundled with `opentelemetry-exporter-otlp`. gRPC is intentionally not bundled (it would add grpc-netty to every app's classpath) — use `:protocol :http/protobuf`. Context propagation uses W3C `traceparent`, so nested `with-span` calls and spans started on the current thread become parent/child automatically. The span handle returned by `start-span!` is the OpenTelemetry `Span`.
(->attributes m)Convert a Clojure map into OpenTelemetry Attributes. Keys become strings;
values are typed by class (string/long/double/boolean), anything else is
stringified. nil or empty yields empty Attributes.
Convert a Clojure map into OpenTelemetry `Attributes`. Keys become strings; values are typed by class (string/long/double/boolean), anything else is stringified. `nil` or empty yields empty Attributes.
(build-sdk {:keys [endpoint service-name timeout-ms headers]
:or {endpoint "http://localhost:4318"
service-name "wagoe"
timeout-ms 10000}})Build an OpenTelemetrySdk with a batch OTLP/HTTP span exporter. Returns the
sdk (hold it to flush/shutdown on halt).
Build an `OpenTelemetrySdk` with a batch OTLP/HTTP span exporter. Returns the sdk (hold it to flush/shutdown on halt).
(create-tracing-component)(create-tracing-component config)Build the OTLP tracer component (wiring entry point; mirrors the no-op /
logging adapters). Validates config, stands up the OpenTelemetry SDK, and
returns an OtlpTracer.
Build the OTLP tracer component (wiring entry point; mirrors the no-op / logging adapters). Validates config, stands up the OpenTelemetry SDK, and returns an `OtlpTracer`.
(sdk-from-processor processor service-name)Build an OpenTelemetrySdk around an arbitrary SpanProcessor with a
W3C-propagating tracer provider tagged service.name. Production wraps a
batch OTLP exporter; tests inject a simple in-memory processor.
Build an `OpenTelemetrySdk` around an arbitrary `SpanProcessor` with a W3C-propagating tracer provider tagged `service.name`. Production wraps a batch OTLP exporter; tests inject a simple in-memory processor.
(shutdown! tracer)(shutdown! tracer timeout-ms)Flush + shut down the tracer's SDK (call on Integrant halt). Blocks up to
timeout-ms for the batch processor to drain.
Flush + shut down the tracer's SDK (call on Integrant halt). Blocks up to `timeout-ms` for the batch processor to drain.
(tracer-from-sdk sdk)Wrap a built OpenTelemetrySdk as an OtlpTracer.
Wrap a built `OpenTelemetrySdk` as an `OtlpTracer`.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |