xattribute

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package xattribute provides some helpers to create OpenTelemetry attributes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Duration added in v0.13.0

func Duration(k string, d time.Duration) attribute.KeyValue

Duration returns time.Duration as integer attribute.

func StringMap

func StringMap(k string, m map[string]string) attribute.KeyValue

StringMap creates a sorted string slice attribute from string map.

func StringerSlice

func StringerSlice[S ~[]E, E fmt.Stringer](k string, v S) attribute.KeyValue

StringerSlice creates a string slice attribute from slice of fmt.Stringer implementations.

func UnixNano added in v0.13.0

func UnixNano(k string, t time.Time) attribute.KeyValue

UnixNano returns time.Time as unix nano timestamp.

If value is zero, timestamp would be zero too.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL