url_attributes.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. /*
  2. * Copyright The OpenTelemetry Authors
  3. * SPDX-License-Identifier: Apache-2.0
  4. */
  5. /*
  6. * DO NOT EDIT, this is an Auto-generated file from:
  7. * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2
  8. */
  9. #pragma once
  10. #include "opentelemetry/common/macros.h"
  11. #include "opentelemetry/version.h"
  12. OPENTELEMETRY_BEGIN_NAMESPACE
  13. namespace semconv
  14. {
  15. namespace url
  16. {
  17. /**
  18. Domain extracted from the @code url.full @endcode, such as "opentelemetry.io".
  19. <p>
  20. In some cases a URL may refer to an IP and/or port directly, without a domain name. In this case,
  21. the IP address would go to the domain field. If the URL contains a <a
  22. href="https://www.rfc-editor.org/rfc/rfc2732#section-2">literal IPv6 address</a> enclosed by @code
  23. [ @endcode and @code ] @endcode, the @code [ @endcode and @code ] @endcode characters should also
  24. be captured in the domain field.
  25. */
  26. static constexpr const char *kUrlDomain = "url.domain";
  27. /**
  28. The file extension extracted from the @code url.full @endcode, excluding the leading dot.
  29. <p>
  30. The file extension is only set if it exists, as not every url has a file extension. When the file
  31. name has multiple extensions @code example.tar.gz @endcode, only the last one should be captured
  32. @code gz @endcode, not @code tar.gz @endcode.
  33. */
  34. static constexpr const char *kUrlExtension = "url.extension";
  35. /**
  36. The <a href="https://www.rfc-editor.org/rfc/rfc3986#section-3.5">URI fragment</a> component
  37. */
  38. static constexpr const char *kUrlFragment = "url.fragment";
  39. /**
  40. Absolute URL describing a network resource according to <a
  41. href="https://www.rfc-editor.org/rfc/rfc3986">RFC3986</a> <p> For network calls, URL usually has
  42. @code scheme://host[:port][path][?query][#fragment] @endcode format, where the fragment is not
  43. transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. <p>
  44. @code url.full @endcode MUST NOT contain credentials passed via URL in form of @code
  45. https://username:[email protected]/ @endcode. In such case username and password SHOULD be
  46. redacted and attribute's value SHOULD be @code https://REDACTED:[email protected]/
  47. @endcode. <p>
  48. @code url.full @endcode SHOULD capture the absolute URL when it is available (or can be
  49. reconstructed). <p> Sensitive content provided in @code url.full @endcode SHOULD be scrubbed when
  50. instrumentations can identify it. <p>
  51. Query string values for the following keys SHOULD be redacted by default and replaced by the
  52. value @code REDACTED @endcode:
  53. <ul>
  54. <li><a
  55. href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth">@code
  56. AWSAccessKeyId @endcode</a></li> <li><a
  57. href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth">@code
  58. Signature @endcode</a></li> <li><a
  59. href="https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token">@code sig
  60. @endcode</a></li> <li><a
  61. href="https://cloud.google.com/storage/docs/access-control/signed-urls">@code X-Goog-Signature
  62. @endcode</a></li>
  63. </ul>
  64. <p>
  65. This list is subject to change over time.
  66. <p>
  67. When a query string value is redacted, the query string key SHOULD still be preserved, e.g.
  68. @code https://www.example.com/path?color=blue&sig=REDACTED @endcode.
  69. */
  70. static constexpr const char *kUrlFull = "url.full";
  71. /**
  72. Unmodified original URL as seen in the event source.
  73. <p>
  74. In network monitoring, the observed URL may be a full URL, whereas in access logs, the URL is
  75. often just represented as a path. This field is meant to represent the URL as it was observed,
  76. complete or not.
  77. @code url.original @endcode might contain credentials passed via URL in form of @code
  78. https://username:[email protected]/ @endcode. In such case password and username SHOULD NOT
  79. be redacted and attribute's value SHOULD remain the same.
  80. */
  81. static constexpr const char *kUrlOriginal = "url.original";
  82. /**
  83. The <a href="https://www.rfc-editor.org/rfc/rfc3986#section-3.3">URI path</a> component
  84. <p>
  85. Sensitive content provided in @code url.path @endcode SHOULD be scrubbed when instrumentations can
  86. identify it.
  87. */
  88. static constexpr const char *kUrlPath = "url.path";
  89. /**
  90. Port extracted from the @code url.full @endcode
  91. */
  92. static constexpr const char *kUrlPort = "url.port";
  93. /**
  94. The <a href="https://www.rfc-editor.org/rfc/rfc3986#section-3.4">URI query</a> component
  95. <p>
  96. Sensitive content provided in @code url.query @endcode SHOULD be scrubbed when instrumentations
  97. can identify it. <p>
  98. Query string values for the following keys SHOULD be redacted by default and replaced by the value
  99. @code REDACTED @endcode: <ul> <li><a
  100. href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth">@code
  101. AWSAccessKeyId @endcode</a></li> <li><a
  102. href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth">@code
  103. Signature @endcode</a></li> <li><a
  104. href="https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token">@code sig
  105. @endcode</a></li> <li><a
  106. href="https://cloud.google.com/storage/docs/access-control/signed-urls">@code X-Goog-Signature
  107. @endcode</a></li>
  108. </ul>
  109. <p>
  110. This list is subject to change over time.
  111. <p>
  112. When a query string value is redacted, the query string key SHOULD still be preserved, e.g.
  113. @code q=OpenTelemetry&sig=REDACTED @endcode.
  114. */
  115. static constexpr const char *kUrlQuery = "url.query";
  116. /**
  117. The highest registered url domain, stripped of the subdomain.
  118. <p>
  119. This value can be determined precisely with the <a href="https://publicsuffix.org/">public suffix
  120. list</a>. For example, the registered domain for @code foo.example.com @endcode is @code
  121. example.com @endcode. Trying to approximate this by simply taking the last two labels will not
  122. work well for TLDs such as @code co.uk @endcode.
  123. */
  124. static constexpr const char *kUrlRegisteredDomain = "url.registered_domain";
  125. /**
  126. The <a href="https://www.rfc-editor.org/rfc/rfc3986#section-3.1">URI scheme</a> component
  127. identifying the used protocol.
  128. */
  129. static constexpr const char *kUrlScheme = "url.scheme";
  130. /**
  131. The subdomain portion of a fully qualified domain name includes all of the names except the host
  132. name under the registered_domain. In a partially qualified domain, or if the qualification level
  133. of the full name cannot be determined, subdomain contains all of the names below the registered
  134. domain. <p> The subdomain portion of @code www.east.mydomain.co.uk @endcode is @code east
  135. @endcode. If the domain has multiple levels of subdomain, such as @code sub2.sub1.example.com
  136. @endcode, the subdomain field should contain @code sub2.sub1 @endcode, with no trailing period.
  137. */
  138. static constexpr const char *kUrlSubdomain = "url.subdomain";
  139. /**
  140. The low-cardinality template of an <a
  141. href="https://www.rfc-editor.org/rfc/rfc3986#section-4.2">absolute path reference</a>.
  142. */
  143. static constexpr const char *kUrlTemplate = "url.template";
  144. /**
  145. The effective top level domain (eTLD), also known as the domain suffix, is the last part of the
  146. domain name. For example, the top level domain for example.com is @code com @endcode. <p> This
  147. value can be determined precisely with the <a href="https://publicsuffix.org/">public suffix
  148. list</a>.
  149. */
  150. static constexpr const char *kUrlTopLevelDomain = "url.top_level_domain";
  151. } // namespace url
  152. } // namespace semconv
  153. OPENTELEMETRY_END_NAMESPACE