Builder

org.typelevel.otel4s.sdk.trace.SdkTraces.AutoConfigured.Builder
sealed trait Builder[F[_]]

A builder of SdkTraces.

Attributes

Source
SdkTraces.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def addExporterConfigurer(configurer: Named[F, SpanExporter[F]]): Builder[F]

Adds the exporter configurer.

Adds the exporter configurer. Can be used to register exporters that aren't included in the SDK.

Value parameters

configurer

the configurer to add

Attributes

Example

Add the otel4s-sdk-exporter dependency to the build file:

libraryDependencies += "org.typelevel" %%% "otel4s-sdk-exporter" % "x.x.x"

and register the configurer manually:

import org.typelevel.otel4s.sdk.trace.SdkTraces
import org.typelevel.otel4s.sdk.exporter.otlp.trace.autoconfigure.OtlpSpanExporterAutoConfigure
SdkTraces.autoConfigured[IO](_.addExporterConfigurer(OtlpSpanExporterAutoConfigure[IO]))
Source
SdkTraces.scala

Adds the properties customizer.

Adds the properties customizer. Multiple customizers can be added, and they will be applied in the order they were added.

Value parameters

customizer

the customizer to add

Attributes

Source
SdkTraces.scala
def addPropertiesLoader(loader: F[Map[String, String]]): Builder[F]

Adds the properties loader.

Adds the properties loader. Multiple loaders will be added. The loaded properties will be merged with the default config. Loaded properties take precedence over the default ones.

Value parameters

loader

the additional loader to add

Attributes

Source
SdkTraces.scala
def addResourceCustomizer(customizer: () => TelemetryResource): Builder[F]

Adds the telemetry resource customizer.

Adds the telemetry resource customizer. Multiple customizers can be added, and they will be applied in the order they were added.

Value parameters

customizer

the customizer to add

Attributes

Source
SdkTraces.scala
def addSamplerConfigurer(configurer: Named[F, Sampler]): Builder[F]

Adds the sampler configurer.

Adds the sampler configurer. Can be used to register samplers that aren't included in the SDK.

Value parameters

configurer

the configurer to add

Attributes

Source
SdkTraces.scala

Adds the text map propagator configurer.

Adds the text map propagator configurer. Can be used to register propagators that aren't included in the SDK.

Value parameters

configurer

the configurer to add

Attributes

Source
SdkTraces.scala
def addTracerProviderCustomizer(customizer: () => Builder[F]): Builder[F]

Adds the tracer provider builder customizer.

Adds the tracer provider builder customizer. Multiple customizers can be added, and they will be applied in the order they were added.

Value parameters

customizer

the customizer to add

Attributes

Source
SdkTraces.scala
def build: Resource[F, SdkTraces[F]]

Creates SdkTraces using the configuration of this builder.

Creates SdkTraces using the configuration of this builder.

Attributes

Source
SdkTraces.scala
def withConfig(config: Config): Builder[F]

Sets the given config to use when resolving properties.

Sets the given config to use when resolving properties.

Value parameters

config

the config to use

Attributes

Note

addPropertiesLoader and addPropertiesCustomizer will have no effect if the custom config is provided.

Source
SdkTraces.scala