Span interface.
More...
#include <opentracing-c/span.h>
◆ baggage_item
const char*(* opentracing_span::baggage_item) (const struct opentracing_span *span, const char *key) OPENTRACINGC_NONNULL_ALL |
Gets the value for a baggage item given its key.
- Parameters
-
span | Span instance. |
key | Baggage key. |
- Returns
- If baggage key found, returns baggage value, otherwise returns empty string.
◆ base
◆ finish
void(* opentracing_span::finish) (struct opentracing_span *span) OPENTRACINGC_NONNULL_ALL |
Sets the end timestamp and finalizes span state.
With the exception of calls to context (which are always allowed), finish must be the last call made to any span instance, and to do otherwise leads to undefined behavior.
- Parameters
-
- See also
- context
◆ finish_with_options
Like finish() but with explicit control over timestamps and log data.
- Parameters
-
span | Span instance. |
options | Options to override in span completion. |
- See also
- finish
◆ log_fields
Record key:value logging data about a span.
- Parameters
-
span | Span instance. |
fields | Array of log fields. Values must be copied from argument. Caller must free fields when finished using them. |
num_fields | Number of log fields. |
- See also
- finish_with_options
◆ set_baggage_item
void(* opentracing_span::set_baggage_item) (struct opentracing_span *span, const char *key, const char *value) OPENTRACINGC_NONNULL_ALL |
Sets a key:value pair on this span and its span context that also propagates to descendants of this span.
set_baggage_item() enables powerful functionality given a full-stack opentracing integration (e.g. arbitrary application data from a mobile app can make it, transparently, all the way into the depths of a storage system), and with it some powerful costs: use this feature with care.
- Attention
- set_baggage_item() will only propagate baggage items to future causal descendants of the associated span.
-
Use this thoughtfully and with care. Every key and value is copied into every local and remote child of the associated span, and that can add up to a lot of network and CPU overhead.
- Parameters
-
span | Span instance. |
key | Baggage key. |
value | Baggage value. |
◆ set_operation_name
void(* opentracing_span::set_operation_name) (struct opentracing_span *span, const char *operation_name) OPENTRACINGC_NONNULL_ALL |
Sets or changes the operation name.
- Parameters
-
span | Span instance. |
operation_name | New operation name. |
◆ set_tag
Adds a tag to the span.
If there is a pre-existing tag set for key
, it is overwritten. Tag values can be numeric types, strings, or bools. The behavior of other tag value types is undefined at the OpenTracing level. If a tracing system does not know how to handle a particular value type, it may ignore the tag, but shall not panic.
- Parameters
-
span | Span instance. |
key | Tag key. Value copied into new allocated string. |
value | Tag value. Value copied into opentracing_value. |
◆ span_context
Yields the opentracing_span_context for this span.
Note that the return value of context is still valid after a call to finish, as is a call to span_context after a call to finish.
- Parameters
-
- Returns
- Span context associated with this span.
- See also
- finish
◆ tracer
Provides access to the tracer that created this span.
- Parameters
-
- Returns
- Tracer instance that created this span.
The documentation for this struct was generated from the following file: