1313#include " opentelemetry/nostd/function_ref.h"
1414#include " opentelemetry/nostd/span.h"
1515#include " opentelemetry/nostd/string_view.h"
16+ #include " opentelemetry/sdk/instrumentationscope/scope_configurator.h"
17+ #include " opentelemetry/sdk/metrics/meter_config.h"
1618#include " opentelemetry/sdk/metrics/metric_reader.h"
1719#include " opentelemetry/sdk/metrics/state/metric_collector.h"
1820#include " opentelemetry/sdk/metrics/view/instrument_selector.h"
@@ -48,14 +50,17 @@ class MeterContext : public std::enable_shared_from_this<MeterContext>
4850public:
4951 /* *
5052 * Initialize a new meter provider
51- * @param readers The readers to be configured with meter context.
5253 * @param views The views to be configured with meter context.
5354 * @param resource The resource for this meter context.
5455 */
5556 MeterContext (
5657 std::unique_ptr<ViewRegistry> views = std::unique_ptr<ViewRegistry>(new ViewRegistry()),
5758 const opentelemetry::sdk::resource::Resource &resource =
58- opentelemetry::sdk::resource::Resource::Create ({})) noexcept ;
59+ opentelemetry::sdk::resource::Resource::Create ({}),
60+ std::unique_ptr<instrumentationscope::ScopeConfigurator<MeterConfig>> meter_configurator =
61+ std::make_unique<instrumentationscope::ScopeConfigurator<MeterConfig>>(
62+ instrumentationscope::ScopeConfigurator<MeterConfig>::Builder(MeterConfig::Default())
63+ .Build())) noexcept ;
5964
6065 /* *
6166 * Obtain the resource associated with this meter context.
@@ -70,13 +75,19 @@ class MeterContext : public std::enable_shared_from_this<MeterContext>
7075 ViewRegistry *GetViewRegistry () const noexcept ;
7176
7277 /* *
73- * NOTE - INTERNAL method, can change in future.
78+ * Obtain the ScopeConfigurator with this meter context.
79+ * @return The ScopeConfigurator for this meter context.
80+ */
81+ const instrumentationscope::ScopeConfigurator<MeterConfig> &GetMeterConfigurator () const noexcept ;
82+
83+ /* *
84+ * NOTE - INTERNAL method, can change in the future.
7485 * Process callback for each meter in thread-safe manner
7586 */
7687 bool ForEachMeter (nostd::function_ref<bool (std::shared_ptr<Meter> &meter)> callback) noexcept ;
7788
7889 /* *
79- * NOTE - INTERNAL method, can change in future.
90+ * NOTE - INTERNAL method, can change in the future.
8091 * Get the configured meters.
8192 * This method is NOT thread safe, and only called through MeterProvider
8293 *
@@ -154,6 +165,7 @@ class MeterContext : public std::enable_shared_from_this<MeterContext>
154165 std::vector<std::shared_ptr<CollectorHandle>> collectors_;
155166 std::unique_ptr<ViewRegistry> views_;
156167 opentelemetry::common::SystemTimestamp sdk_start_ts_;
168+ std::unique_ptr<instrumentationscope::ScopeConfigurator<MeterConfig>> meter_configurator_;
157169 std::vector<std::shared_ptr<Meter>> meters_;
158170
159171#ifdef ENABLE_METRICS_EXEMPLAR_PREVIEW
0 commit comments