18 #if !defined(LCB_TRACING_H) && defined(LCB_TRACING) 42 typedef lcb::trace::Span lcbtrace_SPAN;
45 typedef struct lcbtrace_SPAN_Cdummy lcbtrace_SPAN;
51 #define LCBTRACE_F_THRESHOLD 0x01 108 LCBTRACE_REF_NONE = 0,
109 LCBTRACE_REF_CHILD_OF = 1,
110 LCBTRACE_REF_FOLLOWS_FROM,
115 lcbtrace_REF_TYPE type;
120 #define LCBTRACE_NOW 0 203 #define LCBTRACE_OP_REQUEST_ENCODING "request_encoding" 204 #define LCBTRACE_OP_DISPATCH_TO_SERVER "dispatch_to_server" 205 #define LCBTRACE_OP_RESPONSE_DECODING "response_decoding" 207 #define LCBTRACE_OP_ADD "add" 208 #define LCBTRACE_OP_APPEND "append" 209 #define LCBTRACE_OP_COUNTER "counter" 210 #define LCBTRACE_OP_GET "get" 211 #define LCBTRACE_OP_GET_FROM_REPLICA "get_from_replica" 212 #define LCBTRACE_OP_INSERT "insert" 213 #define LCBTRACE_OP_OBSERVE_CAS "observe_cas" 214 #define LCBTRACE_OP_OBSERVE_CAS_ROUND "observe_cas_round" 215 #define LCBTRACE_OP_OBSERVE_SEQNO "observe_seqno" 216 #define LCBTRACE_OP_PREPEND "prepend" 217 #define LCBTRACE_OP_REMOVE "remove" 218 #define LCBTRACE_OP_REPLACE "replace" 219 #define LCBTRACE_OP_TOUCH "touch" 220 #define LCBTRACE_OP_UNLOCK "unlock" 221 #define LCBTRACE_OP_UPSERT "upsert" 222 #define LCBTRACE_OP_UPSERT "upsert" 224 #define LCBTRACE_OP_STORE2NAME(code) \ 227 : (code == LCB_PREPEND) ? LCBTRACE_OP_PREPEND : (code == LCB_APPEND) ? LCBTRACE_OP_APPEND : LCBTRACE_OP_UPSERT 229 #define LCBTRACE_TAG_DB_TYPE "db.type" 230 #define LCBTRACE_TAG_SPAN_KIND "span.kind" 234 #define LCBTRACE_TAG_DB_INSTANCE "db.instance" 239 #define LCBTRACE_TAG_COMPONENT "component" 243 #define LCBTRACE_TAG_OPERATION_ID "couchbase.operation_id" 248 #define LCBTRACE_TAG_SERVICE "couchbase.service" 249 #define LCBTRACE_TAG_SERVICE_KV "kv" 250 #define LCBTRACE_TAG_SERVICE_VIEW "view" 251 #define LCBTRACE_TAG_SERVICE_N1QL "n1ql" 252 #define LCBTRACE_TAG_SERVICE_SEARCH "search" 253 #define LCBTRACE_TAG_SERVICE_ANALYTICS "analytics" 255 #define LCBTRACE_TAG_LOCAL_ID "couchbase.local_id" 260 #define LCBTRACE_TAG_LOCAL_ADDRESS "local.address" 265 #define LCBTRACE_TAG_PEER_ADDRESS "peer.address" 272 #define LCBTRACE_TAG_PEER_LATENCY "peer.latency" 416 #define LCB_CMD_SET_TRACESPAN(cmd, span) \ 418 (cmd)->_hashkey.type = LCB_KV_TRACESPAN; \ 419 (cmd)->_hashkey.contig.bytes = span; \ 427 void (*report)(
void *state, lcbtrace_SPAN *span);
lcb_U64 lcbtrace_span_get_finish_ts(lcbtrace_SPAN *span)
Get finish timestamp of the span.
void lcbtrace_span_add_tag_uint64(lcbtrace_SPAN *span, const char *name, lcb_U64 value)
Add integer tag to span.
lcb_error_t lcbtrace_span_get_tag_uint64(lcbtrace_SPAN *span, const char *name, lcb_U64 *value)
Get value of the integer tag of the span.
void lcbtrace_span_add_tag_str(lcbtrace_SPAN *span, const char *name, const char *value)
Add string tag to span.
void(* destructor)(struct lcbtrace_TRACER *tracer)
destructor function or NULL, if it is not necessary
Definition: tracing.h:61
lcb_U64 lcbtrace_now(void)
Get current timestamp.
Tracer interface.
Definition: tracing.h:57
void lcbtrace_span_add_tag_double(lcbtrace_SPAN *span, const char *name, double value)
Add double tag to span.
lcbtrace_TRACER * lcb_get_tracer(lcb_t instance)
Get current tracer of the connection.
void lcbtrace_destroy(lcbtrace_TRACER *tracer)
Destroy tracer object.
Definition: tracing.h:425
lcb_U64 lcbtrace_span_get_span_id(lcbtrace_SPAN *span)
Get ID of the span.
lcb_error_t lcbtrace_span_get_tag_str(lcbtrace_SPAN *span, const char *name, char **value, size_t *nvalue)
Get value of the string tag of the span.
lcb_U64 lcbtrace_span_get_trace_id(lcbtrace_SPAN *span)
Get trace ID of the span.
int lcbtrace_span_is_orphaned(lcbtrace_SPAN *span)
Check if the span is orphaned.
void lcb_set_tracer(lcb_t instance, lcbtrace_TRACER *tracer)
Set current tracer for the connection.
lcb_error_t lcbtrace_span_get_tag_double(lcbtrace_SPAN *span, const char *name, double *value)
Get value of the double tag of the span.
void lcbtrace_span_add_tag_bool(lcbtrace_SPAN *span, const char *name, int value)
Add boolean tag to span.
lcb_U64 flags
tracer-specific flags
Definition: tracing.h:59
lcb_U64 lcbtrace_span_get_start_ts(lcbtrace_SPAN *span)
Get start timestamp of the span.
struct lcb_st * lcb_t
Library handle representing a connection to a cluster and its data buckets.
Definition: couchbase.h:41
lcb_error_t
Error codes returned by the library.
Definition: error.h:584
void * cookie
opaque pointer (e.g.
Definition: tracing.h:60
lcbtrace_SPAN * lcbtrace_span_get_parent(lcbtrace_SPAN *span)
Get parent span of the span.
lcb_U16 version
version of the structure, current value is 0
Definition: tracing.h:58
void lcbtrace_span_finish(lcbtrace_SPAN *span, lcb_U64 now)
Mark the span as finished.
const char * lcbtrace_span_get_operation(lcbtrace_SPAN *span)
Get operation code of the span.
lcbtrace_TRACER * lcbtrace_new(lcb_t instance, lcb_U64 flags)
Create default libcouchbase tracer instance.
lcbtrace_SPAN * lcbtrace_span_start(lcbtrace_TRACER *tracer, const char *operation, lcb_U64 now, lcbtrace_REF *ref)
Start span.
lcb_error_t lcbtrace_span_get_tag_bool(lcbtrace_SPAN *span, const char *name, int *value)
Get value of the boolean tag of the span.