From 5dc10a4a4579043dec29d72c43835050cc73a5d8 Mon Sep 17 00:00:00 2001 From: Maksym Ochenashko Date: Wed, 1 Jan 2025 22:50:08 +0200 Subject: [PATCH] sdk: propagate `Env` --- .../otel4s/sdk/OpenTelemetrySdk.scala | 91 +++++-------------- .../otel4s/sdk/autoconfigure/Config.scala | 4 +- .../otel4s/sdk/metrics/SdkMetrics.scala | 51 +++-------- .../otel4s/sdk/trace/SdkTraces.scala | 63 ++++--------- 4 files changed, 60 insertions(+), 149 deletions(-) diff --git a/sdk/all/src/main/scala/org/typelevel/otel4s/sdk/OpenTelemetrySdk.scala b/sdk/all/src/main/scala/org/typelevel/otel4s/sdk/OpenTelemetrySdk.scala index 398365441..94d45c4d9 100644 --- a/sdk/all/src/main/scala/org/typelevel/otel4s/sdk/OpenTelemetrySdk.scala +++ b/sdk/all/src/main/scala/org/typelevel/otel4s/sdk/OpenTelemetrySdk.scala @@ -21,6 +21,7 @@ import cats.Parallel import cats.effect.Async import cats.effect.Resource import cats.effect.std.Console +import cats.effect.std.Env import cats.effect.std.Random import cats.effect.std.SystemProperties import cats.syntax.apply._ @@ -87,7 +88,7 @@ object OpenTelemetrySdk { * @param customize * a function for customizing the auto-configured SDK builder */ - def autoConfigured[F[_]: Async: Parallel: SystemProperties: Console: LocalContextProvider]( + def autoConfigured[F[_]: Async: Parallel: Env: SystemProperties: Console: LocalContextProvider]( customize: AutoConfigured.Builder[F] => AutoConfigured.Builder[F] = (a: AutoConfigured.Builder[F]) => a ): Resource[F, AutoConfigured[F]] = customize(AutoConfigured.builder[F]).build @@ -157,9 +158,7 @@ object OpenTelemetrySdk { * @param customizer * the customizer to add */ - def addPropertiesCustomizer( - customizer: Config => Map[String, String] - ): Builder[F] + def addPropertiesCustomizer(customizer: Config => Map[String, String]): Builder[F] /** Adds the meter provider builder customizer. Multiple customizers can be added, and they will be applied in the * order they were added. @@ -167,9 +166,7 @@ object OpenTelemetrySdk { * @param customizer * the customizer to add */ - def addMeterProviderCustomizer( - customizer: Customizer[SdkMeterProvider.Builder[F]] - ): Builder[F] + def addMeterProviderCustomizer(customizer: Customizer[SdkMeterProvider.Builder[F]]): Builder[F] /** Adds the tracer provider builder customizer. Multiple customizers can be added, and they will be applied in * the order they were added. @@ -177,9 +174,7 @@ object OpenTelemetrySdk { * @param customizer * the customizer to add */ - def addTracerProviderCustomizer( - customizer: Customizer[SdkTracerProvider.Builder[F]] - ): Builder[F] + def addTracerProviderCustomizer(customizer: Customizer[SdkTracerProvider.Builder[F]]): Builder[F] /** Adds the telemetry resource customizer. Multiple customizers can be added, and they will be applied in the * order they were added. @@ -187,9 +182,7 @@ object OpenTelemetrySdk { * @param customizer * the customizer to add */ - def addResourceCustomizer( - customizer: Customizer[TelemetryResource] - ): Builder[F] + def addResourceCustomizer(customizer: Customizer[TelemetryResource]): Builder[F] /** Adds the telemetry resource detector. Multiple detectors can be added, and the detected telemetry resources * will be merged. @@ -204,9 +197,7 @@ object OpenTelemetrySdk { * @param detector * the detector to add */ - def addResourceDetector( - detector: TelemetryResourceDetector[F] - ): Builder[F] + def addResourceDetector(detector: TelemetryResourceDetector[F]): Builder[F] /** Adds both metric and span exporter configurers. Can be used to register exporters that aren't included in the * SDK. @@ -227,9 +218,7 @@ object OpenTelemetrySdk { * @param configurer * the configurer to add */ - def addExportersConfigurer( - configurer: ExportersAutoConfigure[F] - ): Builder[F] + def addExportersConfigurer(configurer: ExportersAutoConfigure[F]): Builder[F] /** Adds the exporter configurer. Can be used to register exporters that aren't included in the SDK. * @@ -249,9 +238,7 @@ object OpenTelemetrySdk { * @param configurer * the configurer to add */ - def addMetricExporterConfigurer( - configurer: AutoConfigure.Named[F, MetricExporter[F]] - ): Builder[F] + def addMetricExporterConfigurer(configurer: AutoConfigure.Named[F, MetricExporter[F]]): Builder[F] /** Adds the exporter configurer. Can be used to register exporters that aren't included in the SDK. * @@ -271,9 +258,7 @@ object OpenTelemetrySdk { * @param configurer * the configurer to add */ - def addSpanExporterConfigurer( - configurer: AutoConfigure.Named[F, SpanExporter[F]] - ): Builder[F] + def addSpanExporterConfigurer(configurer: AutoConfigure.Named[F, SpanExporter[F]]): Builder[F] /** Adds the sampler configurer. Can be used to register samplers that aren't included in the SDK. * @@ -287,9 +272,7 @@ object OpenTelemetrySdk { * @param configurer * the configurer to add */ - def addTextMapPropagatorConfigurer( - configurer: AutoConfigure.Named[F, TextMapPropagator[Context]] - ): Builder[F] + def addTextMapPropagatorConfigurer(configurer: AutoConfigure.Named[F, TextMapPropagator[Context]]): Builder[F] /** Creates [[OpenTelemetrySdk]] using the configuration of this builder. */ @@ -298,7 +281,7 @@ object OpenTelemetrySdk { /** Creates a [[Builder]]. */ - def builder[F[_]: Async: Parallel: SystemProperties: Console: LocalContextProvider]: Builder[F] = + def builder[F[_]: Async: Parallel: Env: SystemProperties: Console: LocalContextProvider]: Builder[F] = BuilderImpl( customConfig = None, propertiesLoader = Async[F].pure(Map.empty), @@ -313,7 +296,7 @@ object OpenTelemetrySdk { textMapPropagatorConfigurers = Set.empty ) - private final case class BuilderImpl[F[_]: Async: Parallel: SystemProperties: Console: LocalContextProvider]( + private final case class BuilderImpl[F[_]: Async: Parallel: Env: SystemProperties: Console: LocalContextProvider]( customConfig: Option[Config], propertiesLoader: F[Map[String, String]], propertiesCustomizers: List[Config => Map[String, String]], @@ -321,73 +304,49 @@ object OpenTelemetrySdk { meterProviderCustomizer: Customizer[SdkMeterProvider.Builder[F]], tracerProviderCustomizer: Customizer[SdkTracerProvider.Builder[F]], resourceDetectors: Set[TelemetryResourceDetector[F]], - metricExporterConfigurers: Set[ - AutoConfigure.Named[F, MetricExporter[F]] - ], + metricExporterConfigurers: Set[AutoConfigure.Named[F, MetricExporter[F]]], spanExporterConfigurers: Set[AutoConfigure.Named[F, SpanExporter[F]]], samplerConfigurers: Set[AutoConfigure.Named[F, Sampler[F]]], - textMapPropagatorConfigurers: Set[ - AutoConfigure.Named[F, TextMapPropagator[Context]] - ] + textMapPropagatorConfigurers: Set[AutoConfigure.Named[F, TextMapPropagator[Context]]] ) extends Builder[F] { def withConfig(config: Config): Builder[F] = copy(customConfig = Some(config)) - def addPropertiesLoader( - loader: F[Map[String, String]] - ): Builder[F] = + def addPropertiesLoader(loader: F[Map[String, String]]): Builder[F] = copy(propertiesLoader = (this.propertiesLoader, loader).mapN(_ ++ _)) - def addPropertiesCustomizer( - customizer: Config => Map[String, String] - ): Builder[F] = + def addPropertiesCustomizer(customizer: Config => Map[String, String]): Builder[F] = copy(propertiesCustomizers = this.propertiesCustomizers :+ customizer) - def addResourceCustomizer( - customizer: Customizer[TelemetryResource] - ): Builder[F] = + def addResourceCustomizer(customizer: Customizer[TelemetryResource]): Builder[F] = copy(resourceCustomizer = merge(this.resourceCustomizer, customizer)) - def addMeterProviderCustomizer( - customizer: Customizer[SdkMeterProvider.Builder[F]] - ): Builder[F] = + def addMeterProviderCustomizer(customizer: Customizer[SdkMeterProvider.Builder[F]]): Builder[F] = copy(meterProviderCustomizer = merge(this.meterProviderCustomizer, customizer)) - def addTracerProviderCustomizer( - customizer: Customizer[SdkTracerProvider.Builder[F]] - ): Builder[F] = + def addTracerProviderCustomizer(customizer: Customizer[SdkTracerProvider.Builder[F]]): Builder[F] = copy(tracerProviderCustomizer = merge(this.tracerProviderCustomizer, customizer)) - def addResourceDetector( - detector: TelemetryResourceDetector[F] - ): Builder[F] = + def addResourceDetector(detector: TelemetryResourceDetector[F]): Builder[F] = copy(resourceDetectors = this.resourceDetectors + detector) - def addExportersConfigurer( - configurer: ExportersAutoConfigure[F] - ): Builder[F] = + def addExportersConfigurer(configurer: ExportersAutoConfigure[F]): Builder[F] = copy( metricExporterConfigurers = metricExporterConfigurers + configurer.metricExporterAutoConfigure, spanExporterConfigurers = spanExporterConfigurers + configurer.spanExporterAutoConfigure ) - def addMetricExporterConfigurer( - configurer: AutoConfigure.Named[F, MetricExporter[F]] - ): Builder[F] = + def addMetricExporterConfigurer(configurer: AutoConfigure.Named[F, MetricExporter[F]]): Builder[F] = copy(metricExporterConfigurers = metricExporterConfigurers + configurer) - def addSpanExporterConfigurer( - configurer: AutoConfigure.Named[F, SpanExporter[F]] - ): Builder[F] = + def addSpanExporterConfigurer(configurer: AutoConfigure.Named[F, SpanExporter[F]]): Builder[F] = copy(spanExporterConfigurers = spanExporterConfigurers + configurer) def addSamplerConfigurer(configurer: AutoConfigure.Named[F, Sampler[F]]): Builder[F] = copy(samplerConfigurers = samplerConfigurers + configurer) - def addTextMapPropagatorConfigurer( - configurer: AutoConfigure.Named[F, TextMapPropagator[Context]] - ): Builder[F] = + def addTextMapPropagatorConfigurer(configurer: AutoConfigure.Named[F, TextMapPropagator[Context]]): Builder[F] = copy(textMapPropagatorConfigurers = textMapPropagatorConfigurers + configurer) def build: Resource[F, AutoConfigured[F]] = { diff --git a/sdk/common/shared/src/main/scala/org/typelevel/otel4s/sdk/autoconfigure/Config.scala b/sdk/common/shared/src/main/scala/org/typelevel/otel4s/sdk/autoconfigure/Config.scala index 76c0996b2..f1eae39f5 100644 --- a/sdk/common/shared/src/main/scala/org/typelevel/otel4s/sdk/autoconfigure/Config.scala +++ b/sdk/common/shared/src/main/scala/org/typelevel/otel4s/sdk/autoconfigure/Config.scala @@ -278,9 +278,9 @@ object Config { * @param default * the default properties */ - def load[F[_]: Sync](default: Map[String, String]): F[Config] = + def load[F[_]: Sync: Env](default: Map[String, String]): F[Config] = for { - envVars <- Env.make[F].entries + envVars <- Env[F].entries systemProps <- Sync[F].delay(sys.props.toMap) } yield apply(systemProps, envVars.toMap, default) diff --git a/sdk/metrics/src/main/scala/org/typelevel/otel4s/sdk/metrics/SdkMetrics.scala b/sdk/metrics/src/main/scala/org/typelevel/otel4s/sdk/metrics/SdkMetrics.scala index 4ff09b973..c0e96a79d 100644 --- a/sdk/metrics/src/main/scala/org/typelevel/otel4s/sdk/metrics/SdkMetrics.scala +++ b/sdk/metrics/src/main/scala/org/typelevel/otel4s/sdk/metrics/SdkMetrics.scala @@ -20,6 +20,7 @@ import cats.Applicative import cats.effect.Async import cats.effect.Resource import cats.effect.std.Console +import cats.effect.std.Env import cats.effect.std.Random import cats.effect.std.SystemProperties import cats.mtl.Ask @@ -71,7 +72,7 @@ object SdkMetrics { * @param customize * a function for customizing the auto-configured SDK builder */ - def autoConfigured[F[_]: Async: SystemProperties: Console]( + def autoConfigured[F[_]: Async: Env: SystemProperties: Console]( customize: AutoConfigured.Builder[F] => AutoConfigured.Builder[F] = (a: AutoConfigured.Builder[F]) => a ): Resource[F, SdkMetrics[F]] = customize(AutoConfigured.builder[F]).build @@ -112,9 +113,7 @@ object SdkMetrics { * @param customizer * the customizer to add */ - def addPropertiesCustomizer( - customizer: Config => Map[String, String] - ): Builder[F] + def addPropertiesCustomizer(customizer: Config => Map[String, String]): Builder[F] /** Adds the meter provider builder customizer. Multiple customizers can be added, and they will be applied in the * order they were added. @@ -122,9 +121,7 @@ object SdkMetrics { * @param customizer * the customizer to add */ - def addMeterProviderCustomizer( - customizer: Customizer[SdkMeterProvider.Builder[F]] - ): Builder[F] + def addMeterProviderCustomizer(customizer: Customizer[SdkMeterProvider.Builder[F]]): Builder[F] /** Adds the telemetry resource customizer. Multiple customizers can be added, and they will be applied in the * order they were added. @@ -132,9 +129,7 @@ object SdkMetrics { * @param customizer * the customizer to add */ - def addResourceCustomizer( - customizer: Customizer[TelemetryResource] - ): Builder[F] + def addResourceCustomizer(customizer: Customizer[TelemetryResource]): Builder[F] /** Adds the telemetry resource detector. Multiple detectors can be added, and the detected telemetry resources * will be merged. @@ -149,9 +144,7 @@ object SdkMetrics { * @param detector * the detector to add */ - def addResourceDetector( - detector: TelemetryResourceDetector[F] - ): Builder[F] + def addResourceDetector(detector: TelemetryResourceDetector[F]): Builder[F] /** Adds the exporter configurer. Can be used to register exporters that aren't included in the SDK. * @@ -171,9 +164,7 @@ object SdkMetrics { * @param configurer * the configurer to add */ - def addExporterConfigurer( - configurer: AutoConfigure.Named[F, MetricExporter[F]] - ): Builder[F] + def addExporterConfigurer(configurer: AutoConfigure.Named[F, MetricExporter[F]]): Builder[F] /** Creates [[SdkMetrics]] using the configuration of this builder. */ @@ -182,7 +173,7 @@ object SdkMetrics { /** Creates a [[Builder]]. */ - def builder[F[_]: Async: SystemProperties: Console]: Builder[F] = + def builder[F[_]: Async: Env: SystemProperties: Console]: Builder[F] = BuilderImpl( customConfig = None, propertiesLoader = Async[F].pure(Map.empty), @@ -193,7 +184,7 @@ object SdkMetrics { exporterConfigurers = Set.empty ) - private final case class BuilderImpl[F[_]: Async: SystemProperties: Console]( + private final case class BuilderImpl[F[_]: Async: Env: SystemProperties: Console]( customConfig: Option[Config], propertiesLoader: F[Map[String, String]], propertiesCustomizers: List[Config => Map[String, String]], @@ -206,34 +197,22 @@ object SdkMetrics { def withConfig(config: Config): Builder[F] = copy(customConfig = Some(config)) - def addPropertiesLoader( - loader: F[Map[String, String]] - ): Builder[F] = + def addPropertiesLoader(loader: F[Map[String, String]]): Builder[F] = copy(propertiesLoader = (this.propertiesLoader, loader).mapN(_ ++ _)) - def addPropertiesCustomizer( - customizer: Config => Map[String, String] - ): Builder[F] = + def addPropertiesCustomizer(customizer: Config => Map[String, String]): Builder[F] = copy(propertiesCustomizers = this.propertiesCustomizers :+ customizer) - def addResourceCustomizer( - customizer: Customizer[TelemetryResource] - ): Builder[F] = + def addResourceCustomizer(customizer: Customizer[TelemetryResource]): Builder[F] = copy(resourceCustomizer = merge(this.resourceCustomizer, customizer)) - def addMeterProviderCustomizer( - customizer: Customizer[SdkMeterProvider.Builder[F]] - ): Builder[F] = + def addMeterProviderCustomizer(customizer: Customizer[SdkMeterProvider.Builder[F]]): Builder[F] = copy(meterProviderCustomizer = merge(this.meterProviderCustomizer, customizer)) - def addResourceDetector( - detector: TelemetryResourceDetector[F] - ): Builder[F] = + def addResourceDetector(detector: TelemetryResourceDetector[F]): Builder[F] = copy(resourceDetectors = this.resourceDetectors + detector) - def addExporterConfigurer( - configurer: AutoConfigure.Named[F, MetricExporter[F]] - ): Builder[F] = + def addExporterConfigurer(configurer: AutoConfigure.Named[F, MetricExporter[F]]): Builder[F] = copy(exporterConfigurers = this.exporterConfigurers + configurer) def build: Resource[F, SdkMetrics[F]] = { diff --git a/sdk/trace/src/main/scala/org/typelevel/otel4s/sdk/trace/SdkTraces.scala b/sdk/trace/src/main/scala/org/typelevel/otel4s/sdk/trace/SdkTraces.scala index 558877f4b..682e59d84 100644 --- a/sdk/trace/src/main/scala/org/typelevel/otel4s/sdk/trace/SdkTraces.scala +++ b/sdk/trace/src/main/scala/org/typelevel/otel4s/sdk/trace/SdkTraces.scala @@ -21,6 +21,7 @@ import cats.Parallel import cats.effect.Async import cats.effect.Resource import cats.effect.std.Console +import cats.effect.std.Env import cats.effect.std.Random import cats.effect.std.SystemProperties import cats.mtl.Local @@ -87,7 +88,7 @@ object SdkTraces { * @param customize * a function for customizing the auto-configured SDK builder */ - def autoConfigured[F[_]: Async: Parallel: SystemProperties: Console: LocalContextProvider]( + def autoConfigured[F[_]: Async: Parallel: Env: SystemProperties: Console: LocalContextProvider]( customize: AutoConfigured.Builder[F] => AutoConfigured.Builder[F] = (a: AutoConfigured.Builder[F]) => a ): Resource[F, SdkTraces[F]] = customize(AutoConfigured.builder[F]).build @@ -132,9 +133,7 @@ object SdkTraces { * @param customizer * the customizer to add */ - def addPropertiesCustomizer( - customizer: Config => Map[String, String] - ): Builder[F] + def addPropertiesCustomizer(customizer: Config => Map[String, String]): Builder[F] /** Adds the tracer provider builder customizer. Multiple customizers can be added, and they will be applied in * the order they were added. @@ -142,9 +141,7 @@ object SdkTraces { * @param customizer * the customizer to add */ - def addTracerProviderCustomizer( - customizer: Customizer[SdkTracerProvider.Builder[F]] - ): Builder[F] + def addTracerProviderCustomizer(customizer: Customizer[SdkTracerProvider.Builder[F]]): Builder[F] /** Adds the telemetry resource customizer. Multiple customizers can be added, and they will be applied in the * order they were added. @@ -152,9 +149,7 @@ object SdkTraces { * @param customizer * the customizer to add */ - def addResourceCustomizer( - customizer: Customizer[TelemetryResource] - ): Builder[F] + def addResourceCustomizer(customizer: Customizer[TelemetryResource]): Builder[F] /** Adds the telemetry resource detector. Multiple detectors can be added, and the detected telemetry resources * will be merged. @@ -169,9 +164,7 @@ object SdkTraces { * @param detector * the detector to add */ - def addResourceDetector( - detector: TelemetryResourceDetector[F] - ): Builder[F] + def addResourceDetector(detector: TelemetryResourceDetector[F]): Builder[F] /** Adds the exporter configurer. Can be used to register exporters that aren't included in the SDK. * @@ -191,9 +184,7 @@ object SdkTraces { * @param configurer * the configurer to add */ - def addExporterConfigurer( - configurer: AutoConfigure.Named[F, SpanExporter[F]] - ): Builder[F] + def addExporterConfigurer(configurer: AutoConfigure.Named[F, SpanExporter[F]]): Builder[F] /** Adds the sampler configurer. Can be used to register samplers that aren't included in the SDK. * @@ -207,9 +198,7 @@ object SdkTraces { * @param configurer * the configurer to add */ - def addTextMapPropagatorConfigurer( - configurer: AutoConfigure.Named[F, TextMapPropagator[Context]] - ): Builder[F] + def addTextMapPropagatorConfigurer(configurer: AutoConfigure.Named[F, TextMapPropagator[Context]]): Builder[F] /** Creates [[SdkTraces]] using the configuration of this builder. */ @@ -218,7 +207,7 @@ object SdkTraces { /** Creates a [[Builder]]. */ - def builder[F[_]: Async: Parallel: SystemProperties: Console: LocalContextProvider]: Builder[F] = + def builder[F[_]: Async: Parallel: Env: SystemProperties: Console: LocalContextProvider]: Builder[F] = BuilderImpl( customConfig = None, propertiesLoader = Async[F].pure(Map.empty), @@ -231,7 +220,7 @@ object SdkTraces { textMapPropagatorConfigurers = Set.empty ) - private final case class BuilderImpl[F[_]: Async: Parallel: SystemProperties: Console: LocalContextProvider]( + private final case class BuilderImpl[F[_]: Async: Parallel: Env: SystemProperties: Console: LocalContextProvider]( customConfig: Option[Config], propertiesLoader: F[Map[String, String]], propertiesCustomizers: List[Config => Map[String, String]], @@ -240,50 +229,34 @@ object SdkTraces { resourceDetectors: Set[TelemetryResourceDetector[F]], exporterConfigurers: Set[AutoConfigure.Named[F, SpanExporter[F]]], samplerConfigurers: Set[AutoConfigure.Named[F, Sampler[F]]], - textMapPropagatorConfigurers: Set[ - AutoConfigure.Named[F, TextMapPropagator[Context]] - ] + textMapPropagatorConfigurers: Set[AutoConfigure.Named[F, TextMapPropagator[Context]]] ) extends Builder[F] { def withConfig(config: Config): Builder[F] = copy(customConfig = Some(config)) - def addPropertiesLoader( - loader: F[Map[String, String]] - ): Builder[F] = + def addPropertiesLoader(loader: F[Map[String, String]]): Builder[F] = copy(propertiesLoader = (this.propertiesLoader, loader).mapN(_ ++ _)) - def addPropertiesCustomizer( - customizer: Config => Map[String, String] - ): Builder[F] = + def addPropertiesCustomizer(customizer: Config => Map[String, String]): Builder[F] = copy(propertiesCustomizers = this.propertiesCustomizers :+ customizer) - def addResourceCustomizer( - customizer: Customizer[TelemetryResource] - ): Builder[F] = + def addResourceCustomizer(customizer: Customizer[TelemetryResource]): Builder[F] = copy(resourceCustomizer = merge(this.resourceCustomizer, customizer)) - def addResourceDetector( - detector: TelemetryResourceDetector[F] - ): Builder[F] = + def addResourceDetector(detector: TelemetryResourceDetector[F]): Builder[F] = copy(resourceDetectors = this.resourceDetectors + detector) - def addTracerProviderCustomizer( - customizer: Customizer[SdkTracerProvider.Builder[F]] - ): Builder[F] = + def addTracerProviderCustomizer(customizer: Customizer[SdkTracerProvider.Builder[F]]): Builder[F] = copy(tracerProviderCustomizer = merge(this.tracerProviderCustomizer, customizer)) - def addExporterConfigurer( - configurer: AutoConfigure.Named[F, SpanExporter[F]] - ): Builder[F] = + def addExporterConfigurer(configurer: AutoConfigure.Named[F, SpanExporter[F]]): Builder[F] = copy(exporterConfigurers = this.exporterConfigurers + configurer) def addSamplerConfigurer(configurer: AutoConfigure.Named[F, Sampler[F]]): Builder[F] = copy(samplerConfigurers = this.samplerConfigurers + configurer) - def addTextMapPropagatorConfigurer( - configurer: AutoConfigure.Named[F, TextMapPropagator[Context]] - ): Builder[F] = + def addTextMapPropagatorConfigurer(configurer: AutoConfigure.Named[F, TextMapPropagator[Context]]): Builder[F] = copy(textMapPropagatorConfigurers = this.textMapPropagatorConfigurers + configurer) def build: Resource[F, SdkTraces[F]] = {