Skip to content

Commit d289a7f

Browse files
committed
WIP
1 parent 8eabd8a commit d289a7f

File tree

76 files changed

+2517
-3507
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+2517
-3507
lines changed

api/include/opentelemetry/semconv/attributes/client_attributes.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
/*
42
* Copyright The OpenTelemetry Authors
53
* SPDX-License-Identifier: Apache-2.0
@@ -23,19 +21,20 @@ namespace client
2321

2422
/**
2523
* Client address - domain name if available without reverse DNS lookup; otherwise, IP address or
26-
* Unix domain socket name. Note: When observed from the server side, and when communicating through
24+
* Unix domain socket name. <p> When observed from the server side, and when communicating through
2725
* an intermediary, @code client.address @endcode SHOULD represent the client address behind any
2826
* intermediaries, for example proxies, if it's available.
2927
*/
30-
static const char *kClientAddress = "client.address";
28+
static constexpr const char *kClientAddress = "client.address";
3129

3230
/**
3331
* Client port number.
34-
* Note: When observed from the server side, and when communicating through an intermediary, @code
32+
* <p>
33+
* When observed from the server side, and when communicating through an intermediary, @code
3534
* client.port @endcode SHOULD represent the client port behind any intermediaries, for example
3635
* proxies, if it's available.
3736
*/
38-
static const char *kClientPort = "client.port";
37+
static constexpr const char *kClientPort = "client.port";
3938

4039
} // namespace client
4140
} // namespace semconv

api/include/opentelemetry/semconv/attributes/error_attributes.h

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
/*
42
* Copyright The OpenTelemetry Authors
53
* SPDX-License-Identifier: Apache-2.0
@@ -23,7 +21,8 @@ namespace error
2321

2422
/**
2523
* Describes a class of error the operation ended with.
26-
* Note: The @code error.type @endcode SHOULD be predictable, and SHOULD have low cardinality.
24+
* <p>
25+
* The @code error.type @endcode SHOULD be predictable, and SHOULD have low cardinality.
2726
* <p>
2827
* When @code error.type @endcode is set to a type (e.g., an exception type), its
2928
* canonical class name identifying the type within the artifact SHOULD be used.
@@ -42,34 +41,15 @@ namespace error
4241
* the domain-specific set or not.</li>
4342
* </ul>
4443
*/
45-
static const char *kErrorType = "error.type";
44+
static constexpr const char *kErrorType = "error.type";
4645

47-
// DEBUG: {"brief": "Describes a class of error the operation ended with.\n", "examples":
48-
// ["timeout", "java.net.UnknownHostException", "server_certificate_invalid", "500"], "name":
49-
// "error.type", "note": "The `error.type` SHOULD be predictable, and SHOULD have low
50-
// cardinality.\n\nWhen `error.type` is set to a type (e.g., an exception type), its\ncanonical
51-
// class name identifying the type within the artifact SHOULD be used.\n\nInstrumentations SHOULD
52-
// document the list of errors they report.\n\nThe cardinality of `error.type` within one
53-
// instrumentation library SHOULD be low.\nTelemetry consumers that aggregate data from multiple
54-
// instrumentation libraries and applications\nshould be prepared for `error.type` to have high
55-
// cardinality at query time when no\nadditional filters are applied.\n\nIf the operation has
56-
// completed successfully, instrumentations SHOULD NOT set `error.type`.\n\nIf a specific domain
57-
// defines its own set of error identifiers (such as HTTP or gRPC status codes),\nit's RECOMMENDED
58-
// to:\n\n* Use a domain-specific attribute\n* Set `error.type` to capture all errors, regardless of
59-
// whether they are defined within the domain-specific set or not.\n", "requirement_level":
60-
// "recommended", "root_namespace": "error", "stability": "stable", "type": {"allow_custom_values":
61-
// true, "members": [{"brief": "A fallback error value to be used when the instrumentation doesn't
62-
// define a custom value.\n", "deprecated": none, "id": "other", "note": none, "stability":
63-
// "stable", "value": "_OTHER"}]}}
6446
namespace ErrorTypeValues
6547
{
6648
/**
6749
* A fallback error value to be used when the instrumentation doesn't define a custom value.
6850
*/
69-
// DEBUG: {"brief": "A fallback error value to be used when the instrumentation doesn't define a
70-
// custom value.\n", "deprecated": none, "id": "other", "note": none, "stability": "stable",
71-
// "value": "_OTHER"}
7251
static constexpr const char *kOther = "_OTHER";
52+
7353
} // namespace ErrorTypeValues
7454

