|
|
NVIDIA DeepStream SDK API Reference
|
9.2 Release
|
Go to the documentation of this file.
9 #include <unordered_map>
12 #include "opentelemetry/common/macros.h"
13 #include "opentelemetry/metrics/meter.h"
14 #include "opentelemetry/metrics/noop.h"
15 #include "opentelemetry/nostd/shared_ptr.h"
16 #include "opentelemetry/nostd/string_view.h"
17 #include "opentelemetry/nostd/unique_ptr.h"
18 #include "opentelemetry/sdk/common/attributemap_hash.h"
19 #include "opentelemetry/sdk/instrumentationscope/instrumentation_scope.h"
20 #include "opentelemetry/sdk/metrics/instrument_metadata_validator.h"
21 #include "opentelemetry/sdk/metrics/instruments.h"
22 #include "opentelemetry/sdk/metrics/meter_config.h"
23 #include "opentelemetry/sdk/metrics/meter_context.h"
24 #include "opentelemetry/sdk/metrics/state/async_metric_storage.h"
25 #include "opentelemetry/sdk/resource/resource.h"
26 #include "opentelemetry/sdk_config.h"
27 #include "opentelemetry/version.h"
36 class SyncWritableMetricStorage;
37 class AsyncWritableMetricsStorge;
38 class ObservableRegistry;
40 class Meter final :
public opentelemetry::metrics::Meter
45 std::weak_ptr<sdk::metrics::MeterContext> meter_context,
46 std::unique_ptr<opentelemetry::sdk::instrumentationscope::InstrumentationScope> scope =
47 opentelemetry::sdk::instrumentationscope::InstrumentationScope::Create(
"")) noexcept;
79 #if OPENTELEMETRY_ABI_VERSION_NO >= 2
132 opentelemetry::common::SystemTimestamp collect_ts) noexcept;
137 std::unique_ptr<sdk::instrumentationscope::InstrumentationScope> scope_;
138 std::weak_ptr<sdk::metrics::MeterContext> meter_context_;
141 std::shared_ptr<MetricStorage>,
144 MetricStorageMap storage_registry_;
145 std::shared_ptr<ObservableRegistry> observable_registry_;
147 std::unique_ptr<SyncWritableMetricStorage> RegisterSyncMetricStorage(
149 std::unique_ptr<AsyncWritableMetricStorage> RegisterAsyncMetricStorage(
151 opentelemetry::common::SpinLockMutex storage_lock_;
153 static opentelemetry::metrics::NoopMeter kNoopMeter;
156 GetNoopObservableInsrument()
159 new opentelemetry::metrics::NoopObservableInstrument(
"",
"",
""));
160 return noop_instrument;
167 const static InstrumentMetaDataValidator instrument_validator;
168 return instrument_validator.ValidateName(name) && instrument_validator.ValidateUnit(unit) &&
169 instrument_validator.ValidateDescription(description);
174 static void WarnOnDuplicateInstrument(
176 const MetricStorageMap &storage_registry,
177 const InstrumentDescriptor &new_instrument);
182 const InstrumentDescriptor &existing_instrument,
183 const InstrumentDescriptor &new_instrument);
nostd::shared_ptr< opentelemetry::metrics::ObservableInstrument > CreateDoubleObservableGauge(nostd::string_view name, nostd::string_view description="", nostd::string_view unit="") noexcept override
Provide a simplified port of std::unique_ptr that has ABI stability.
Provide a type-erased version of std::shared_ptr that has ABI stability.
std::vector< MetricData > Collect(CollectorHandle *collector, opentelemetry::common::SystemTimestamp collect_ts) noexcept
collect metrics across all the instruments configured for the meter
nostd::unique_ptr< opentelemetry::metrics::Histogram< double > > CreateDoubleHistogram(nostd::string_view name, nostd::string_view description="", nostd::string_view unit="") noexcept override
#define OPENTELEMETRY_BEGIN_NAMESPACE
nostd::unique_ptr< opentelemetry::metrics::Counter< double > > CreateDoubleCounter(nostd::string_view name, nostd::string_view description="", nostd::string_view unit="") noexcept override
#define OPENTELEMETRY_END_NAMESPACE
nostd::shared_ptr< opentelemetry::metrics::ObservableInstrument > CreateDoubleObservableUpDownCounter(nostd::string_view name, nostd::string_view description="", nostd::string_view unit="") noexcept override
nostd::shared_ptr< opentelemetry::metrics::ObservableInstrument > CreateInt64ObservableCounter(nostd::string_view name, nostd::string_view description="", nostd::string_view unit="") noexcept override
const sdk::instrumentationscope::InstrumentationScope * GetInstrumentationLibrary() const noexcept
nostd::shared_ptr< opentelemetry::metrics::ObservableInstrument > CreateInt64ObservableUpDownCounter(nostd::string_view name, nostd::string_view description="", nostd::string_view unit="") noexcept override
const sdk::instrumentationscope::InstrumentationScope * GetInstrumentationScope() const noexcept
Returns the associated instrumentation scope.
nostd::unique_ptr< opentelemetry::metrics::UpDownCounter< double > > CreateDoubleUpDownCounter(nostd::string_view name, nostd::string_view description="", nostd::string_view unit="") noexcept override
Meter(std::weak_ptr< sdk::metrics::MeterContext > meter_context, std::unique_ptr< opentelemetry::sdk::instrumentationscope::InstrumentationScope > scope=opentelemetry::sdk::instrumentationscope::InstrumentationScope::Create("")) noexcept
Construct a new Meter with the given pipeline.
nostd::unique_ptr< opentelemetry::metrics::Counter< uint64_t > > CreateUInt64Counter(nostd::string_view name, nostd::string_view description="", nostd::string_view unit="") noexcept override
nostd::unique_ptr< opentelemetry::metrics::Histogram< uint64_t > > CreateUInt64Histogram(nostd::string_view name, nostd::string_view description="", nostd::string_view unit="") noexcept override
nostd::unique_ptr< opentelemetry::metrics::UpDownCounter< int64_t > > CreateInt64UpDownCounter(nostd::string_view name, nostd::string_view description="", nostd::string_view unit="") noexcept override
MeterConfig defines various configurable aspects of a Meter's behavior.
nostd::shared_ptr< opentelemetry::metrics::ObservableInstrument > CreateInt64ObservableGauge(nostd::string_view name, nostd::string_view description="", nostd::string_view unit="") noexcept override
#define OPENTELEMETRY_DEPRECATED_MESSAGE(msg)
nostd::shared_ptr< opentelemetry::metrics::ObservableInstrument > CreateDoubleObservableCounter(nostd::string_view name, nostd::string_view description="", nostd::string_view unit="") noexcept override
Back port of std::string_view to work with pre-cpp-17 compilers.