Documentation
¶
Index ¶
- func SetAttrs(span trace.Span, attrs ...KeyValue)
- func WithAttrs(attrs ...KeyValue) trace.SpanStartEventOption
- type KeyValue
- func BoolAttr(k string, v bool) KeyValue
- func BoolSliceAttr(k string, v []bool) KeyValue
- func Float64Attr(k string, v float64) KeyValue
- func Float64SliceAttr(k string, v []float64) KeyValue
- func Int64Attr(k string, v int64) KeyValue
- func Int64SliceAttr(k string, v []int64) KeyValue
- func IntAttr(k string, v int) KeyValue
- func IntSliceAttr(k string, v []int) KeyValue
- func ObjectAttr(k string, v interface{}) KeyValue
- func StringAttr(k, v string) KeyValue
- func StringSliceAttr(k string, v []string) KeyValue
- func StringerAttr(k string, v fmt.Stringer) KeyValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetAttrs ¶
SetAttrs can be used in place of span.SetAttributes to set multiple attributes on a span after it has been created.
func WithAttrs ¶
func WithAttrs(attrs ...KeyValue) trace.SpanStartEventOption
WithAttrs can be used in place of trace.WithAttributes to set multiple attributes on a span at the time of creation.
Types ¶
type KeyValue ¶
type KeyValue struct {
// contains filtered or unexported fields
}
func BoolSliceAttr ¶
BoolSliceAttr is comparable to attribute.BoolSlice.
func Float64Attr ¶
Float64Attr is comparable to attribute.Float64.
func Float64SliceAttr ¶
Float64SliceAttr is comparable to attribute.Float64Slice.
func Int64SliceAttr ¶
Int64SliceAttr is comparable to attribute.Int64Slice.
func IntSliceAttr ¶
IntSliceAttr is comparable to attribute.IntSlice.
func ObjectAttr ¶
ObjectAttr は構造体や map などの複合型を属性として設定するための KeyValue を生成します。 綺麗な型制約や命名を提供できなかったのはご愛嬌として、以下の点にご注意ください。
- プリミティブ型以外の配列、またはそれを子として持つ構造体や map は構造上受け入れられない(JSONとして出力される)
- map のキーの基底型が string でない場合は <T value> が属性のキーとして採用される
func StringAttr ¶
StringAttr is comparable to attribute.String.
func StringSliceAttr ¶
StringSliceAttr is comparable to attribute.StringSlice.