7555
} // namespace error

api/include/opentelemetry/semconv/attributes/exception_attributes.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
/*
42
* Copyright The OpenTelemetry Authors
53
* SPDX-License-Identifier: Apache-2.0
@@ -23,7 +21,7 @@ namespace exception
2321

2422
/**
2523
* SHOULD be set to true if the exception event is recorded at a point where it is known that the
26-
* exception is escaping the scope of the span. Note: An exception is considered to have escaped (or
24+
* exception is escaping the scope of the span. <p> An exception is considered to have escaped (or
2725
* left) the scope of a span, if that span is ended while the exception is still logically "in
2826
* flight". This may be actually "in flight" in some languages (e.g. if the exception is passed to a
2927
* Context manager's @code __exit__ @endcode method in Python) but will usually be caught at the
@@ -37,24 +35,24 @@ namespace exception
3735
* since the event might have been recorded at a time where it was not
3836
* clear whether the exception will escape.
3937
*/
40-
static const char *kExceptionEscaped = "exception.escaped";
38+
static constexpr const char *kExceptionEscaped = "exception.escaped";
4139

4240
/**
4341
* The exception message.
4442
*/
45-
static const char *kExceptionMessage = "exception.message";
43+
static constexpr const char *kExceptionMessage = "exception.message";
4644

4745
/**
4846
* A stacktrace as a string in the natural representation for the language runtime. The
4947
* representation is to be determined and documented by each language SIG.
5048
*/
51-
static const char *kExceptionStacktrace = "exception.stacktrace";
49+
static constexpr const char *kExceptionStacktrace = "exception.stacktrace";
5250

5351
/**
5452
* The type of the exception (its fully-qualified class name, if applicable). The dynamic type of
5553
* the exception should be preferred over the static type in languages that support it.
5654
*/
57-
static const char *kExceptionType = "exception.type";
55+
static constexpr const char *kExceptionType = "exception.type";
5856

5957
} // namespace exception
6058
} // namespace semconv

api/include/opentelemetry/semconv/attributes/http_attributes.h

Lines changed: 32 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
/*
42
* Copyright The OpenTelemetry Authors
53
* SPDX-License-Identifier: Apache-2.0
@@ -23,7 +21,7 @@ namespace http
2321

2422
/**
2523
* HTTP request headers, @code <key> @endcode being the normalized HTTP Header name (lowercase), the
26-
* value being the header values. Note: Instrumentations SHOULD require an explicit configuration of
24+
* value being the header values. <p> Instrumentations SHOULD require an explicit configuration of
2725
* which headers are to be captured. Including all request headers can be a security risk - explicit
2826
* configuration helps avoid leaking sensitive information. The @code User-Agent @endcode header is
2927
* already captured in the @code user_agent.original @endcode attribute. Users MAY explicitly
@@ -32,11 +30,12 @@ namespace http
3230
* containing a possibly comma-concatenated string, depending on the way the HTTP library provides
3331
* access to headers.
3432
*/
35-
static const char *kHttpRequestHeader = "http.request.header";
33+
static constexpr const char *kHttpRequestHeader = "http.request.header";
3634

3735
/**
3836
* HTTP request method.
39-
* Note: HTTP request method value SHOULD be "known" to the instrumentation.
37+
* <p>
38+
* HTTP request method value SHOULD be "known" to the instrumentation.
4039
* By default, this convention defines "known" methods as the ones listed in <a
4140
* href="https://www.rfc-editor.org/rfc/rfc9110.html#name-methods">RFC9110</a> and the PATCH method
4241
* defined in <a href="https://www.rfc-editor.org/rfc/rfc5789.html">RFC5789</a>. <p> If the HTTP
@@ -53,140 +52,100 @@ static const char *kHttpRequestHeader = "http.request.header";
5352
* instrumentations that do so, MUST also set @code http.request.method_original @endcode to the
5453
* original value.
5554
*/
56-
static const char *kHttpRequestMethod = "http.request.method";
55+
static constexpr const char *kHttpRequestMethod = "http.request.method";
5756

5857
/**
5958
* Original HTTP method sent by the client in the request line.
6059
*/
61-
static const char *kHttpRequestMethodOriginal = "http.request.method_original";
60+
static constexpr const char *kHttpRequestMethodOriginal = "http.request.method_original";
6261

