Skip to content

Commit ec0b6cf

Browse files
authored
Remove units parameter for Metrics::View in user_events and geneva examples (open-telemetry#575)
1 parent 9176445 commit ec0b6cf

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

.github/workflows/geneva_metrics.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
uses: actions/checkout@v3
2727
with:
2828
repository: "open-telemetry/opentelemetry-cpp"
29-
ref: "v1.22.0"
29+
ref: "v1.23.0"
3030
path: "otel_cpp"
3131
submodules: "recursive"
3232
- name: setup
@@ -36,7 +36,9 @@ jobs:
3636
ca-certificates wget git valgrind lcov
3737
- name: run tests
3838
run: |
39-
sudo $GITHUB_WORKSPACE/otel_cpp/ci/setup_googletest.sh
39+
pushd "$GITHUB_WORKSPACE/otel_cpp"
40+
sudo ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release --packages "googletest;benchmark"
41+
popd
4042
mkdir -p "$GITHUB_WORKSPACE/otel_cpp/build"
4143
cd "$GITHUB_WORKSPACE/otel_cpp/build"
4244
cmake .. -DOPENTELEMETRY_INSTALL=ON

.github/workflows/user_events.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
uses: actions/checkout@v3
3131
with:
3232
repository: "open-telemetry/opentelemetry-cpp"
33-
ref: "v1.21.0"
33+
ref: "v1.23.0"
3434
path: "opentelemetry-cpp"
3535
submodules: "recursive"
3636
- name: setup dependencies
@@ -50,7 +50,9 @@ jobs:
5050
5151
- name: run tests
5252
run: |
53-
sudo $GITHUB_WORKSPACE/opentelemetry-cpp/ci/setup_googletest.sh
53+
pushd "$GITHUB_WORKSPACE/opentelemetry-cpp"
54+
sudo ./ci/install_thirdparty.sh --install-dir /usr/local --tags-file third_party_release --packages "googletest;benchmark"
55+
popd
5456
mkdir -p "$GITHUB_WORKSPACE/opentelemetry-cpp/build"
5557
cd "$GITHUB_WORKSPACE/opentelemetry-cpp/build"
5658
cmake .. -G Ninja -D OPENTELEMETRY_EXTERNAL_COMPONENT_PATH=$GITHUB_WORKSPACE/opentelemetry-cpp-contrib/exporters/user_events -D WITH_OTLP_HTTP=ON

exporters/geneva/example/example_metrics.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void initMetrics(const std::string &name, const std::string &account_name) {
5757
std::unique_ptr<metric_sdk::MeterSelector> meter_selector{
5858
new metric_sdk::MeterSelector(name, version, schema)};
5959
std::unique_ptr<metric_sdk::View> sum_view{new metric_sdk::View{
60-
name, "description", "", metric_sdk::AggregationType::kSum}};
60+
name, "description", metric_sdk::AggregationType::kSum}};
6161
p->AddView(std::move(instrument_selector), std::move(meter_selector),
6262
std::move(sum_view));
6363

@@ -70,7 +70,7 @@ void initMetrics(const std::string &name, const std::string &account_name) {
7070
std::unique_ptr<metric_sdk::MeterSelector> observable_meter_selector{
7171
new metric_sdk::MeterSelector(name, version, schema)};
7272
std::unique_ptr<metric_sdk::View> observable_sum_view{new metric_sdk::View{
73-
name, "description", "", metric_sdk::AggregationType::kSum}};
73+
name, "description", metric_sdk::AggregationType::kSum}};
7474
p->AddView(std::move(observable_instrument_selector),
7575
std::move(observable_meter_selector),
7676
std::move(observable_sum_view));
@@ -90,7 +90,7 @@ void initMetrics(const std::string &name, const std::string &account_name) {
9090
->boundaries_ = std::vector<double>{0.0, 50.0, 100.0, 250.0, 500.0,
9191
750.0, 1000.0, 2500.0, 5000.0, 10000.0};
9292
std::unique_ptr<metric_sdk::View> histogram_view{new metric_sdk::View{
93-
name, "description", "", metric_sdk::AggregationType::kHistogram,
93+
name, "description", metric_sdk::AggregationType::kHistogram,
9494
aggregation_config}};
9595
p->AddView(std::move(histogram_instrument_selector),
9696
std::move(histogram_meter_selector), std::move(histogram_view));

exporters/user_events/example/metrics/main.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void initMetrics(const std::string &name, const std::string &account_name) {
5151
std::unique_ptr<metric_sdk::MeterSelector> meter_selector{
5252
new metric_sdk::MeterSelector(name, version, schema)};
5353
std::unique_ptr<metric_sdk::View> sum_view{new metric_sdk::View{
54-
name, "description", instrument_unit, metric_sdk::AggregationType::kSum}};
54+
name, "description", metric_sdk::AggregationType::kSum}};
5555
p->AddView(std::move(instrument_selector), std::move(meter_selector),
5656
std::move(sum_view));
5757

@@ -64,7 +64,7 @@ void initMetrics(const std::string &name, const std::string &account_name) {
6464
std::unique_ptr<metric_sdk::MeterSelector> observable_meter_selector{
6565
new metric_sdk::MeterSelector(name, version, schema)};
6666
std::unique_ptr<metric_sdk::View> observable_sum_view{new metric_sdk::View{
67-
name, "description", instrument_unit, metric_sdk::AggregationType::kSum}};
67+
name, "description", metric_sdk::AggregationType::kSum}};
6868
p->AddView(std::move(observable_instrument_selector),
6969
std::move(observable_meter_selector),
7070
std::move(observable_sum_view));
@@ -84,7 +84,7 @@ void initMetrics(const std::string &name, const std::string &account_name) {
8484
->boundaries_ = std::vector<double>{0.0, 50.0, 100.0, 250.0, 500.0,
8585
750.0, 1000.0, 2500.0, 5000.0, 10000.0};
8686
std::unique_ptr<metric_sdk::View> histogram_view{new metric_sdk::View{
87-
name, "description", instrument_unit, metric_sdk::AggregationType::kHistogram,
87+
name, "description", metric_sdk::AggregationType::kHistogram,
8888
aggregation_config}};
8989
p->AddView(std::move(histogram_instrument_selector),
9090
std::move(histogram_meter_selector), std::move(histogram_view));

0 commit comments

Comments
 (0)