error_attributes.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 error
  16. {
  17. /**
  18. A message providing more detail about an error in human-readable form.
  19. <p>
  20. @code error.message @endcode should provide additional context and detail about an error.
  21. It is NOT RECOMMENDED to duplicate the value of @code error.type @endcode in @code error.message
  22. @endcode. It is also NOT RECOMMENDED to duplicate the value of @code exception.message @endcode in
  23. @code error.message @endcode. <p>
  24. @code error.message @endcode is NOT RECOMMENDED for metrics or spans due to its unbounded
  25. cardinality and overlap with span status.
  26. */
  27. static constexpr const char *kErrorMessage = "error.message";
  28. /**
  29. Describes a class of error the operation ended with.
  30. <p>
  31. The @code error.type @endcode SHOULD be predictable, and SHOULD have low cardinality.
  32. <p>
  33. When @code error.type @endcode is set to a type (e.g., an exception type), its
  34. canonical class name identifying the type within the artifact SHOULD be used.
  35. <p>
  36. Instrumentations SHOULD document the list of errors they report.
  37. <p>
  38. The cardinality of @code error.type @endcode within one instrumentation library SHOULD be low.
  39. Telemetry consumers that aggregate data from multiple instrumentation libraries and applications
  40. should be prepared for @code error.type @endcode to have high cardinality at query time when no
  41. additional filters are applied.
  42. <p>
  43. If the operation has completed successfully, instrumentations SHOULD NOT set @code error.type
  44. @endcode. <p> If a specific domain defines its own set of error identifiers (such as HTTP or gRPC
  45. status codes), it's RECOMMENDED to: <ul> <li>Use a domain-specific attribute</li> <li>Set @code
  46. error.type @endcode to capture all errors, regardless of whether they are defined within the
  47. domain-specific set or not.</li>
  48. </ul>
  49. */
  50. static constexpr const char *kErrorType = "error.type";
  51. namespace ErrorTypeValues
  52. {
  53. /**
  54. A fallback error value to be used when the instrumentation doesn't define a custom value.
  55. */
  56. static constexpr const char *kOther = "_OTHER";
  57. } // namespace ErrorTypeValues
  58. } // namespace error
  59. } // namespace semconv
  60. OPENTELEMETRY_END_NAMESPACE