6362
/**
6463
* The ordinal number of request resending attempt (for any reason, including redirects).
65-
* Note: The resend count SHOULD be updated each time an HTTP request gets resent by the client,
64+
* <p>
65+
* The resend count SHOULD be updated each time an HTTP request gets resent by the client,
6666
* regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503
6767
* Server Unavailable, network issues, or any other).
6868
*/
69-
static const char *kHttpRequestResendCount = "http.request.resend_count";
69+
static constexpr const char *kHttpRequestResendCount = "http.request.resend_count";
7070

7171
/**
7272
* HTTP response headers, @code <key> @endcode being the normalized HTTP Header name (lowercase),
73-
* the value being the header values. Note: Instrumentations SHOULD require an explicit
74-
* configuration of which headers are to be captured. Including all response headers can be a
75-
* security risk - explicit configuration helps avoid leaking sensitive information. Users MAY
76-
* explicitly configure instrumentations to capture them even though it is not recommended. The
77-
* attribute value MUST consist of either multiple header values as an array of strings or a
78-
* single-item array containing a possibly comma-concatenated string, depending on the way the HTTP
79-
* library provides access to headers.
80-
*/
81-
static const char *kHttpResponseHeader = "http.response.header";
73+
* the value being the header values. <p> Instrumentations SHOULD require an explicit configuration
74+
* of which headers are to be captured. Including all response headers can be a security risk -
75+
* explicit configuration helps avoid leaking sensitive information. Users MAY explicitly configure
76+
* instrumentations to capture them even though it is not recommended. The attribute value MUST
77+
* consist of either multiple header values as an array of strings or a single-item array containing
78+
* a possibly comma-concatenated string, depending on the way the HTTP library provides access to
79+
* headers.
80+
*/
81+
static constexpr const char *kHttpResponseHeader = "http.response.header";
8282

8383
/**
8484
* <a href="https://tools.ietf.org/html/rfc7231#section-6">HTTP response status code</a>.
8585
*/
86-
static const char *kHttpResponseStatusCode = "http.response.status_code";
86+
static constexpr const char *kHttpResponseStatusCode = "http.response.status_code";
8787

