NVIDIA DeepStream SDK API Reference
9.2 Release
includes/opentelemetry/trace/span_startoptions.h
Go to the documentation of this file.
1
// Copyright The OpenTelemetry Authors
2
// SPDX-License-Identifier: Apache-2.0
3
4
#pragma once
5
6
#include "opentelemetry/common/timestamp.h"
7
#include "opentelemetry/context/context.h"
8
#include "opentelemetry/nostd/variant.h"
9
#include "opentelemetry/trace/span_context.h"
10
#include "opentelemetry/trace/span_metadata.h"
11
#include "opentelemetry/version.h"
12
13
OPENTELEMETRY_BEGIN_NAMESPACE
14
namespace
trace
15
{
16
21
struct
StartSpanOptions
22
{
23
// Optionally sets the start time of a Span.
24
//
25
// If the start time of a Span is set, timestamps from both the system clock
26
// and steady clock must be provided.
27
//
28
// Timestamps from the steady clock can be used to most accurately measure a
29
// Span's duration, while timestamps from the system clock can be used to most
30
// accurately place a Span's
31
// time point relative to other Spans collected across a distributed system.
32
common::SystemTimestamp
start_system_time
;
33
common::SteadyTimestamp
start_steady_time
;
34
35
// Explicitly set the parent of a Span.
36
//
37
// The `parent` field is designed to establish parent-child relationships
38
// in tracing spans. It can be set to either a `SpanContext` or a
39
// `context::Context` object.
40
//
41
// - When set to valid `SpanContext`, it directly assigns a specific Span as the parent
42
// of the newly created Span.
43
//
44
// - Alternatively, setting the `parent` field to a `context::Context` allows for
45
// more nuanced parent identification:
46
// 1. If the `Context` contains a Span object, this Span is treated as the parent.
47
// 2. If the `Context` contains the boolean flag `is_root_span` set to `true`,
48
// it indicates that the new Span should be treated as a root Span, i.e., it
49
// does not have a parent Span.
50
// Example Usage:
51
// ```cpp
52
// trace_api::StartSpanOptions options;
53
// opentelemetry::context::Context root;
54
// root = root.SetValue(kIsRootSpanKey, true);
55
// options.parent = root;
56
// auto root_span = tracer->StartSpan("span root", options);
57
// ```
58
//
59
// - If the `parent` field is not set, the newly created Span will inherit the
60
// parent of the currently active Span (if any) in the current context.
61
//
62
nostd::variant<SpanContext, context::Context>
parent
=
SpanContext::GetInvalid
();
63
64
// TODO:
65
// SpanContext remote_parent;
66
// Links
67
SpanKind
kind
=
SpanKind::kInternal
;
68
};
69
70
}
// namespace trace
71
OPENTELEMETRY_END_NAMESPACE
trace::StartSpanOptions::start_steady_time
common::SteadyTimestamp start_steady_time
Definition:
includes/opentelemetry/trace/span_startoptions.h:33
trace
Definition:
includes/opentelemetry/context/context_value.h:18
trace::StartSpanOptions
StartSpanOptions provides options to set properties of a Span at the time of its creation.
Definition:
includes/opentelemetry/trace/span_startoptions.h:21
absl::OTABSL_OPTION_NAMESPACE_NAME::variant
Definition:
includes/opentelemetry/nostd/variant.h:61
trace::StartSpanOptions::start_system_time
common::SystemTimestamp start_system_time
Definition:
includes/opentelemetry/trace/span_startoptions.h:32
trace::SpanKind::kInternal
@ kInternal
trace::SpanKind
SpanKind
Definition:
includes/opentelemetry/trace/span_metadata.h:13
common::SystemTimestamp
A timepoint relative to the system clock epoch.
Definition:
includes/opentelemetry/common/timestamp.h:19
OPENTELEMETRY_BEGIN_NAMESPACE
#define OPENTELEMETRY_BEGIN_NAMESPACE
Definition:
includes/opentelemetry/version.h:21
trace::StartSpanOptions::parent
nostd::variant< SpanContext, context::Context > parent
Definition:
includes/opentelemetry/trace/span_startoptions.h:62
trace::StartSpanOptions::kind
SpanKind kind
Definition:
includes/opentelemetry/trace/span_startoptions.h:67
OPENTELEMETRY_END_NAMESPACE
#define OPENTELEMETRY_END_NAMESPACE
Definition:
includes/opentelemetry/version.h:24
common::SteadyTimestamp
A timepoint relative to the monotonic clock epoch.
Definition:
includes/opentelemetry/common/timestamp.h:98
trace::SpanContext::GetInvalid
static SpanContext GetInvalid() noexcept
Definition:
includes/opentelemetry/trace/span_context.h:86
Privacy Policy
|
Your Privacy Choices
|
Terms of Service
|
Accessibility
|
Corporate Policies
|
Product Security
|
Contact
© 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
NVIDIA Confidential | Subject to Change | For test and development only.
Wed Oct 28 2026 12:02:50 | PR-09318-R32