Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EXAMPLES] Fix view names in Prometheus example #2034

Merged
merged 6 commits into from
Mar 16, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/prometheus/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void InitMetrics(const std::string &name, const std::string &addr)
std::unique_ptr<metrics_sdk::MeterSelector> meter_selector{
new metrics_sdk::MeterSelector(name, version, schema)};
std::unique_ptr<metrics_sdk::View> sum_view{
new metrics_sdk::View{name, "description", metrics_sdk::AggregationType::kSum}};
new metrics_sdk::View{counter_name, "description", metrics_sdk::AggregationType::kSum}};
p->AddView(std::move(instrument_selector), std::move(meter_selector), std::move(sum_view));

// histogram view
Expand All @@ -61,8 +61,8 @@ void InitMetrics(const std::string &name, const std::string &addr)
new metrics_sdk::InstrumentSelector(metrics_sdk::InstrumentType::kHistogram, histogram_name)};
std::unique_ptr<metrics_sdk::MeterSelector> histogram_meter_selector{
new metrics_sdk::MeterSelector(name, version, schema)};
std::unique_ptr<metrics_sdk::View> histogram_view{
new metrics_sdk::View{name, "description", metrics_sdk::AggregationType::kHistogram}};
std::unique_ptr<metrics_sdk::View> histogram_view{new metrics_sdk::View{
histogram_name, "description", metrics_sdk::AggregationType::kHistogram}};
p->AddView(std::move(histogram_instrument_selector), std::move(histogram_meter_selector),
std::move(histogram_view));
metrics_api::Provider::SetMeterProvider(provider);
Expand Down