@@ -31,22 +31,20 @@ import (
3131 tracetranslator "go.opentelemetry.io/collector/translator/trace"
3232)
3333
34- var nonSpanAttributes = getNonSpanAttributes ()
35-
36- func getNonSpanAttributes () map [string ]struct {} {
34+ var nonSpanAttributes = func () map [string ]struct {} {
3735 attrs := make (map [string ]struct {})
3836 for _ , key := range conventions .GetResourceSemanticConventionAttributeNames () {
3937 attrs [key ] = struct {}{}
4038 }
4139 attrs [tracetranslator .TagServiceNameSource ] = struct {}{}
42- attrs [tracetranslator . TagInstrumentationName ] = struct {}{}
43- attrs [tracetranslator . TagInstrumentationVersion ] = struct {}{}
40+ attrs [conventions . InstrumentationLibraryName ] = struct {}{}
41+ attrs [conventions . InstrumentationLibraryVersion ] = struct {}{}
4442 attrs [conventions .OCAttributeProcessStartTime ] = struct {}{}
4543 attrs [conventions .OCAttributeExporterVersion ] = struct {}{}
4644 attrs [conventions .AttributeProcessID ] = struct {}{}
4745 attrs [conventions .OCAttributeResourceType ] = struct {}{}
4846 return attrs
49- }
47+ }()
5048
5149// Custom Sort on
5250type byOTLPTypes []* zipkinmodel.SpanModel
@@ -384,8 +382,8 @@ func populateResourceFromZipkinSpan(tags map[string]string, localServiceName str
384382 }
385383 delete (tags , tracetranslator .TagServiceNameSource )
386384
387- for key := range getNonSpanAttributes () {
388- if key == tracetranslator . TagInstrumentationName || key == tracetranslator . TagInstrumentationVersion {
385+ for key := range nonSpanAttributes {
386+ if key == conventions . InstrumentationLibraryName || key == conventions . InstrumentationLibraryVersion {
389387 continue
390388 }
391389 if value , ok := tags [key ]; ok {
@@ -399,13 +397,13 @@ func populateILFromZipkinSpan(tags map[string]string, instrLibName string, libra
399397 if instrLibName == "" {
400398 return
401399 }
402- if value , ok := tags [tracetranslator . TagInstrumentationName ]; ok {
400+ if value , ok := tags [conventions . InstrumentationLibraryName ]; ok {
403401 library .SetName (value )
404- delete (tags , tracetranslator . TagInstrumentationName )
402+ delete (tags , conventions . InstrumentationLibraryName )
405403 }
406- if value , ok := tags [tracetranslator . TagInstrumentationVersion ]; ok {
404+ if value , ok := tags [conventions . InstrumentationLibraryVersion ]; ok {
407405 library .SetVersion (value )
408- delete (tags , tracetranslator . TagInstrumentationVersion )
406+ delete (tags , conventions . InstrumentationLibraryVersion )
409407 }
410408}
411409
@@ -428,5 +426,5 @@ func extractInstrumentationLibrary(zspan *zipkinmodel.SpanModel) string {
428426 if zspan == nil || len (zspan .Tags ) == 0 {
429427 return ""
430428 }
431- return zspan .Tags [tracetranslator . TagInstrumentationName ]
429+ return zspan .Tags [conventions . InstrumentationLibraryName ]
432430}
0 commit comments