Skip to content

Commit a7a1234

Browse files
committed
fix comments
1 parent 9040c38 commit a7a1234

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

examples/common/metrics_foo_library/foo_library.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ void foo_library::histogram_exp_example(const std::string &name)
116116
{
117117
std::string histogram_name = name + "_exponential_histogram";
118118
auto provider = metrics_api::Provider::GetMeterProvider();
119-
opentelemetry::nostd::shared_ptr<metrics_api::Meter> meter = provider->GetMeter(name, "1.2.0");
119+
auto meter = provider->GetMeter(name, "1.2.0");
120120
auto histogram_counter = meter->CreateDoubleHistogram(histogram_name, "des", "histogram-unit");
121121
auto context = opentelemetry::context::Context{};
122122
for (uint32_t i = 0; i < 20; ++i)

examples/otlp/grpc_metric_main.cc

+7-5
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ void InitMetrics(std::string &name)
5858
auto provider = metric_sdk::MeterProviderFactory::Create(std::move(context));
5959

6060
// histogram view
61-
std::string histogram_name = name + "_histogram";
62-
std::string unit = "unit";
61+
std::string histogram_name = name + "_exponential_histogram";
62+
std::string unit = "histogram-unit";
6363

6464
auto histogram_instrument_selector = metric_sdk::InstrumentSelectorFactory::Create(
6565
metric_sdk::InstrumentType::kHistogram, histogram_name, unit);
@@ -79,7 +79,7 @@ void InitMetrics(std::string &name)
7979
std::move(histogram_aggregation_config));
8080

8181
auto histogram_view = metric_sdk::ViewFactory::Create(
82-
name, "description", unit, metric_sdk::AggregationType::kBase2ExponentialHistogram,
82+
name, "des", unit, metric_sdk::AggregationType::kBase2ExponentialHistogram,
8383
aggregation_config);
8484

8585
provider->AddView(std::move(histogram_instrument_selector), std::move(histogram_meter_selector),
@@ -151,13 +151,15 @@ int main(int argc, char *argv[])
151151
std::thread counter_example{&foo_library::counter_example, name};
152152
std::thread observable_counter_example{&foo_library::observable_counter_example, name};
153153
std::thread histogram_example{&foo_library::histogram_example, name};
154+
std::thread histogram_exp_example{&foo_library::histogram_exp_example, name};
154155
#if OPENTELEMETRY_ABI_VERSION_NO >= 2
155156
std::thread gauge_example{&foo_library::gauge_example, name};
156157
#endif
157158

158-
// counter_example.join();
159-
// observable_counter_example.join();
159+
counter_example.join();
160+
observable_counter_example.join();
160161
histogram_example.join();
162+
histogram_exp_example.join();
161163
#if OPENTELEMETRY_ABI_VERSION_NO >= 2
162164
gauge_example.join();
163165
#endif

0 commit comments

Comments
 (0)