summaryrefslogtreecommitdiffstats
path: root/src/blkin/blkin-lib/zipkin_trace.h
blob: 2a72d47bd2c46cd5db5d1e4eb99086bbee934d16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/*
 * Zipkin lttng-ust tracepoint provider.
 */

#undef TRACEPOINT_PROVIDER
#define TRACEPOINT_PROVIDER zipkin

#undef TRACEPOINT_INCLUDE
#define TRACEPOINT_INCLUDE "./zipkin_trace.h"

#if !defined(_ZIPKIN_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
#define _ZIPKIN_H

#include <lttng/tracepoint.h>

TRACEPOINT_EVENT(
	zipkin,
	keyval_string,
	TP_ARGS(const char *, trace_name, const char *, service,
		int, port, const char *, ip, long, trace,
		long, span, long, parent_span,
		const char *, key, const char *, val ),

	TP_FIELDS(
		/*
		 * Each span has a name mentioned on it in the UI
		 * This is the trace name
		 */
		ctf_string(trace_name, trace_name)
		/*
		 * Each trace takes place in a specific machine-endpoint
		 * This is identified by a name, a port number and an ip
		 */
		ctf_string(service_name, service)
		ctf_integer(int, port_no, port)
		ctf_string(ip, ip)
		/*
		 * According to the tracing semantics each trace should have
		 * a trace id, a span id and a parent span id
		 */
		ctf_integer(long, trace_id, trace)
		ctf_integer(long, span_id, span)
		ctf_integer(long, parent_span_id, parent_span)
		/*
		 * The following is the real annotated information
		 */
		ctf_string(key, key)
		ctf_string(val, val)
		)
	)
TRACEPOINT_LOGLEVEL(
	zipkin,
	keyval_string,
	TRACE_WARNING)

/*
 * This tracepoint allows for integers to come out keyval
 */

TRACEPOINT_EVENT(
	zipkin,
	keyval_integer,
	TP_ARGS(const char *, trace_name, const char *, service,
		int, port, const char *, ip, long, trace,
		long, span, long, parent_span,
		const char *, key, int64_t, val ),

	TP_FIELDS(
		/*
		 * Each span has a name mentioned on it in the UI
		 * This is the trace name
		 */
		ctf_string(trace_name, trace_name)
		/*
		 * Each trace takes place in a specific machine-endpoint
		 * This is identified by a name, a port number and an ip
		 */
		ctf_string(service_name, service)
		ctf_integer(int, port_no, port)
		ctf_string(ip, ip)
		/*
		 * According to the tracing semantics each trace should have
		 * a trace id, a span id and a parent span id
		 */
		ctf_integer(long, trace_id, trace)
		ctf_integer(long, span_id, span)
		ctf_integer(long, parent_span_id, parent_span)
		/*
		 * The following is the real annotated information
		 */
		ctf_string(key, key)
		ctf_integer(int64_t, val, val)
		)
	)
TRACEPOINT_LOGLEVEL(
	zipkin,
	keyval_integer,
	TRACE_WARNING)
/*
 * In this event we follow the same semantics but we trace timestamp
 * annotations
 */

TRACEPOINT_EVENT(
	zipkin,
	timestamp,
	TP_ARGS(const char *, trace_name, const char *, service,
		int, port, const char *, ip, long, trace,
		long, span, long, parent_span,
		const char *, event),

	TP_FIELDS(
		ctf_string(trace_name, trace_name)
		ctf_string(service_name, service)
		ctf_integer(int, port_no, port)
		ctf_string(ip, ip)
		ctf_integer(long, trace_id, trace)
		ctf_integer(long, span_id, span)
		ctf_integer(long, parent_span_id, parent_span)
		ctf_string(event, event)
		)
	)
TRACEPOINT_LOGLEVEL(
	zipkin,
	timestamp,
	TRACE_WARNING)
#endif /* _ZIPKIN_H */

#include <lttng/tracepoint-event.h>