7#include <smithy/Smithy_EXPORTS.h>
8#include <smithy/tracing/TracerProvider.h>
9#include <smithy/tracing/MeterProvider.h>
10#include <aws/core/utils/memory/AWSMemory.h>
15 namespace components {
33 std::function<
void()> init,
34 std::function<
void()> shutdown) :
35 m_tracerProvider(std::move(tracerProvider)),
36 m_meterProvider(std::move(meterProvider)),
37 m_init(std::move(init)),
38 m_shutdown(std::move(shutdown))
54 std::shared_ptr<Tracer>
56 return m_tracerProvider->GetTracer(std::move(scope), attributes);
66 std::shared_ptr<Meter>
68 return m_meterProvider->GetMeter(std::move(scope), attributes);
76 std::call_once(m_initFlag, m_init);
84 std::call_once(m_shutdownFlag, m_shutdown);
88 std::once_flag m_initFlag;
89 std::once_flag m_shutdownFlag;
92 const std::function<void()> m_init;
93 const std::function<void()> m_shutdown;
TelemetryProvider(Aws::UniquePtr< TracerProvider > tracerProvider, Aws::UniquePtr< MeterProvider > meterProvider, std::function< void()> init, std::function< void()> shutdown)
virtual ~TelemetryProvider()
std::shared_ptr< Tracer > getTracer(Aws::String scope, const Aws::Map< Aws::String, Aws::String > &attributes)
std::shared_ptr< Meter > getMeter(Aws::String scope, const Aws::Map< Aws::String, Aws::String > &attributes)
std::map< K, V, std::less< K >, Aws::Allocator< std::pair< const K, V > > > Map
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::unique_ptr< T, D > UniquePtr