Documentation ¶
Index ¶
- Variables
- func AppendUsageAttribute(attr attribute.KeyValue)
- func AppendUsageAttributeUnique(attr attribute.KeyValue)
- func GetGlobalAttributes() []attribute.KeyValue
- func GetUsageAttributes() []attribute.KeyValue
- func IncrementUsageAttribute(attr attribute.KeyValue)
- func SetAttributesInContext(ctx context.Context, attributes ...attribute.KeyValue)
- func SetBaggageInContext(ctx context.Context, attributes ...attribute.KeyValue) context.Context
- func SetGlobalAttributes(attributes ...attribute.KeyValue)
- func SetUsageAttributes(attributes ...attribute.KeyValue)
- type Span
- type Tracer
Constants ¶
This section is empty.
Variables ¶
var InteractTimeMs = atomic.NewInt64(0)
InteractTimeMs is the time spent waiting on user interaction in milliseconds.
Functions ¶
func AppendUsageAttribute ¶
Sets or appends a value to a slice-type usage attribute that possibly exists. The attribute is expected to be a slice-type value, and matches the existing type. Otherwise, a strict replacement is performed.
func AppendUsageAttributeUnique ¶
Sets or appends a value to a string slice-type usage attribute that possibly exists, merging on unique elements.
The attribute is expected to be a slice-type value, and matches the existing type. For convenience, a string-type value is also treated as a string-slice with a single element.
If the types do not match, a strict replacement is performed.
func GetGlobalAttributes ¶
Returns all global attributes set.
func GetUsageAttributes ¶
Returns all usage attributes set.
func IncrementUsageAttribute ¶
Sets or increments a possibly stored usage attribute. The attribute is expected to be a numeric-type or string-type value, and matches the existing type of a previously stored usage attribute. Otherwise, a strict replacement is performed.
func SetAttributesInContext ¶
SetAttributesInContext sets the given attributes for the current running span.
func SetBaggageInContext ¶
SetBaggageInContext sets the given attributes as baggage. Baggage attributes are set for the current running span, and for any child spans created.
func SetGlobalAttributes ¶
Sets global attributes that are included with all telemetry events emitted. If the attribute already exists, the value is replaced.
func SetUsageAttributes ¶
Sets usage attributes that are included with usage events emitted. If the attribute already exists, the value is replaced.
Types ¶
type Span ¶
type Span interface { // EndWithStatus calls End, but also sets Status based on the value of err (nil mean success). EndWithStatus(err error, options ...trace.SpanEndOption) // contains filtered or unexported methods }
Span is the individual component of a trace. It represents a single named and timed operation of a workflow that is traced. A Tracer is used to create a Span and it is then up to the operation the Span represents to properly end the Span when the operation itself ends.
func Start ¶
Start creates a span and a context.Context containing the newly-created span.
If the context.Context provided in `ctx` contains a Span then the newly-created Span will be a child of that span, otherwise it will be a root span. This behavior can be overridden by providing `WithNewRoot()` as a SpanOption, causing the newly-created Span to be a root span even if `ctx` contains a Span.
When creating a Span it is recommended to provide all known span attributes using the `WithAttributes()` SpanOption as samplers will only have access to the attributes provided when a Span is created.
Directories ¶
Path | Synopsis |
---|---|
Package baggage provides an implementation of storing trace-level context data, i.e.
|
Package baggage provides an implementation of storing trace-level context data, i.e. |
Package events provides definitions and functions related to the definition of telemetry events.
|
Package events provides definitions and functions related to the definition of telemetry events. |
Package fields provides definitions and functions related to the definition of telemetry fields.
|
Package fields provides definitions and functions related to the definition of telemetry fields. |
Package resource provides application-level resource attributes for telemetry purposes.
|
Package resource provides application-level resource attributes for telemetry purposes. |