Package-level declarations

Types

Link copied to clipboard

Marks declarations that are internal to the Tracy library.

Link copied to clipboard

Intercepts OkHttp calls and traces them using the provided adapter.

Link copied to clipboard

Manager for setting up and managing OpenTelemetry tracing for Tracy.

Functions

Link copied to clipboard
fun configureOpenTelemetrySdk(exporterConfig: BaseExporterConfig, additionalResource: Resource = Resource.create( Attributes.of(AttributeKey.stringKey("service.name"), "unknown-service") )): OpenTelemetrySdk

Initializes the OpenTelemetrySdk using a provided BaseExporterConfig.

Link copied to clipboard
fun currentSpanContext(coroutineContext: CoroutineContext? = null): Context

Returns the active OpenTelemetry Context from the given CoroutineContext. Falls back to Context.current when no trace context is attached or when the resolved context is root.

Link copied to clipboard

Wraps the current OpenTelemetry Context as a CoroutineContext. Use this to preserve trace context across coroutines.

Link copied to clipboard

Instruments an OkHttpClient with OpenTelemetry tracing for LLM provider API calls, returning a cloned and patched instance of the provided OkHttpClient.

Link copied to clipboard
fun patchInterceptors(interceptors: List<Interceptor>, interceptor: Interceptor): List<Interceptor>

Appends a given interceptor into a copy of interceptors if the same instance/an instance of the same type isn't found.

Link copied to clipboard
fun <T> patchOpenAICompatibleClient(client: T, interceptor: Interceptor)

Patches the OpenAI-compatible client by injecting a custom interceptor into its internal HTTP client in-place.