41typedef lcb::trace::Span lcbtrace_SPAN;
44typedef struct lcbtrace_SPAN_Cdummy lcbtrace_SPAN;
50#define LCBTRACE_F_THRESHOLD 0x01
55#define LCBTRACE_F_EXTERNAL 0x02
61 LCBTRACE_SERVICE_KV = 0,
62 LCBTRACE_SERVICE_QUERY,
63 LCBTRACE_SERVICE_VIEW,
64 LCBTRACE_SERVICE_SEARCH,
65 LCBTRACE_SERVICE_ANALYTICS,
83 void *(*start_span)(
struct lcbtrace_TRACER *tracer,
const char *name,
void *parent);
84 void (*end_span)(
void *span);
85 void (*destroy_span)(
void *span);
86 void (*add_tag_string)(
void *span,
const char *name,
const char *value,
size_t value_len);
87 void (*add_tag_uint64)(
void *span,
const char *name, uint64_t value);
131 LCBTRACE_REF_NONE = 0,
132 LCBTRACE_REF_CHILD_OF = 1,
133 LCBTRACE_REF_FOLLOWS_FROM,
138 lcbtrace_REF_TYPE type;
143#define LCBTRACE_NOW 0
185 lcbtrace_SPAN **lcbspan);
202int lcbtrace_span_should_finish(lcbtrace_SPAN *span);
378#define LCBTRACE_OP_REQUEST_ENCODING "request_encoding"
379#define LCBTRACE_OP_DISPATCH_TO_SERVER "dispatch"
380#define LCBTRACE_OP_RESPONSE_DECODING "response_decoding"
382#define LCBTRACE_OP_INSERT "insert"
383#define LCBTRACE_OP_APPEND "append"
384#define LCBTRACE_OP_COUNTER "counter"
385#define LCBTRACE_OP_GET "get"
386#define LCBTRACE_OP_GET_FROM_REPLICA "get_from_replica"
387#define LCBTRACE_OP_INSERT "insert"
388#define LCBTRACE_OP_OBSERVE_CAS "observe_cas"
389#define LCBTRACE_OP_OBSERVE_CAS_ROUND "observe_cas_round"
390#define LCBTRACE_OP_OBSERVE_SEQNO "observe_seqno"
391#define LCBTRACE_OP_PREPEND "prepend"
392#define LCBTRACE_OP_REMOVE "remove"
393#define LCBTRACE_OP_REPLACE "replace"
394#define LCBTRACE_OP_TOUCH "touch"
395#define LCBTRACE_OP_UNLOCK "unlock"
396#define LCBTRACE_OP_UPSERT "upsert"
397#define LCBTRACE_OP_EXISTS "exists"
398#define LCBTRACE_OP_LOOKUPIN "lookup_in"
399#define LCBTRACE_OP_MUTATEIN "mutate_in"
400#define LCBTRACE_OP_QUERY "query"
401#define LCBTRACE_OP_ANALYTICS "analytics"
402#define LCBTRACE_OP_SEARCH "search"
403#define LCBTRACE_OP_VIEW "views"
405#define LCBTRACE_TAG_SPAN_KIND "span.kind"
409#define LCBTRACE_TAG_DB_INSTANCE "db.name"
414#define LCBTRACE_TAG_COMPONENT "db.couchbase.component"
418#define LCBTRACE_TAG_OPERATION_ID "db.couchbase.operation_id"
423#define LCBTRACE_TAG_SERVICE "db.couchbase.service"
424#define LCBTRACE_TAG_SERVICE_KV "kv"
425#define LCBTRACE_TAG_SERVICE_VIEW "views"
426#define LCBTRACE_TAG_SERVICE_N1QL "query"
427#define LCBTRACE_TAG_SERVICE_SEARCH "search"
428#define LCBTRACE_TAG_SERVICE_ANALYTICS "analytics"
434#define LCBTRACE_TAG_LOCAL_ID "db.couchbase.local_id"
440#define LCBTRACE_TAG_LOCAL_ADDRESS "net.host.name"
445#define LCBTRACE_TAG_LOCAL_PORT "net.host.port"
451#define LCBTRACE_TAG_PEER_ADDRESS "net.peer.name"
456#define LCBTRACE_TAG_PEER_PORT "net.peer.port"
460#define LCBTRACE_TAG_PEER_LATENCY "db.couchbase.server_duration"
464#define LCBTRACE_TAG_SCOPE "db.couchbase.scope"
468#define LCBTRACE_TAG_COLLECTION "db.couchbase.collection"
473#define LCBTRACE_TAG_STATEMENT "db.statement"
477#define LCBTRACE_TAG_OPERATION "db.operation"
481#define LCBTRACE_TAG_DURABILITY "db.couchbase.durability"
485#define LCBTRACE_TAG_RETRIES "db.couchbase.retries"
490#define LCBTRACE_TAG_SYSTEM "db.system"
495#define LCBTRACE_TAG_TRANSPORT "net.transport"
638#define LCB_CMD_SET_TRACESPAN(cmd, span) \
640 (cmd)->pspan = span; \
648 void (*report)(
void *state, lcbtrace_SPAN *span);
lcb_STATUS
Error codes returned by the library.
Definition error.h:213
struct lcb_st lcb_INSTANCE
Library handle representing a connection to a cluster and its data buckets.
Definition couchbase.h:35
lcb_U16 version
version of the structure, current value is 0
Definition tracing.h:74
lcb_U64 flags
tracer-specific flags
Definition tracing.h:75
void * cookie
opaque pointer (e.g.
Definition tracing.h:76
void(* destructor)(struct lcbtrace_TRACER *tracer)
destructor function or NULL, if it is not necessary
Definition tracing.h:77
lcb_STATUS lcbtrace_span_get_is_encoding(lcbtrace_SPAN *span, int *encoding)
Get encoding flag on span.
lcb_STATUS lcbtrace_span_set_is_dispatch(lcbtrace_SPAN *span, int dispatch)
Set dispatch flag on span.
lcb_U64 lcbtrace_now(void)
Get current timestamp.
int lcbtrace_span_is_orphaned(lcbtrace_SPAN *span)
Check if the span is orphaned.
lcb_U64 lcbtrace_span_get_finish_ts(lcbtrace_SPAN *span)
Get finish timestamp of the span.
void lcbtrace_span_add_tag_bool(lcbtrace_SPAN *span, const char *name, int value)
Add boolean tag to span.
lcb_U64 lcbtrace_span_get_span_id(lcbtrace_SPAN *span)
Get ID of the span.
void lcbtrace_span_add_tag_uint64(lcbtrace_SPAN *span, const char *name, lcb_U64 value)
Add integer tag to span.
lcb_STATUS lcbtrace_span_get_is_dispatch(lcbtrace_SPAN *span, int *dispatch)
Get dispatch flag on span.
lcb_STATUS lcbtrace_span_get_service(lcbtrace_SPAN *span, lcbtrace_SERVICE *svc)
Get the service for the span.
lcbtrace_SPAN * lcbtrace_span_get_parent(lcbtrace_SPAN *span)
Get parent span of the span.
lcb_STATUS lcbtrace_span_get_tag_uint64(lcbtrace_SPAN *span, const char *name, lcb_U64 *value)
Get value of the integer tag of the span.
lcbtrace_SERVICE
Service the span is associated with.
Definition tracing.h:60
void lcb_set_tracer(lcb_INSTANCE *instance, lcbtrace_TRACER *tracer)
Set current tracer for the connection.
lcb_STATUS lcbtrace_span_get_is_outer(lcbtrace_SPAN *span, int *outer)
Get outer flag on span.
void lcbtrace_span_add_tag_double(lcbtrace_SPAN *span, const char *name, double value)
Add double tag to span.
void lcbtrace_destroy(lcbtrace_TRACER *tracer)
Destroy tracer object.
lcb_STATUS 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_STATUS lcbtrace_span_get_tag_double(lcbtrace_SPAN *span, const char *name, double *value)
Get value of the double tag of the span.
lcb_STATUS lcbtrace_span_set_is_outer(lcbtrace_SPAN *span, int outer)
Set outer flag on span.
lcb_U64 lcbtrace_span_get_start_ts(lcbtrace_SPAN *span)
Get start timestamp of the span.
lcb_U64 lcbtrace_span_get_trace_id(lcbtrace_SPAN *span)
Get trace ID of the span.
const char * lcbtrace_span_get_operation(lcbtrace_SPAN *span)
Get operation code of the span.
void lcbtrace_span_add_tag_str(lcbtrace_SPAN *span, const char *name, const char *value)
Add string tag to span.
void lcbtrace_span_finish(lcbtrace_SPAN *span, lcb_U64 now)
Mark the span as finished.
lcb_STATUS lcbtrace_span_wrap(lcbtrace_TRACER *tracer, const char *opname, uint64_t start, void *external_span, lcbtrace_SPAN **lcbspan)
Wrap external span.
lcbtrace_SPAN * lcbtrace_span_start(lcbtrace_TRACER *tracer, const char *operation, lcb_U64 now, lcbtrace_REF *ref)
Start span.
lcb_STATUS lcbtrace_span_set_is_encode(lcbtrace_SPAN *span, int encode)
Set encoding flag on span.
lcbtrace_TRACER * lcb_get_tracer(lcb_INSTANCE *instance)
Get current tracer of the connection.
lcb_STATUS lcbtrace_span_set_service(lcbtrace_SPAN *span, lcbtrace_SERVICE svc)
Set the service for the span.
lcb_STATUS lcbtrace_span_get_tag_bool(lcbtrace_SPAN *span, const char *name, int *value)
Get value of the boolean tag of the span.
lcbtrace_TRACER * lcbtrace_new(lcb_INSTANCE *instance, lcb_U64 flags)
Create default libcouchbase tracer instance.
Tracer interface.
Definition tracing.h:73