summaryrefslogtreecommitdiffstats
path: root/contrib/libs/opentelemetry-cpp/api/include/opentelemetry/trace/span_metadata.h
blob: a138026bdb4fbf28d1b9eb855f4c173d075f8637 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#pragma once

#include "opentelemetry/common/timestamp.h"
#include "opentelemetry/version.h"

#if OPENTELEMETRY_ABI_VERSION_NO >= 2
#  include <cstdint>
#endif

OPENTELEMETRY_BEGIN_NAMESPACE
namespace trace
{

#if OPENTELEMETRY_ABI_VERSION_NO >= 2
enum class SpanKind : std::uint8_t
#else
enum class SpanKind  // NOLINT(performance-enum-size)
#endif
{
  kInternal,
  kServer,
  kClient,
  kProducer,
  kConsumer,
};

// The key identifies the active span in the current context.
constexpr char kSpanKey[]       = "active_span";
constexpr char kIsRootSpanKey[] = "is_root_span";

// StatusCode - Represents the canonical set of status codes of a finished Span.
#if OPENTELEMETRY_ABI_VERSION_NO >= 2
enum class StatusCode : std::uint8_t
#else
enum class StatusCode  // NOLINT(performance-enum-size)
#endif
{
  kUnset,  // default status
  kOk,     // Operation has completed successfully.
  kError   // The operation contains an error
};

/**
 * EndSpanOptions provides options to set properties of a Span when it is
 * ended.
 */
struct EndSpanOptions
{
  // Optionally sets the end time of a Span.
  common::SteadyTimestamp end_steady_time;
};

}  // namespace trace
OPENTELEMETRY_END_NAMESPACE