From 747e95fae08e8263a30963e107fdd07b638c4690 Mon Sep 17 00:00:00 2001 From: Maksym Ochenashko Date: Thu, 18 Jan 2024 10:46:24 +0200 Subject: [PATCH] Rename `Resource` -> `TelemetryResource` --- ...Resource.scala => TelemetryResource.scala} | 91 +++++++++++-------- ....scala => TelemetryResourceLawTests.scala} | 4 +- ...ops.scala => TelemetryResourceProps.scala} | 22 ++--- ...ite.scala => TelemetryResourceSuite.scala} | 14 +-- .../otel4s/sdk/scalacheck/Arbitraries.scala | 6 +- .../otel4s/sdk/scalacheck/Cogens.scala | 4 +- .../otel4s/sdk/scalacheck/Gens.scala | 6 +- .../otel4s/sdk/trace/SdkSpanBackend.scala | 6 +- .../otel4s/sdk/trace/TracerSharedState.scala | 2 +- .../otel4s/sdk/trace/data/SpanData.scala | 6 +- .../sdk/trace/SdkSpanBackendSuite.scala | 4 +- .../sdk/trace/SdkSpanBuilderSuite.scala | 4 +- .../otel4s/sdk/trace/scalacheck/Cogens.scala | 4 +- .../otel4s/sdk/trace/scalacheck/Gens.scala | 2 +- 14 files changed, 93 insertions(+), 82 deletions(-) rename sdk/common/src/main/scala/org/typelevel/otel4s/sdk/{Resource.scala => TelemetryResource.scala} (58%) rename sdk/common/src/test/scala/org/typelevel/otel4s/sdk/{ResourceLawTests.scala => TelemetryResourceLawTests.scala} (85%) rename sdk/common/src/test/scala/org/typelevel/otel4s/sdk/{ResourceProps.scala => TelemetryResourceProps.scala} (64%) rename sdk/common/src/test/scala/org/typelevel/otel4s/sdk/{ResourceSuite.scala => TelemetryResourceSuite.scala} (82%) diff --git a/sdk/common/src/main/scala/org/typelevel/otel4s/sdk/Resource.scala b/sdk/common/src/main/scala/org/typelevel/otel4s/sdk/TelemetryResource.scala similarity index 58% rename from sdk/common/src/main/scala/org/typelevel/otel4s/sdk/Resource.scala rename to sdk/common/src/main/scala/org/typelevel/otel4s/sdk/TelemetryResource.scala index da8a30e25..9a72b1da7 100644 --- a/sdk/common/src/main/scala/org/typelevel/otel4s/sdk/Resource.scala +++ b/sdk/common/src/main/scala/org/typelevel/otel4s/sdk/TelemetryResource.scala @@ -20,17 +20,20 @@ package sdk import cats.Hash import cats.Show import cats.syntax.all._ -import org.typelevel.otel4s.sdk.Resource.ResourceInitializationError +import org.typelevel.otel4s.sdk.TelemetryResource.ResourceInitializationError import org.typelevel.otel4s.semconv.resource.attributes.ResourceAttributes._ -/** [[Resource]] serves as a representation of a resource that captures +/** [[TelemetryResource]] serves as a representation of a resource that captures * essential identifying information regarding the entities associated with * reported signals, such as statistics or traces. * * @see + * [[https://opentelemetry.io/docs/specs/otel/overview/#resources]] + * + * @see * [[https://opentelemetry.io/docs/specs/otel/resource/sdk]] */ -sealed trait Resource { +sealed trait TelemetryResource { /** An [[Attributes]] associated with the resource. */ @@ -40,7 +43,7 @@ sealed trait Resource { */ def schemaUrl: Option[String] - /** Merges [[Resource]] into another [[Resource]]. + /** Merges [[TelemetryResource]] into another [[TelemetryResource]]. * * Schema URL merge outcomes: * - if `this` resource's schema URL is empty then the `other` resource's @@ -57,42 +60,44 @@ sealed trait Resource { * * @note * if the same attribute exists in both resources, the attribute from the - * `other` [[Resource]] will be retained. + * `other` [[TelemetryResource]] will be retained. * * @param other - * the other [[Resource]] to merge with + * the other [[TelemetryResource]] to merge with * * @return - * a new [[Resource]] with the merged attributes + * a new [[TelemetryResource]] with the merged attributes */ - def merge(other: Resource): Either[ResourceInitializationError, Resource] + def merge( + other: TelemetryResource + ): Either[ResourceInitializationError, TelemetryResource] /** Unsafe version of [[merge]] which throws an exception if the merge fails. * * @param other - * the other [[Resource]] to merge with + * the other [[TelemetryResource]] to merge with */ - def mergeUnsafe(other: Resource): Resource + def mergeUnsafe(other: TelemetryResource): TelemetryResource override final def hashCode(): Int = - Hash[Resource].hash(this) + Hash[TelemetryResource].hash(this) override final def equals(obj: Any): Boolean = obj match { - case other: Resource => Hash[Resource].eqv(this, other) - case _ => false + case other: TelemetryResource => Hash[TelemetryResource].eqv(this, other) + case _ => false } override final def toString: String = - Show[Resource].show(this) + Show[TelemetryResource].show(this) } -object Resource { - private val Empty: Resource = - Resource(Attributes.empty, None) +object TelemetryResource { + private val Empty: TelemetryResource = + TelemetryResource(Attributes.empty, None) - private val Default: Resource = { + private val Default: TelemetryResource = { val telemetrySdk = Attributes( Attribute(TelemetrySdkName, "otel4s"), Attribute(TelemetrySdkLanguage, TelemetrySdkLanguageValue.Scala.value), @@ -103,7 +108,7 @@ object Resource { Attribute(ServiceName, "unknown_service:scala") ) - Resource(telemetrySdk |+| mandatory, None) + TelemetryResource(telemetrySdk |+| mandatory, None) } sealed abstract class ResourceInitializationError extends Throwable @@ -111,52 +116,58 @@ object Resource { case object SchemaUrlConflict extends ResourceInitializationError } - /** Creates a [[Resource]] with the given `attributes`. The `schemaUrl` will - * be `None.` + /** Creates a [[TelemetryResource]] with the given `attributes`. The + * `schemaUrl` will be `None.` * * @param attributes * the attributes to associate with the resource */ - def apply(attributes: Attributes): Resource = + def apply(attributes: Attributes): TelemetryResource = Impl(attributes, None) - /** Creates a [[Resource]] with the given `attributes` and `schemaUrl`. + /** Creates a [[TelemetryResource]] with the given `attributes` and + * `schemaUrl`. * * @param attributes * the attributes to associate with the resource - * * @param schemaUrl * schema URL to associate with the result */ - def apply(attributes: Attributes, schemaUrl: Option[String]): Resource = + def apply( + attributes: Attributes, + schemaUrl: Option[String] + ): TelemetryResource = Impl(attributes, schemaUrl) - /** Returns an empty [[Resource]]. + /** Returns an empty [[TelemetryResource]]. * - * It is strongly recommended to start with [[Resource.default]] instead of - * this method to include SDK required attributes. + * It is strongly recommended to start with [[TelemetryResource.default]] + * instead of this method to include SDK required attributes. */ - def empty: Resource = Empty + def empty: TelemetryResource = Empty - /** Returns the default [[Resource]]. This resource contains the default - * attributes provided by the SDK. + /** Returns the default [[TelemetryResource]]. This resource contains the + * default attributes provided by the SDK. */ - def default: Resource = Default + def default: TelemetryResource = Default - implicit val showResource: Show[Resource] = - r => show"Resource{attributes=${r.attributes}, schemaUrl=${r.schemaUrl}}" + implicit val showResource: Show[TelemetryResource] = + r => + show"TelemetryResource{attributes=${r.attributes}, schemaUrl=${r.schemaUrl}}" - implicit val hashResource: Hash[Resource] = + implicit val hashResource: Hash[TelemetryResource] = Hash.by(r => (r.attributes, r.schemaUrl)) private final case class Impl( attributes: Attributes, schemaUrl: Option[String] - ) extends Resource { + ) extends TelemetryResource { - def merge(other: Resource): Either[ResourceInitializationError, Resource] = - if (other == Resource.Empty) Right(this) - else if (this == Resource.Empty) Right(other) + def merge( + other: TelemetryResource + ): Either[ResourceInitializationError, TelemetryResource] = + if (other == TelemetryResource.Empty) Right(this) + else if (this == TelemetryResource.Empty) Right(other) else { (other.schemaUrl, schemaUrl) match { case (Some(otherUrl), Some(url)) if otherUrl != url => @@ -167,7 +178,7 @@ object Resource { } } - def mergeUnsafe(other: Resource): Resource = + def mergeUnsafe(other: TelemetryResource): TelemetryResource = merge(other).fold(throw _, identity) } diff --git a/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/ResourceLawTests.scala b/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/TelemetryResourceLawTests.scala similarity index 85% rename from sdk/common/src/test/scala/org/typelevel/otel4s/sdk/ResourceLawTests.scala rename to sdk/common/src/test/scala/org/typelevel/otel4s/sdk/TelemetryResourceLawTests.scala index 08627ffd9..d41d2adf9 100644 --- a/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/ResourceLawTests.scala +++ b/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/TelemetryResourceLawTests.scala @@ -21,8 +21,8 @@ import munit.DisciplineSuite import org.typelevel.otel4s.sdk.scalacheck.Arbitraries._ import org.typelevel.otel4s.sdk.scalacheck.Cogens._ -class ResourceLawTests extends DisciplineSuite { +class TelemetryResourceLawTests extends DisciplineSuite { - checkAll("Resource.HashLaws", HashTests[Resource].hash) + checkAll("TelemetryResource.HashLaws", HashTests[TelemetryResource].hash) } diff --git a/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/ResourceProps.scala b/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/TelemetryResourceProps.scala similarity index 64% rename from sdk/common/src/test/scala/org/typelevel/otel4s/sdk/ResourceProps.scala rename to sdk/common/src/test/scala/org/typelevel/otel4s/sdk/TelemetryResourceProps.scala index 59c8e9340..1f89ddb36 100644 --- a/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/ResourceProps.scala +++ b/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/TelemetryResourceProps.scala @@ -22,21 +22,21 @@ import munit.ScalaCheckSuite import org.scalacheck.Prop.forAll import org.typelevel.otel4s.sdk.scalacheck.Gens -class ResourceProps extends ScalaCheckSuite { +class TelemetryResourceProps extends ScalaCheckSuite { - property("Attributes#merge merges attributes") { - forAll(Gens.resource, Gens.resource) { (resource1, resource2) => - val mergedEither = resource1.merge(resource2) + property("TelemetryResource#merge merges attributes") { + forAll(Gens.telemetryResource, Gens.telemetryResource) { (r1, r2) => + val mergedEither = r1.merge(r2) mergedEither match { case Right(merged) => val mergedAttrs = merged.attributes val keys = - resource1.attributes.toMap.keySet ++ resource2.attributes.toMap.keySet + r1.attributes.toMap.keySet ++ r2.attributes.toMap.keySet mergedAttrs.size == keys.size && mergedAttrs.forall { a => - resource2.attributes + r2.attributes .get(a.key) - .orElse(resource1.attributes.get(a.key)) + .orElse(r1.attributes.get(a.key)) .contains(a) } case Left(_) => true @@ -45,12 +45,12 @@ class ResourceProps extends ScalaCheckSuite { } } - property("Show[Resource]") { - forAll(Gens.resource) { resource => + property("Show[TelemetryResource]") { + forAll(Gens.telemetryResource) { resource => val expected = - show"Resource{attributes=${resource.attributes}, schemaUrl=${resource.schemaUrl}}" + show"TelemetryResource{attributes=${resource.attributes}, schemaUrl=${resource.schemaUrl}}" - assertEquals(Show[Resource].show(resource), expected) + assertEquals(Show[TelemetryResource].show(resource), expected) } } diff --git a/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/ResourceSuite.scala b/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/TelemetryResourceSuite.scala similarity index 82% rename from sdk/common/src/test/scala/org/typelevel/otel4s/sdk/ResourceSuite.scala rename to sdk/common/src/test/scala/org/typelevel/otel4s/sdk/TelemetryResourceSuite.scala index 128a3d802..cee95d309 100644 --- a/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/ResourceSuite.scala +++ b/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/TelemetryResourceSuite.scala @@ -19,10 +19,10 @@ package sdk import cats.syntax.either._ import munit.FunSuite -import org.typelevel.otel4s.sdk.Resource.ResourceInitializationError -import org.typelevel.otel4s.sdk.Resource.ResourceInitializationError.SchemaUrlConflict +import org.typelevel.otel4s.sdk.TelemetryResource.ResourceInitializationError +import org.typelevel.otel4s.sdk.TelemetryResource.ResourceInitializationError.SchemaUrlConflict -class ResourceSuite extends FunSuite { +class TelemetryResourceSuite extends FunSuite { def checkSchemaMerge( leftSchemaUrl: Option[String], @@ -30,8 +30,8 @@ class ResourceSuite extends FunSuite { expected: Either[ResourceInitializationError, Option[String]] ): Unit = assertEquals( - Resource(Attributes.empty, leftSchemaUrl) - .merge(Resource(Attributes.empty, rightSchemaUrl)) + TelemetryResource(Attributes.empty, leftSchemaUrl) + .merge(TelemetryResource(Attributes.empty, rightSchemaUrl)) .map(_.schemaUrl), expected ) @@ -83,8 +83,8 @@ class ResourceSuite extends FunSuite { } test("Resource#mergeInto - merge attributes and prioritize the latter") { - val that = Resource(Attributes(Attribute("key", "that"))) - val other = Resource(Attributes(Attribute("key", "other"))) + val that = TelemetryResource(Attributes(Attribute("key", "that"))) + val other = TelemetryResource(Attributes(Attribute("key", "other"))) assertEquals(that.merge(other), Right(other)) } diff --git a/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/scalacheck/Arbitraries.scala b/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/scalacheck/Arbitraries.scala index 45afe7468..97a95de0d 100644 --- a/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/scalacheck/Arbitraries.scala +++ b/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/scalacheck/Arbitraries.scala @@ -17,13 +17,13 @@ package org.typelevel.otel4s.sdk.scalacheck import org.scalacheck.Arbitrary -import org.typelevel.otel4s.sdk.Resource +import org.typelevel.otel4s.sdk.TelemetryResource import org.typelevel.otel4s.sdk.common.InstrumentationScope trait Arbitraries extends org.typelevel.otel4s.scalacheck.Arbitraries { - implicit val resourceArbitrary: Arbitrary[Resource] = - Arbitrary(Gens.resource) + implicit val telemetryResourceArbitrary: Arbitrary[TelemetryResource] = + Arbitrary(Gens.telemetryResource) implicit val instrumentationScopeArbitrary: Arbitrary[InstrumentationScope] = Arbitrary(Gens.instrumentationScope) diff --git a/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/scalacheck/Cogens.scala b/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/scalacheck/Cogens.scala index 9f55e4eeb..a83293b0d 100644 --- a/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/scalacheck/Cogens.scala +++ b/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/scalacheck/Cogens.scala @@ -18,12 +18,12 @@ package org.typelevel.otel4s.sdk.scalacheck import org.scalacheck.Cogen import org.typelevel.otel4s.Attributes -import org.typelevel.otel4s.sdk.Resource +import org.typelevel.otel4s.sdk.TelemetryResource import org.typelevel.otel4s.sdk.common.InstrumentationScope trait Cogens extends org.typelevel.otel4s.scalacheck.Cogens { - implicit val resourceCogen: Cogen[Resource] = + implicit val telemetryResourceCogen: Cogen[TelemetryResource] = Cogen[(Attributes, Option[String])].contramap { r => (r.attributes, r.schemaUrl) } diff --git a/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/scalacheck/Gens.scala b/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/scalacheck/Gens.scala index 33018c600..e81d3bdb1 100644 --- a/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/scalacheck/Gens.scala +++ b/sdk/common/src/test/scala/org/typelevel/otel4s/sdk/scalacheck/Gens.scala @@ -17,16 +17,16 @@ package org.typelevel.otel4s.sdk.scalacheck import org.scalacheck.Gen -import org.typelevel.otel4s.sdk.Resource +import org.typelevel.otel4s.sdk.TelemetryResource import org.typelevel.otel4s.sdk.common.InstrumentationScope trait Gens extends org.typelevel.otel4s.scalacheck.Gens { - val resource: Gen[Resource] = + val telemetryResource: Gen[TelemetryResource] = for { attributes <- Gens.attributes schemaUrl <- Gen.option(nonEmptyString) - } yield Resource(attributes, schemaUrl) + } yield TelemetryResource(attributes, schemaUrl) val instrumentationScope: Gen[InstrumentationScope] = for { diff --git a/sdk/trace/src/main/scala/org/typelevel/otel4s/sdk/trace/SdkSpanBackend.scala b/sdk/trace/src/main/scala/org/typelevel/otel4s/sdk/trace/SdkSpanBackend.scala index 630c58edb..66a568d5d 100644 --- a/sdk/trace/src/main/scala/org/typelevel/otel4s/sdk/trace/SdkSpanBackend.scala +++ b/sdk/trace/src/main/scala/org/typelevel/otel4s/sdk/trace/SdkSpanBackend.scala @@ -228,7 +228,7 @@ private[trace] object SdkSpanBackend { * the [[InstrumentationScope]] of the span * * @param resource - * the [[Resource]] of the span + * the [[TelemetryResource]] of the span * * @param kind * the [[SpanKind]] of the span @@ -253,7 +253,7 @@ private[trace] object SdkSpanBackend { context: SpanContext, name: String, scopeInfo: InstrumentationScope, - resource: Resource, + resource: TelemetryResource, kind: SpanKind, parentContext: Option[SpanContext], processor: SpanProcessor[F], @@ -293,7 +293,7 @@ private[trace] object SdkSpanBackend { scopeInfo: InstrumentationScope, kind: SpanKind, parentContext: Option[SpanContext], - resource: Resource, + resource: TelemetryResource, links: Vector[LinkData], startTimestamp: FiniteDuration ) diff --git a/sdk/trace/src/main/scala/org/typelevel/otel4s/sdk/trace/TracerSharedState.scala b/sdk/trace/src/main/scala/org/typelevel/otel4s/sdk/trace/TracerSharedState.scala index d238d10b3..fcb2dd102 100644 --- a/sdk/trace/src/main/scala/org/typelevel/otel4s/sdk/trace/TracerSharedState.scala +++ b/sdk/trace/src/main/scala/org/typelevel/otel4s/sdk/trace/TracerSharedState.scala @@ -22,7 +22,7 @@ import org.typelevel.otel4s.sdk.trace.samplers.Sampler private final case class TracerSharedState[F[_]]( idGenerator: IdGenerator[F], - resource: Resource, + resource: TelemetryResource, sampler: Sampler, spanProcessor: SpanProcessor[F] ) diff --git a/sdk/trace/src/main/scala/org/typelevel/otel4s/sdk/trace/data/SpanData.scala b/sdk/trace/src/main/scala/org/typelevel/otel4s/sdk/trace/data/SpanData.scala index caca55052..03b71336a 100644 --- a/sdk/trace/src/main/scala/org/typelevel/otel4s/sdk/trace/data/SpanData.scala +++ b/sdk/trace/src/main/scala/org/typelevel/otel4s/sdk/trace/data/SpanData.scala @@ -83,7 +83,7 @@ sealed trait SpanData { /** The resource associated with the span. */ - def resource: Resource + def resource: TelemetryResource /** Whether the span has ended. */ @@ -155,7 +155,7 @@ object SpanData { events: Vector[EventData], links: Vector[LinkData], instrumentationScope: InstrumentationScope, - resource: Resource + resource: TelemetryResource ): SpanData = Impl( name = name, @@ -223,7 +223,7 @@ object SpanData { events: Vector[EventData], links: Vector[LinkData], instrumentationScope: InstrumentationScope, - resource: Resource + resource: TelemetryResource ) extends SpanData } diff --git a/sdk/trace/src/test/scala/org/typelevel/otel4s/sdk/trace/SdkSpanBackendSuite.scala b/sdk/trace/src/test/scala/org/typelevel/otel4s/sdk/trace/SdkSpanBackendSuite.scala index 30ea3d1e1..75f126e05 100644 --- a/sdk/trace/src/test/scala/org/typelevel/otel4s/sdk/trace/SdkSpanBackendSuite.scala +++ b/sdk/trace/src/test/scala/org/typelevel/otel4s/sdk/trace/SdkSpanBackendSuite.scala @@ -431,7 +431,7 @@ class SdkSpanBackendSuite extends CatsEffectSuite with ScalaCheckEffectSuite { context: SpanContext = Defaults.context, name: String = Defaults.name, scope: InstrumentationScope = Defaults.scope, - resource: Resource = Defaults.resource, + resource: TelemetryResource = Defaults.resource, kind: SpanKind = Defaults.kind, parentSpanContext: Option[SpanContext] = None, attributes: Attributes = Defaults.attributes, @@ -457,7 +457,7 @@ class SdkSpanBackendSuite extends CatsEffectSuite with ScalaCheckEffectSuite { val context = SpanContext.invalid val name = "span name" val scope = InstrumentationScope.builder("otel4s").build - val resource = Resource.default + val resource = TelemetryResource.default val kind = SpanKind.Client val attributes = Attributes.empty val spanProcessor = SpanProcessor.noop[IO] diff --git a/sdk/trace/src/test/scala/org/typelevel/otel4s/sdk/trace/SdkSpanBuilderSuite.scala b/sdk/trace/src/test/scala/org/typelevel/otel4s/sdk/trace/SdkSpanBuilderSuite.scala index d61328855..b4ff56545 100644 --- a/sdk/trace/src/test/scala/org/typelevel/otel4s/sdk/trace/SdkSpanBuilderSuite.scala +++ b/sdk/trace/src/test/scala/org/typelevel/otel4s/sdk/trace/SdkSpanBuilderSuite.scala @@ -25,7 +25,7 @@ import org.scalacheck.Test import org.scalacheck.effect.PropF import org.typelevel.otel4s.Attributes import org.typelevel.otel4s.instances.local._ -import org.typelevel.otel4s.sdk.{Resource => InstrumentationResource} +import org.typelevel.otel4s.sdk.TelemetryResource import org.typelevel.otel4s.sdk.common.InstrumentationScope import org.typelevel.otel4s.sdk.context.Context import org.typelevel.otel4s.sdk.trace.data.LinkData @@ -144,7 +144,7 @@ class SdkSpanBuilderSuite extends CatsEffectSuite with ScalaCheckEffectSuite { Random.scalaUtilRandom[IO].map { implicit random => TracerSharedState( IdGenerator.random[IO], - InstrumentationResource.default, + TelemetryResource.default, sampler, SimpleSpanProcessor(exporter) ) diff --git a/sdk/trace/src/test/scala/org/typelevel/otel4s/sdk/trace/scalacheck/Cogens.scala b/sdk/trace/src/test/scala/org/typelevel/otel4s/sdk/trace/scalacheck/Cogens.scala index df65702b5..02b65d4d0 100644 --- a/sdk/trace/src/test/scala/org/typelevel/otel4s/sdk/trace/scalacheck/Cogens.scala +++ b/sdk/trace/src/test/scala/org/typelevel/otel4s/sdk/trace/scalacheck/Cogens.scala @@ -18,7 +18,7 @@ package org.typelevel.otel4s.sdk.trace.scalacheck import org.scalacheck.Cogen import org.typelevel.otel4s.Attributes -import org.typelevel.otel4s.sdk.Resource +import org.typelevel.otel4s.sdk.TelemetryResource import org.typelevel.otel4s.sdk.common.InstrumentationScope import org.typelevel.otel4s.sdk.trace.data.EventData import org.typelevel.otel4s.sdk.trace.data.LinkData @@ -72,7 +72,7 @@ trait Cogens Vector[EventData], Vector[LinkData], InstrumentationScope, - Resource + TelemetryResource ) ].contramap { spanData => ( diff --git a/sdk/trace/src/test/scala/org/typelevel/otel4s/sdk/trace/scalacheck/Gens.scala b/sdk/trace/src/test/scala/org/typelevel/otel4s/sdk/trace/scalacheck/Gens.scala index e1a2eae06..98adcbecf 100644 --- a/sdk/trace/src/test/scala/org/typelevel/otel4s/sdk/trace/scalacheck/Gens.scala +++ b/sdk/trace/src/test/scala/org/typelevel/otel4s/sdk/trace/scalacheck/Gens.scala @@ -77,7 +77,7 @@ trait Gens events <- Gen.listOf(Gens.eventData) links <- Gen.listOf(Gens.linkData) instrumentationScope <- Gens.instrumentationScope - resource <- Gens.resource + resource <- Gens.telemetryResource } yield SpanData( name, spanContext,