8888
/**
8989
* The matched route, that is, the path template in the format used by the respective server
90-
* framework. Note: MUST NOT be populated when this is not supported by the HTTP server framework as
90+
* framework. <p> MUST NOT be populated when this is not supported by the HTTP server framework as
9191
* the route attribute should have low-cardinality and the URI path can NOT substitute it. SHOULD
9292
* include the <a href="/docs/http/http-spans.md#http-server-definitions">application root</a> if
9393
* there is one.
9494
*/
95-
static const char *kHttpRoute = "http.route";
96-
97-
// DEBUG: {"brief": "HTTP request method.", "examples": ["GET", "POST", "HEAD"], "name":
98-
// "http.request.method", "note": "HTTP request method value SHOULD be \"known\" to the
99-
// instrumentation.\nBy default, this convention defines \"known\" methods as the ones listed in
100-
// [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods)\nand the PATCH method defined
101-
// in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html).\n\nIf the HTTP request method is not
102-
// known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER`.\n\nIf the
103-
// HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST
104-
// provide a way to override\nthe list of known HTTP methods. If this override is done via
105-
// environment variable, then the environment variable MUST be
106-
// named\nOTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of
107-
// case-sensitive known HTTP methods\n(this list MUST be a full override of the default known
108-
// method, it is not a list of known methods in addition to the defaults).\n\nHTTP method names are
109-
// case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name
110-
// exactly.\nInstrumentations for specific web frameworks that consider HTTP methods to be case
111-
// insensitive, SHOULD populate a canonical equivalent.\nTracing instrumentations that do so, MUST
112-
// also set `http.request.method_original` to the original value.\n", "requirement_level":
113-
// "recommended", "root_namespace": "http", "stability": "stable", "type": {"allow_custom_values":
114-
// true, "members": [{"brief": "CONNECT method.", "deprecated": none, "id": "connect", "note": none,
115-
// "stability": "stable", "value": "CONNECT"}, {"brief": "DELETE method.", "deprecated": none, "id":
116-
// "delete", "note": none, "stability": "stable", "value": "DELETE"}, {"brief": "GET method.",
117-
// "deprecated": none, "id": "get", "note": none, "stability": "stable", "value": "GET"}, {"brief":
118-
// "HEAD method.", "deprecated": none, "id": "head", "note": none, "stability": "stable", "value":
119-
// "HEAD"}, {"brief": "OPTIONS method.", "deprecated": none, "id": "options", "note": none,
120-
// "stability": "stable", "value": "OPTIONS"}, {"brief": "PATCH method.", "deprecated": none, "id":
121-
// "patch", "note": none, "stability": "stable", "value": "PATCH"}, {"brief": "POST method.",
122-
// "deprecated": none, "id": "post", "note": none, "stability": "stable", "value": "POST"},
123-
// {"brief": "PUT method.", "deprecated": none, "id": "put", "note": none, "stability": "stable",
124-
// "value": "PUT"}, {"brief": "TRACE method.", "deprecated": none, "id": "trace", "note": none,
125-
// "stability": "stable", "value": "TRACE"}, {"brief": "Any HTTP method that the instrumentation has
126-
// no prior knowledge of.", "deprecated": none, "id": "other", "note": none, "stability": "stable",
127-
// "value": "_OTHER"}]}}
95+
static constexpr const char *kHttpRoute = "http.route";
96+
12897
namespace HttpRequestMethodValues
12998
{
13099
/**
131100
* CONNECT method.
132101
*/
133-
// DEBUG: {"brief": "CONNECT method.", "deprecated": none, "id": "connect", "note": none,
134-
// "stability": "stable", "value": "CONNECT"}
135102
static constexpr const char *kConnect = "CONNECT";
103+
136104
/**
137105
* DELETE method.
138106
*/
139-
// DEBUG: {"brief": "DELETE method.", "deprecated": none, "id": "delete", "note": none, "stability":
140-
// "stable", "value": "DELETE"}
141107
static constexpr const char *kDelete = "DELETE";
108+
142109
/**
143110
* GET method.
144111
*/
145-
// DEBUG: {"brief": "GET method.", "deprecated": none, "id": "get", "note": none, "stability":
146-
// "stable", "value": "GET"}
147112
static constexpr const char *kGet = "GET";
113+
148114
/**
149115
* HEAD method.
150116
*/
151-
// DEBUG: {"brief": "HEAD method.", "deprecated": none, "id": "head", "note": none, "stability":
152-
// "stable", "value": "HEAD"}
153117
static constexpr const char *kHead = "HEAD";
118+
154119
/**
155120
* OPTIONS method.
156121
*/
157-
// DEBUG: {"brief": "OPTIONS method.", "deprecated": none, "id": "options", "note": none,
158-
// "stability": "stable", "value": "OPTIONS"}
159122
static constexpr const char *kOptions = "OPTIONS";
123+
160124
/**
161125
* PATCH method.
162126
*/
163-
// DEBUG: {"brief": "PATCH method.", "deprecated": none, "id": "patch", "note": none, "stability":
164-
// "stable", "value": "PATCH"}
165127
static constexpr const char *kPatch = "PATCH";
128+
166129
/**
167130
* POST method.
168131
*/
169-
// DEBUG: {"brief": "POST method.", "deprecated": none, "id": "post", "note": none, "stability":
170-
// "stable", "value": "POST"}
171132
static constexpr const char *kPost = "POST";
133+
172134
/**
173135
* PUT method.
174136
*/
175-
// DEBUG: {"brief": "PUT method.", "deprecated": none, "id": "put", "note": none, "stability":
176-
// "stable", "value": "PUT"}
177137
static constexpr const char *kPut = "PUT";
138+
178139
/**
179140
* TRACE method.
180141
*/
181-
// DEBUG: {"brief": "TRACE method.", "deprecated": none, "id": "trace", "note": none, "stability":
182-
// "stable", "value": "TRACE"}
183142
static constexpr const char *kTrace = "TRACE";
143+
184144
/**
185145
* Any HTTP method that the instrumentation has no prior knowledge of.
186146
*/
187-
// DEBUG: {"brief": "Any HTTP method that the instrumentation has no prior knowledge of.",
188-
// "deprecated": none, "id": "other", "note": none, "stability": "stable", "value": "_OTHER"}
189147
static constexpr const char *kOther = "_OTHER";
148+
190149
} // namespace HttpRequestMethodValues
191150

192151
} // namespace http

0 commit comments

Comments
 (0)