opentracing-c
OpenTracing C API
|
Tracer interface. More...
#include <opentracing-c/tracer.h>
Data Fields | |
opentracing_destructible | base |
Base class member. More... | |
void(* | close )(struct opentracing_tracer *tracer) OPENTRACINGC_NONNULL_ALL |
Close the tracer. More... | |
opentracing_span *(* | start_span )(struct opentracing_tracer *tracer, const char *operation_name) OPENTRACINGC_NONNULL_ALL |
Equivalent to calling start_span_with_options with options as NULL. More... | |
opentracing_span *(* | start_span_with_options )(struct opentracing_tracer *tracer, const char *operation_name, const opentracing_start_span_options *options) OPENTRACINGC_NONNULL(1 |
Start a new span with provided options. More... | |
opentracing_span *(*) opentracing_propagation_error_code(* | inject_text_map )(struct opentracing_tracer *tracer, opentracing_text_map_writer *carrier, const opentracing_span_context *span_context) OPENTRACINGC_NONNULL_ALL |
Inject span context into text map carrier. More... | |
opentracing_propagation_error_code(* | inject_http_headers )(struct opentracing_tracer *tracer, opentracing_http_headers_writer *carrier, const opentracing_span_context *span_context) OPENTRACINGC_NONNULL_ALL |
Inject span context into HTTP headers carrier. More... | |
opentracing_propagation_error_code(* | inject_binary )(struct opentracing_tracer *tracer, int(*callback)(void *, const char *, size_t), void *arg, const opentracing_span_context *span_context) OPENTRACINGC_NONNULL(1 |
Inject span context into binary carrier. More... | |
opentracing_propagation_error_code(*) opentracing_propagation_error_code(* | inject_custom )(struct opentracing_tracer *tracer, opentracing_custom_carrier_writer *carrier, const opentracing_span_context *span_context) OPENTRACINGC_NONNULL_ALL |
Inject span context into custom carrier. More... | |
opentracing_propagation_error_code(* | extract_text_map )(struct opentracing_tracer *tracer, opentracing_text_map_reader *carrier, opentracing_span_context **span_context) OPENTRACINGC_NONNULL_ALL |
Extract span context from carrier. More... | |
opentracing_propagation_error_code(* | extract_http_headers )(struct opentracing_tracer *tracer, opentracing_http_headers_reader *carrier, opentracing_span_context **span_context) OPENTRACINGC_NONNULL_ALL |
Extract span context from carrier. More... | |
opentracing_propagation_error_code(* | extract_binary )(struct opentracing_tracer *tracer, int(*callback)(void *, char *, size_t), void *arg, opentracing_span_context **span_context) OPENTRACINGC_NONNULL(1 |
Extract span context from carrier. More... | |
opentracing_propagation_error_code(*) opentracing_propagation_error_code(* | extract_custom )(struct opentracing_tracer *tracer, opentracing_custom_carrier_reader *carrier, opentracing_span_context **span_context) OPENTRACINGC_NONNULL_ALL |
Extract span context from carrier. More... | |
![]() | |
void(* | destroy )(struct opentracing_destructible *destructible) OPENTRACINGC_NONNULL_ALL |
Destructor to clean up any resources allocated to the instance. More... | |
Tracer interface.
opentracing_destructible opentracing_tracer::base |
Base class member.
void(* opentracing_tracer::close) (struct opentracing_tracer *tracer) OPENTRACINGC_NONNULL_ALL |
Close the tracer.
This may do nothing, flush pending spans, or whatever else a tracing implementation decides close should mean. If not called before the destruction of the tracer, the tracer must perform the equivalent of close upon destruction.
tracer | Tracer instance. |
opentracing_propagation_error_code(* opentracing_tracer::extract_binary) (struct opentracing_tracer *tracer, int(*callback)(void *, char *, size_t), void *arg, opentracing_span_context **span_context) OPENTRACINGC_NONNULL(1 |
Extract span context from carrier.
tracer | Tracer instance. | |
callback | Binary carrier callback. Passed user-defined argument, data buffer, and data buffer length. May be called multiple times to provide data from binary stream. Must return number of bytes read, with a negative number indicating an error, and zero indicating end of stream. | |
arg | Binary carrier callback argument. | |
[out] | span_context | Span context pointer to return decoded span. Set to NULL on propagation failure or out of memory. |
opentracing_propagation_error_code(*) opentracing_propagation_error_code(* opentracing_tracer::extract_custom) (struct opentracing_tracer *tracer, opentracing_custom_carrier_reader *carrier, opentracing_span_context **span_context) OPENTRACINGC_NONNULL_ALL |
Extract span context from carrier.
tracer | Tracer instance. | |
carrier | Custom carrier. | |
[out] | span_context | Span context pointer to return decoded span. Set to NULL on propagation failure or out of memory. |
opentracing_propagation_error_code(* opentracing_tracer::extract_http_headers) (struct opentracing_tracer *tracer, opentracing_http_headers_reader *carrier, opentracing_span_context **span_context) OPENTRACINGC_NONNULL_ALL |
Extract span context from carrier.
tracer | Tracer instance. | |
carrier | HTTP headers carrier. | |
[out] | span_context | Span context pointer to return decoded span. Set to NULL on propagation failure or out of memory. |
opentracing_propagation_error_code(* opentracing_tracer::extract_text_map) (struct opentracing_tracer *tracer, opentracing_text_map_reader *carrier, opentracing_span_context **span_context) OPENTRACINGC_NONNULL_ALL |
Extract span context from carrier.
tracer | Tracer instance. | |
carrier | Text map carrier. | |
[out] | span_context | Span context pointer to return decoded span. Set to NULL on propagation failure or out of memory. |
opentracing_propagation_error_code(* opentracing_tracer::inject_binary) (struct opentracing_tracer *tracer, int(*callback)(void *, const char *, size_t), void *arg, const opentracing_span_context *span_context) OPENTRACINGC_NONNULL(1 |
Inject span context into binary carrier.
tracer | Tracer instance. |
callback | Binary carrier callback. Passed a user-defined argument, the binary data chunk, and the length of the binary data chunk. May be called multiple times in a row to write entire span context. Return non-zero to indicate write error. |
arg | Binary carrier callback argument. |
span_context | Span context to serialize to carrier. |
opentracing_propagation_error_code(*) opentracing_propagation_error_code(* opentracing_tracer::inject_custom) (struct opentracing_tracer *tracer, opentracing_custom_carrier_writer *carrier, const opentracing_span_context *span_context) OPENTRACINGC_NONNULL_ALL |
Inject span context into custom carrier.
tracer | Tracer instance. |
carrier | Custom carrier. |
span_context | Span context to serialize to carrier. |
opentracing_propagation_error_code(* opentracing_tracer::inject_http_headers) (struct opentracing_tracer *tracer, opentracing_http_headers_writer *carrier, const opentracing_span_context *span_context) OPENTRACINGC_NONNULL_ALL |
Inject span context into HTTP headers carrier.
tracer | Tracer instance. |
carrier | HTTP headers carrier. |
span_context | Span context to serialize to carrier. |
opentracing_span*(*) opentracing_propagation_error_code(* opentracing_tracer::inject_text_map) (struct opentracing_tracer *tracer, opentracing_text_map_writer *carrier, const opentracing_span_context *span_context) OPENTRACINGC_NONNULL_ALL |
Inject span context into text map carrier.
tracer | Tracer instance. |
carrier | Text map carrier. |
span_context | Span context to serialize to carrier. |
opentracing_span*(* opentracing_tracer::start_span) (struct opentracing_tracer *tracer, const char *operation_name) OPENTRACINGC_NONNULL_ALL |
Equivalent to calling start_span_with_options with options as NULL.
tracer | Tracer instance. |
operation_name | Name of operation associated with span. |
opentracing_span*(* opentracing_tracer::start_span_with_options) (struct opentracing_tracer *tracer, const char *operation_name, const opentracing_start_span_options *options) OPENTRACINGC_NONNULL(1 |
Start a new span with provided options.
tracer | Tracer instance. |
operation_name | Name of operation associated with span. |
options | Options to override default span initialization values. |