span_metadata.h 965 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright The OpenTelemetry Authors
  2. // SPDX-License-Identifier: Apache-2.0
  3. #pragma once
  4. #include "opentelemetry/common/timestamp.h"
  5. #include "opentelemetry/version.h"
  6. OPENTELEMETRY_BEGIN_NAMESPACE
  7. namespace trace
  8. {
  9. enum class SpanKind
  10. {
  11. kInternal,
  12. kServer,
  13. kClient,
  14. kProducer,
  15. kConsumer,
  16. };
  17. // The key identifies the active span in the current context.
  18. constexpr char kSpanKey[] = "active_span";
  19. constexpr char kIsRootSpanKey[] = "is_root_span";
  20. // StatusCode - Represents the canonical set of status codes of a finished Span.
  21. enum class StatusCode
  22. {
  23. kUnset, // default status
  24. kOk, // Operation has completed successfully.
  25. kError // The operation contains an error
  26. };
  27. /**
  28. * EndSpanOptions provides options to set properties of a Span when it is
  29. * ended.
  30. */
  31. struct EndSpanOptions
  32. {
  33. // Optionally sets the end time of a Span.
  34. common::SteadyTimestamp end_steady_time;
  35. };
  36. } // namespace trace
  37. OPENTELEMETRY_END_NAMESPACE