]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
1 | #ifndef OPENTRACING_EXT_TAGS_H |
2 | #define OPENTRACING_EXT_TAGS_H | |
3 | ||
4 | #include <opentracing/string_view.h> | |
5 | #include <opentracing/symbols.h> | |
6 | #include <opentracing/version.h> | |
7 | ||
8 | namespace opentracing { | |
9 | BEGIN_OPENTRACING_ABI_NAMESPACE | |
10 | namespace ext { | |
11 | // The following tags are described in greater detail at the following url: | |
12 | // https://github.com/opentracing/specification/blob/master/semantic_conventions.md | |
13 | // | |
14 | // Here we define standard names for tags that can be added to spans by the | |
15 | // instrumentation code. The actual tracing systems are not required to | |
16 | // retain these as tags in the stored spans if they have other means of | |
17 | // representing the same data. For example, the SPAN_KIND='server' can be | |
18 | // inferred from a Zipkin span by the presence of ss/sr annotations. | |
19 | ||
20 | // --------------------------------------------------------------------------- | |
21 | // span_kind hints at relationship between spans, e.g. client/server | |
22 | // --------------------------------------------------------------------------- | |
23 | OPENTRACING_API extern const opentracing::string_view span_kind; | |
24 | ||
25 | // Marks a span representing the client-side of an RPC or other remote call | |
26 | OPENTRACING_API extern const opentracing::string_view span_kind_rpc_client; | |
27 | ||
28 | // Marks a span representing the server-side of an RPC or other remote call | |
29 | OPENTRACING_API extern const opentracing::string_view span_kind_rpc_server; | |
30 | ||
31 | // --------------------------------------------------------------------------- | |
32 | // error indicates whether a Span ended in an error state. | |
33 | // --------------------------------------------------------------------------- | |
34 | OPENTRACING_API extern const opentracing::string_view error; | |
35 | ||
36 | // --------------------------------------------------------------------------- | |
37 | // component (string) ia s low-cardinality identifier of the module, library, | |
38 | // or package that is generating a span. | |
39 | // --------------------------------------------------------------------------- | |
40 | OPENTRACING_API extern const opentracing::string_view component; | |
41 | ||
42 | // --------------------------------------------------------------------------- | |
43 | // sampling_priority (uint16) determines the priority of sampling this Span. | |
44 | // --------------------------------------------------------------------------- | |
45 | OPENTRACING_API extern const opentracing::string_view sampling_priority; | |
46 | ||
47 | // --------------------------------------------------------------------------- | |
48 | // peer_* tags can be emitted by either client-side of server-side to describe | |
49 | // the other side/service in a peer-to-peer communications, like an RPC call. | |
50 | // --------------------------------------------------------------------------- | |
51 | // peer_service (string) records the service name of the peer | |
52 | OPENTRACING_API extern const opentracing::string_view peer_service; | |
53 | ||
54 | // peer_hostname (string) records the host name of the peer | |
55 | OPENTRACING_API extern const opentracing::string_view peer_hostname; | |
56 | ||
57 | // peer_address (string) suitable for use in a networking client library. | |
58 | // This may be a "ip:port", a bare "hostname", a FQDN, or even a | |
59 | // JDBC substring like "mysql://prod-db:3306" | |
60 | OPENTRACING_API extern const opentracing::string_view peer_address; | |
61 | ||
62 | // peer_host_ipv4 (uint32) records IP v4 host address of the peer | |
63 | OPENTRACING_API extern const opentracing::string_view peer_host_ipv4; | |
64 | ||
65 | // peer_host_ipv6 (string) records IP v6 host address of the peer | |
66 | OPENTRACING_API extern const opentracing::string_view peer_host_ipv6; | |
67 | ||
68 | // peer_port (uint16) records port number of the peer | |
69 | OPENTRACING_API extern const opentracing::string_view peer_port; | |
70 | ||
71 | // --------------------------------------------------------------------------- | |
72 | // HTTP tags | |
73 | // --------------------------------------------------------------------------- | |
74 | ||
75 | // http_url (string) should be the URL of the request being handled in this | |
76 | // segment of the trace, in standard URI format. The protocol is optional. | |
77 | OPENTRACING_API extern const opentracing::string_view http_url; | |
78 | ||
79 | // http_method (string) is the HTTP method of the request. | |
80 | // Both upper/lower case values are allowed. | |
81 | OPENTRACING_API extern const opentracing::string_view http_method; | |
82 | ||
83 | // http_status_code (int) is the numeric HTTP status code (200, 404, etc) | |
84 | // of the HTTP response. | |
85 | OPENTRACING_API extern const opentracing::string_view http_status_code; | |
86 | ||
87 | // --------------------------------------------------------------------------- | |
88 | // DATABASE tags | |
89 | // --------------------------------------------------------------------------- | |
90 | ||
91 | // database_instance (string) The database instance name. E.g., In java, if | |
92 | // the jdbc.url="jdbc:mysql://127.0.0.1:3306/customers", the instance | |
93 | // name is "customers" | |
94 | OPENTRACING_API extern const opentracing::string_view database_instance; | |
95 | ||
96 | // database_statement (string) A database statement for the given database | |
97 | // type. E.g., for db.type="SQL", "SELECT * FROM user_table"; | |
98 | // for db.type="redis", "SET mykey 'WuValue'". | |
99 | OPENTRACING_API extern const opentracing::string_view database_statement; | |
100 | ||
101 | // database_type (string) For any SQL database, "sql". For others, | |
102 | // the lower-case database category, e.g. "cassandra", "hbase", or "redis". | |
103 | OPENTRACING_API extern const opentracing::string_view database_type; | |
104 | ||
105 | // database_user (string) Username for accessing database. E.g., | |
106 | // "readonly_user" or "reporting_user" | |
107 | OPENTRACING_API extern const opentracing::string_view database_user; | |
108 | ||
109 | // --------------------------------------------------------------------------- | |
110 | // message_bus tags | |
111 | // --------------------------------------------------------------------------- | |
112 | ||
113 | // message_bus_destination (string) An address at which messages can be | |
114 | // exchanged. E.g. A Kafka record has an associated "topic name" that can | |
115 | // be extracted by the instrumented producer or consumer and stored | |
116 | // using this tag. | |
117 | OPENTRACING_API extern const opentracing::string_view message_bus_destination; | |
118 | } // namespace ext | |
119 | END_OPENTRACING_ABI_NAMESPACE | |
120 | } // namespace opentracing | |
121 | ||
122 | #endif // OPENTRACING_EXT_TAGS_H |