NVIDIA DeepStream SDK API Reference

9.2 Release
includes/opentelemetry/exporters/otlp/otlp_http_metric_exporter.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 <chrono>
7 #include <memory>
8 
9 #include "opentelemetry/exporters/otlp/otlp_http_client.h"
10 #include "opentelemetry/exporters/otlp/otlp_http_metric_exporter_options.h"
11 #include "opentelemetry/exporters/otlp/otlp_http_metric_exporter_runtime_options.h"
12 #include "opentelemetry/sdk/common/exporter_utils.h"
13 #include "opentelemetry/sdk/metrics/export/metric_producer.h"
14 #include "opentelemetry/sdk/metrics/instruments.h"
15 #include "opentelemetry/sdk/metrics/push_metric_exporter.h"
16 #include "opentelemetry/version.h"
17 
19 namespace exporter
20 {
21 namespace otlp
22 {
26 class OtlpHttpMetricExporter final : public opentelemetry::sdk::metrics::PushMetricExporter
27 {
28 public:
33 
39 
46  const OtlpHttpMetricExporterRuntimeOptions &runtime_options);
47 
54  sdk::metrics::InstrumentType instrument_type) const noexcept override;
55 
57  const opentelemetry::sdk::metrics::ResourceMetrics &data) noexcept override;
58 
62  bool ForceFlush(
63  std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept override;
64 
65  bool Shutdown(
66  std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept override;
67 
68 private:
69  // Configuration options for the exporter
71  // Runtime options for the exporter
72  OtlpHttpMetricExporterRuntimeOptions runtime_options_;
73 
74  // Aggregation Temporality Selector
75  sdk::metrics::AggregationTemporalitySelector aggregation_temporality_selector_;
76 
77  // Object that stores the HTTP sessions that have been created
78  std::unique_ptr<OtlpHttpClient> http_client_;
79  // For testing
81 
87  OtlpHttpMetricExporter(std::unique_ptr<OtlpHttpClient> http_client);
88 };
89 } // namespace otlp
90 } // namespace exporter
sdk::common::ExportResult
ExportResult
ExportResult is returned as result of exporting a batch of Records.
Definition: includes/opentelemetry/sdk/common/exporter_utils.h:16
exporter::otlp::OtlpHttpMetricExporter::Shutdown
bool Shutdown(std::chrono::microseconds timeout=(std::chrono::microseconds::max)()) noexcept override
exporter::otlp::OtlpHttpMetricExporterOptions
Struct to hold OTLP HTTP metrics exporter options.
Definition: includes/opentelemetry/exporters/otlp/otlp_http_metric_exporter_options.h:34
sdk::metrics::AggregationTemporality
AggregationTemporality
Definition: includes/opentelemetry/sdk/metrics/instruments.h:54
exporter::otlp::OtlpHttpMetricExporter::Export
opentelemetry::sdk::common::ExportResult Export(const opentelemetry::sdk::metrics::ResourceMetrics &data) noexcept override
exporter
Definition: includes/opentelemetry/exporters/memory/in_memory_data.h:11
OPENTELEMETRY_BEGIN_NAMESPACE
#define OPENTELEMETRY_BEGIN_NAMESPACE
Definition: includes/opentelemetry/version.h:21
sdk::metrics::AggregationTemporalitySelector
std::function< AggregationTemporality(InstrumentType)> AggregationTemporalitySelector
Definition: includes/opentelemetry/sdk/metrics/instruments.h:218
max
int max(int a, int b)
Compute the component-wise maximum.
Definition: sources/libs/nvmultiobjecttracker/include/modules/cuDCFv2/helper_math.h:60
exporter::otlp::OtlpHttpMetricExporter
The OTLP exporter exports metrics data in OpenTelemetry Protocol (OTLP) format in HTTP.
Definition: includes/opentelemetry/exporters/otlp/otlp_http_metric_exporter.h:26
OPENTELEMETRY_END_NAMESPACE
#define OPENTELEMETRY_END_NAMESPACE
Definition: includes/opentelemetry/version.h:24
exporter::otlp::OtlpHttpMetricExporter::OtlpHttpMetricExporterTestPeer
friend class OtlpHttpMetricExporterTestPeer
Definition: includes/opentelemetry/exporters/otlp/otlp_http_metric_exporter.h:80
exporter::otlp::OtlpHttpMetricExporter::GetAggregationTemporality
sdk::metrics::AggregationTemporality GetAggregationTemporality(sdk::metrics::InstrumentType instrument_type) const noexcept override
Get the AggregationTemporality for exporter.
exporter::otlp::OtlpHttpMetricExporter::ForceFlush
bool ForceFlush(std::chrono::microseconds timeout=(std::chrono::microseconds::max)()) noexcept override
Force flush the exporter.
exporter::otlp::OtlpHttpMetricExporterRuntimeOptions
Struct to hold OTLP HTTP metrics exporter runtime options.
Definition: includes/opentelemetry/exporters/otlp/otlp_http_metric_exporter_runtime_options.h:20
data
JSAMPIMAGE data
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:967
exporter::otlp::OtlpHttpMetricExporter::OtlpHttpMetricExporter
OtlpHttpMetricExporter()
Create an OtlpHttpMetricExporter with default exporter options.
sdk::metrics::InstrumentType
InstrumentType
Definition: includes/opentelemetry/sdk/metrics/instruments.h:19