code_attributes.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 code
  16. {
  17. /**
  18. The column number in @code code.file.path @endcode best representing the operation. It SHOULD
  19. point within the code unit named in @code code.function.name @endcode. This attribute MUST NOT be
  20. used on the Profile signal since the data is already captured in 'message Line'. This constraint
  21. is imposed to prevent redundancy and maintain data integrity.
  22. */
  23. static constexpr const char *kCodeColumnNumber = "code.column.number";
  24. /**
  25. The source code file name that identifies the code unit as uniquely as possible (preferably an
  26. absolute file path). This attribute MUST NOT be used on the Profile signal since the data is
  27. already captured in 'message Function'. This constraint is imposed to prevent redundancy and
  28. maintain data integrity.
  29. */
  30. static constexpr const char *kCodeFilePath = "code.file.path";
  31. /**
  32. The method or function fully-qualified name without arguments. The value should fit the natural
  33. representation of the language runtime, which is also likely the same used within @code
  34. code.stacktrace @endcode attribute value. This attribute MUST NOT be used on the Profile signal
  35. since the data is already captured in 'message Function'. This constraint is imposed to prevent
  36. redundancy and maintain data integrity. <p> Values and format depends on each language runtime,
  37. thus it is impossible to provide an exhaustive list of examples. The values are usually the same
  38. (or prefixes of) the ones found in native stack trace representation stored in
  39. @code code.stacktrace @endcode without information on arguments.
  40. <p>
  41. Examples:
  42. <ul>
  43. <li>Java method: @code com.example.MyHttpService.serveRequest @endcode</li>
  44. <li>Java anonymous class method: @code com.mycompany.Main$1.myMethod @endcode</li>
  45. <li>Java lambda method: @code com.mycompany.Main$$Lambda/0x0000748ae4149c00.myMethod
  46. @endcode</li> <li>PHP function: @code GuzzleHttp\Client::transfer @endcode</li> <li>Go function:
  47. @code github.com/my/repo/pkg.foo.func5 @endcode</li> <li>Elixir: @code OpenTelemetry.Ctx.new
  48. @endcode</li> <li>Erlang: @code opentelemetry_ctx:new @endcode</li> <li>Rust: @code
  49. playground::my_module::my_cool_func @endcode</li> <li>C function: @code fopen @endcode</li>
  50. </ul>
  51. */
  52. static constexpr const char *kCodeFunctionName = "code.function.name";
  53. /**
  54. The line number in @code code.file.path @endcode best representing the operation. It SHOULD point
  55. within the code unit named in @code code.function.name @endcode. This attribute MUST NOT be used
  56. on the Profile signal since the data is already captured in 'message Line'. This constraint is
  57. imposed to prevent redundancy and maintain data integrity.
  58. */
  59. static constexpr const char *kCodeLineNumber = "code.line.number";
  60. /**
  61. A stacktrace as a string in the natural representation for the language runtime. The
  62. representation is identical to <a
  63. href="/docs/exceptions/exceptions-spans.md#stacktrace-representation">@code exception.stacktrace
  64. @endcode</a>. This attribute MUST NOT be used on the Profile signal since the data is already
  65. captured in 'message Location'. This constraint is imposed to prevent redundancy and maintain data
  66. integrity.
  67. */
  68. static constexpr const char *kCodeStacktrace = "code.stacktrace";
  69. } // namespace code
  70. } // namespace semconv
  71. OPENTELEMETRY_END_NAMESPACE