@@ -24,7 +24,7 @@ import scala.collection.JavaConverters._
24
24
25
25
import io .opentelemetry .api .common .{AttributeKey , Attributes }
26
26
import io .opentelemetry .api .trace ._
27
- import io .opentelemetry .sdk .common .InstrumentationLibraryInfo
27
+ import io .opentelemetry .sdk .common .{ InstrumentationLibraryInfo , InstrumentationScopeInfo }
28
28
import io .opentelemetry .sdk .resources .Resource
29
29
import io .opentelemetry .sdk .trace .data .{EventData , LinkData , SpanData , StatusData }
30
30
import kamon .tag .{Lookups , Tag , TagSet }
@@ -34,8 +34,8 @@ import kamon.trace.{Identifier, Span}
34
34
35
35
36
36
class SpanWrapper (includeErrorEvent : Boolean , resource : Resource , kamonVersion : String , span : Span .Finished ) extends SpanData {
37
- private val instrumentationLibraryInfo : InstrumentationLibraryInfo =
38
- InstrumentationLibraryInfo .create(span.metricTags.get(Lookups .option(Span .TagKeys .Component )) getOrElse " kamon-instrumentation" , kamonVersion)
37
+ private val instrumentationScopeInfo : InstrumentationScopeInfo =
38
+ InstrumentationScopeInfo .create(span.metricTags.get(Lookups .option(Span .TagKeys .Component )) getOrElse " kamon-instrumentation" , kamonVersion, null )
39
39
private val sampled : Boolean = span.trace.samplingDecision == Sample
40
40
private val attachErrorEvent : Boolean = includeErrorEvent && span.hasError
41
41
@@ -78,7 +78,10 @@ class SpanWrapper(includeErrorEvent: Boolean, resource: Resource, kamonVersion:
78
78
79
79
override def getTotalAttributeCount : Int = getAttributes.size()
80
80
81
- override def getInstrumentationLibraryInfo : InstrumentationLibraryInfo = instrumentationLibraryInfo
81
+ override def getInstrumentationLibraryInfo : InstrumentationLibraryInfo =
82
+ InstrumentationLibraryInfo .create(instrumentationScopeInfo.getName, instrumentationScopeInfo.getVersion)
83
+
84
+ override def getInstrumentationScopeInfo : InstrumentationScopeInfo = instrumentationScopeInfo
82
85
83
86
override def getResource : Resource = resource
84
87
}
0 commit comments