|
| 1 | + |
| 2 | + |
| 3 | +/* |
| 4 | + * Copyright The OpenTelemetry Authors |
| 5 | + * SPDX-License-Identifier: Apache-2.0 |
| 6 | + */ |
| 7 | + |
| 8 | +/* |
| 9 | + * DO NOT EDIT, this is an Auto-generated file from: |
| 10 | + * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 |
| 11 | + */ |
| 12 | + |
| 13 | +#pragma once |
| 14 | + |
| 15 | +#include "opentelemetry/common/macros.h" |
| 16 | +#include "opentelemetry/version.h" |
| 17 | + |
| 18 | +OPENTELEMETRY_BEGIN_NAMESPACE |
| 19 | +namespace semconv |
| 20 | +{ |
| 21 | +namespace http |
| 22 | +{ |
| 23 | + |
| 24 | +/** |
| 25 | + * 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 |
| 27 | + * which headers are to be captured. Including all request headers can be a security risk - explicit |
| 28 | + * configuration helps avoid leaking sensitive information. The @code User-Agent @endcode header is |
| 29 | + * already captured in the @code user_agent.original @endcode attribute. Users MAY explicitly |
| 30 | + * configure instrumentations to capture them even though it is not recommended. The attribute value |
| 31 | + * MUST consist of either multiple header values as an array of strings or a single-item array |
| 32 | + * containing a possibly comma-concatenated string, depending on the way the HTTP library provides |
| 33 | + * access to headers. |
| 34 | + */ |
| 35 | +static const char *kHttpRequestHeader = "http.request.header"; |
| 36 | + |
| 37 | +/** |
| 38 | + * HTTP request method. |
| 39 | + * Note: HTTP request method value SHOULD be "known" to the instrumentation. |
| 40 | + * By default, this convention defines "known" methods as the ones listed in <a |
| 41 | + * href="https://www.rfc-editor.org/rfc/rfc9110.html#name-methods">RFC9110</a> and the PATCH method |
| 42 | + * defined in <a href="https://www.rfc-editor.org/rfc/rfc5789.html">RFC5789</a>. <p> If the HTTP |
| 43 | + * request method is not known to instrumentation, it MUST set the @code http.request.method |
| 44 | + * @endcode attribute to @code _OTHER @endcode. <p> If the HTTP instrumentation could end up |
| 45 | + * converting valid HTTP request methods to @code _OTHER @endcode, then it MUST provide a way to |
| 46 | + * override the list of known HTTP methods. If this override is done via environment variable, then |
| 47 | + * the environment variable MUST be named OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a |
| 48 | + * comma-separated list of case-sensitive known HTTP methods (this list MUST be a full override of |
| 49 | + * the default known method, it is not a list of known methods in addition to the defaults). <p> |
| 50 | + * HTTP method names are case-sensitive and @code http.request.method @endcode attribute value MUST |
| 51 | + * match a known HTTP method name exactly. Instrumentations for specific web frameworks that |
| 52 | + * consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. Tracing |
| 53 | + * instrumentations that do so, MUST also set @code http.request.method_original @endcode to the |
| 54 | + * original value. |
| 55 | + */ |
| 56 | +static const char *kHttpRequestMethod = "http.request.method"; |
| 57 | + |
| 58 | +/** |
| 59 | + * Original HTTP method sent by the client in the request line. |
| 60 | + */ |
| 61 | +static const char *kHttpRequestMethodOriginal = "http.request.method_original"; |
| 62 | + |
| 63 | +/** |
| 64 | + * 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, |
| 66 | + * regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 |
| 67 | + * Server Unavailable, network issues, or any other). |
| 68 | + */ |
| 69 | +static const char *kHttpRequestResendCount = "http.request.resend_count"; |
| 70 | + |
| 71 | +/** |
| 72 | + * 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"; |
| 82 | + |
| 83 | +/** |
| 84 | + * <a href="https://tools.ietf.org/html/rfc7231#section-6">HTTP response status code</a>. |
| 85 | + */ |
| 86 | +static const char *kHttpResponseStatusCode = "http.response.status_code"; |
| 87 | + |
| 88 | +/** |
| 89 | + * 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 |
| 91 | + * the route attribute should have low-cardinality and the URI path can NOT substitute it. SHOULD |
| 92 | + * include the <a href="/docs/http/http-spans.md#http-server-definitions">application root</a> if |
| 93 | + * there is one. |
| 94 | + */ |
| 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"}]}} |
| 128 | +namespace HttpRequestMethodValues |
| 129 | +{ |
| 130 | +/** |
| 131 | + * CONNECT method. |
| 132 | + */ |
| 133 | +// DEBUG: {"brief": "CONNECT method.", "deprecated": none, "id": "connect", "note": none, |
| 134 | +// "stability": "stable", "value": "CONNECT"} |
| 135 | +static constexpr const char *kConnect = "CONNECT"; |
| 136 | +/** |
| 137 | + * DELETE method. |
| 138 | + */ |
| 139 | +// DEBUG: {"brief": "DELETE method.", "deprecated": none, "id": "delete", "note": none, "stability": |
| 140 | +// "stable", "value": "DELETE"} |
| 141 | +static constexpr const char *kDelete = "DELETE"; |
| 142 | +/** |
| 143 | + * GET method. |
| 144 | + */ |
| 145 | +// DEBUG: {"brief": "GET method.", "deprecated": none, "id": "get", "note": none, "stability": |
| 146 | +// "stable", "value": "GET"} |
| 147 | +static constexpr const char *kGet = "GET"; |
| 148 | +/** |
| 149 | + * HEAD method. |
| 150 | + */ |
| 151 | +// DEBUG: {"brief": "HEAD method.", "deprecated": none, "id": "head", "note": none, "stability": |
| 152 | +// "stable", "value": "HEAD"} |
| 153 | +static constexpr const char *kHead = "HEAD"; |
| 154 | +/** |
| 155 | + * OPTIONS method. |
| 156 | + */ |
| 157 | +// DEBUG: {"brief": "OPTIONS method.", "deprecated": none, "id": "options", "note": none, |
| 158 | +// "stability": "stable", "value": "OPTIONS"} |
| 159 | +static constexpr const char *kOptions = "OPTIONS"; |
| 160 | +/** |
| 161 | + * PATCH method. |
| 162 | + */ |
| 163 | +// DEBUG: {"brief": "PATCH method.", "deprecated": none, "id": "patch", "note": none, "stability": |
| 164 | +// "stable", "value": "PATCH"} |
| 165 | +static constexpr const char *kPatch = "PATCH"; |
| 166 | +/** |
| 167 | + * POST method. |
| 168 | + */ |
| 169 | +// DEBUG: {"brief": "POST method.", "deprecated": none, "id": "post", "note": none, "stability": |
| 170 | +// "stable", "value": "POST"} |
| 171 | +static constexpr const char *kPost = "POST"; |
| 172 | +/** |
| 173 | + * PUT method. |
| 174 | + */ |
| 175 | +// DEBUG: {"brief": "PUT method.", "deprecated": none, "id": "put", "note": none, "stability": |
| 176 | +// "stable", "value": "PUT"} |
| 177 | +static constexpr const char *kPut = "PUT"; |
| 178 | +/** |
| 179 | + * TRACE method. |
| 180 | + */ |
| 181 | +// DEBUG: {"brief": "TRACE method.", "deprecated": none, "id": "trace", "note": none, "stability": |
| 182 | +// "stable", "value": "TRACE"} |
| 183 | +static constexpr const char *kTrace = "TRACE"; |
| 184 | +/** |
| 185 | + * Any HTTP method that the instrumentation has no prior knowledge of. |
| 186 | + */ |
| 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"} |
| 189 | +static constexpr const char *kOther = "_OTHER"; |
| 190 | +} // namespace HttpRequestMethodValues |
| 191 | + |
| 192 | +} // namespace http |
| 193 | +} // namespace semconv |
| 194 | +OPENTELEMETRY_END_NAMESPACE |
0 commit comments