user_agent_attributes.h 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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 user_agent
  16. {
  17. /**
  18. Name of the user-agent extracted from original. Usually refers to the browser's name.
  19. <p>
  20. <a href="https://www.whatsmyua.info">Example</a> of extracting browser's name from original
  21. string. In the case of using a user-agent for non-browser products, such as microservices with
  22. multiple names/versions inside the @code user_agent.original @endcode, the most significant name
  23. SHOULD be selected. In such a scenario it should align with @code user_agent.version @endcode
  24. */
  25. static constexpr const char *kUserAgentName = "user_agent.name";
  26. /**
  27. Value of the <a href="https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent">HTTP
  28. User-Agent</a> header sent by the client.
  29. */
  30. static constexpr const char *kUserAgentOriginal = "user_agent.original";
  31. /**
  32. Human readable operating system name.
  33. <p>
  34. For mapping user agent strings to OS names, libraries such as <a
  35. href="https://github.com/ua-parser">ua-parser</a> can be utilized.
  36. */
  37. static constexpr const char *kUserAgentOsName = "user_agent.os.name";
  38. /**
  39. The version string of the operating system as defined in <a
  40. href="/docs/resource/README.md#version-attributes">Version Attributes</a>. <p> For mapping user
  41. agent strings to OS versions, libraries such as <a
  42. href="https://github.com/ua-parser">ua-parser</a> can be utilized.
  43. */
  44. static constexpr const char *kUserAgentOsVersion = "user_agent.os.version";
  45. /**
  46. Specifies the category of synthetic traffic, such as tests or bots.
  47. <p>
  48. This attribute MAY be derived from the contents of the @code user_agent.original @endcode
  49. attribute. Components that populate the attribute are responsible for determining what they
  50. consider to be synthetic bot or test traffic. This attribute can either be set for
  51. self-identification purposes, or on telemetry detected to be generated as a result of a synthetic
  52. request. This attribute is useful for distinguishing between genuine client traffic and synthetic
  53. traffic generated by bots or tests.
  54. */
  55. static constexpr const char *kUserAgentSyntheticType = "user_agent.synthetic.type";
  56. /**
  57. Version of the user-agent extracted from original. Usually refers to the browser's version
  58. <p>
  59. <a href="https://www.whatsmyua.info">Example</a> of extracting browser's version from original
  60. string. In the case of using a user-agent for non-browser products, such as microservices with
  61. multiple names/versions inside the @code user_agent.original @endcode, the most significant
  62. version SHOULD be selected. In such a scenario it should align with @code user_agent.name @endcode
  63. */
  64. static constexpr const char *kUserAgentVersion = "user_agent.version";
  65. namespace UserAgentSyntheticTypeValues
  66. {
  67. /**
  68. Bot source.
  69. */
  70. static constexpr const char *kBot = "bot";
  71. /**
  72. Synthetic test source.
  73. */
  74. static constexpr const char *kTest = "test";
  75. } // namespace UserAgentSyntheticTypeValues
  76. } // namespace user_agent
  77. } // namespace semconv
  78. OPENTELEMETRY_END_NAMESPACE