NVIDIA DeepStream SDK API Reference
9.2 Release
includes/opentelemetry/trace/scope.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/context/context.h"
7
#include "opentelemetry/context/runtime_context.h"
8
#include "opentelemetry/nostd/shared_ptr.h"
9
#include "opentelemetry/nostd/unique_ptr.h"
10
#include "opentelemetry/trace/span.h"
11
#include "opentelemetry/trace/span_metadata.h"
12
#include "opentelemetry/version.h"
13
14
OPENTELEMETRY_BEGIN_NAMESPACE
15
namespace
trace
16
{
17
25
class
Scope
final
26
{
27
public
:
32
Scope
(
const
nostd::shared_ptr<Span>
&span) noexcept
33
: token_(
context::RuntimeContext::Attach
(
34
context::RuntimeContext::GetCurrent
().SetValue(
kSpanKey
, span)))
35
{}
36
37
private
:
38
nostd::unique_ptr<context::Token>
token_;
39
};
40
41
}
// namespace trace
42
OPENTELEMETRY_END_NAMESPACE
trace::Scope
Controls how long a span is active.
Definition:
includes/opentelemetry/trace/scope.h:25
context::RuntimeContext::GetCurrent
static Context GetCurrent() noexcept
Definition:
includes/opentelemetry/context/runtime_context.h:93
trace
Definition:
includes/opentelemetry/context/context_value.h:18
nostd::unique_ptr< context::Token >
nostd::shared_ptr
Provide a type-erased version of std::shared_ptr that has ABI stability.
Definition:
includes/opentelemetry/nostd/shared_ptr.h:28
OPENTELEMETRY_BEGIN_NAMESPACE
#define OPENTELEMETRY_BEGIN_NAMESPACE
Definition:
includes/opentelemetry/version.h:21
context::RuntimeContext::Attach
static nostd::unique_ptr< Token > Attach(const Context &context) noexcept
Definition:
includes/opentelemetry/context/runtime_context.h:97
OPENTELEMETRY_END_NAMESPACE
#define OPENTELEMETRY_END_NAMESPACE
Definition:
includes/opentelemetry/version.h:24
trace::Scope::Scope
Scope(const nostd::shared_ptr< Span > &span) noexcept
Initialize a new scope.
Definition:
includes/opentelemetry/trace/scope.h:32
trace::kSpanKey
constexpr char kSpanKey[]
Definition:
includes/opentelemetry/trace/span_metadata.h:23
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:49 | PR-09318-R32