github.com/chenbh/concourse/v6@v6.4.2/tracing/attrs.go (about)

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