github.com/pf-qiu/concourse/v6@v6.7.3-0.20201207032516-1f455d73275f/tracing/attrs.go (about)

     1  package tracing
     2  
     3  import (
     4  	"go.opentelemetry.io/otel/label"
     5  )
     6  
     7  type Attrs map[string]string
     8  
     9  // keyValueSlice converts our internal representation of kv pairs to the tracing
    10  // SDK's kv representation.
    11  //
    12  func keyValueSlice(attrs Attrs) []label.KeyValue {
    13  	var (
    14  		res = make([]label.KeyValue, len(attrs))
    15  		idx = 0
    16  	)
    17  
    18  	for k, v := range attrs {
    19  		res[idx] = label.String(k, v)
    20  		idx++
    21  	}
    22  
    23  	return res
    24  }