error_attributes.h 1.9 KB

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