otel_attributes.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Copyright The OpenTelemetry Authors
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. from enum import Enum
  15. from typing import Final
  16. OTEL_SCOPE_NAME: Final = "otel.scope.name"
  17. """
  18. The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP).
  19. """
  20. OTEL_SCOPE_VERSION: Final = "otel.scope.version"
  21. """
  22. The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP).
  23. """
  24. OTEL_STATUS_CODE: Final = "otel.status_code"
  25. """
  26. Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET.
  27. """
  28. OTEL_STATUS_DESCRIPTION: Final = "otel.status_description"
  29. """
  30. Description of the Status if it has a value, otherwise not set.
  31. """
  32. class OtelStatusCodeValues(Enum):
  33. OK = "OK"
  34. """The operation has been validated by an Application developer or Operator to have completed successfully."""
  35. ERROR = "ERROR"
  36. """The operation contains an error."""