Skip to content

Commit

Permalink
Add CI jobs for new and deprecated metrics (#1531)
Browse files Browse the repository at this point in the history
  • Loading branch information
esigo authored Aug 12, 2022
1 parent 1b9aa31 commit d04e1ce
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 9 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,22 @@ jobs:
sudo ./ci/setup_thrift.sh
./ci/do_ci.sh cmake.test
cmake_deprecated_metrics_test:
name: CMake test (without otlp-exporter and with deprecated metrics)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: setup
run: |
sudo ./ci/setup_cmake.sh
sudo ./ci/setup_ci_environment.sh
- name: run cmake tests (without otlp-exporter)
run: |
sudo ./ci/setup_thrift.sh
./ci/do_ci.sh cmake.deprecated_metrics.test
cmake_with_async_export_test:
name: CMake test (without otlp-exporter and with async export)
runs-on: ubuntu-latest
Expand Down Expand Up @@ -166,6 +182,28 @@ jobs:
- name: run tests
run: ./ci/do_ci.sh bazel.test

bazel_deprecated_metrics_test:
name: Bazel deprecated metrics
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Mount Bazel Cache
uses: actions/cache@v3
env:
cache-name: bazel_cache
with:
path: /home/runner/.cache/bazel
key: bazel_test
- name: setup
run: |
sudo ./ci/setup_thrift.sh dependencies_only
sudo ./ci/setup_ci_environment.sh
sudo ./ci/install_bazelisk.sh
- name: run tests
run: ./ci/do_ci.sh bazel.deprecated_metrics.test

bazel_test_async:
name: Bazel with async export
runs-on: ubuntu-latest
Expand Down
35 changes: 26 additions & 9 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ mkdir -p "${BUILD_DIR}"
mkdir -p "${PLUGIN_DIR}"

BAZEL_OPTIONS="--copt=-DENABLE_LOGS_PREVIEW --copt=-DENABLE_TEST"
# Previous legacy metrics use virtual drive, which can not be used without RTTI
if [[ "$1" != "bazel.nortti" ]]; then
BAZEL_OPTIONS="$BAZEL_OPTIONS --copt=-DENABLE_METRICS_PREVIEW"
fi

BAZEL_TEST_OPTIONS="$BAZEL_OPTIONS --test_output=errors"

BAZEL_OPTIONS_ASYNC="$BAZEL_OPTIONS --copt=-DENABLE_ASYNC_EXPORT"
Expand Down Expand Up @@ -100,19 +97,35 @@ elif [[ "$1" == "cmake.with_async_export.test" ]]; then
-DWITH_ZIPKIN=ON \
-DWITH_JAEGER=ON \
-DWITH_ELASTICSEARCH=ON \
-DWITH_METRICS_PREVIEW=ON \
-DWITH_METRICS_PREVIEW=OFF \
-DWITH_LOGS_PREVIEW=ON \
-DCMAKE_CXX_FLAGS="-Werror" \
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
"${SRC_DIR}"
make
make test
exit 0
elif [[ "$1" == "cmake.abseil.test" ]]; then
elif [[ "$1" == "cmake.deprecated_metrics.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake -DCMAKE_BUILD_TYPE=Debug \
-DWITH_PROMETHEUS=ON \
-DWITH_ZIPKIN=OFF \
-DWITH_JAEGER=OFF \
-DWITH_ELASTICSEARCH=OFF \
-DWITH_METRICS_PREVIEW=ON \
-DWITH_LOGS_PREVIEW=OFF \
-DCMAKE_CXX_FLAGS="-Werror" \
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
"${SRC_DIR}"
make
make test
exit 0
elif [[ "$1" == "cmake.abseil.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake -DCMAKE_BUILD_TYPE=Debug \
-DWITH_METRICS_PREVIEW=OFF \
-DWITH_LOGS_PREVIEW=ON \
-DCMAKE_CXX_FLAGS="-Werror" \
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
Expand All @@ -136,7 +149,7 @@ elif [[ "$1" == "cmake.c++20.stl.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake -DCMAKE_BUILD_TYPE=Debug \
-DWITH_METRICS_PREVIEW=ON \
-DWITH_METRICS_PREVIEW=OFF \
-DWITH_LOGS_PREVIEW=ON \
-DCMAKE_CXX_FLAGS="-Werror" \
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
Expand Down Expand Up @@ -242,6 +255,10 @@ elif [[ "$1" == "bazel.test" ]]; then
bazel $BAZEL_STARTUP_OPTIONS build $BAZEL_OPTIONS //...
bazel $BAZEL_STARTUP_OPTIONS test $BAZEL_TEST_OPTIONS //...
exit 0
elif [[ "$1" == "bazel.deprecated_metrics.test" ]]; then
bazel $BAZEL_STARTUP_OPTIONS build $BAZEL_OPTIONS --copt=-DENABLE_METRICS_PREVIEW //...
bazel $BAZEL_STARTUP_OPTIONS test $BAZEL_TEST_OPTIONS --copt=-DENABLE_METRICS_PREVIEW //...
exit 0
elif [[ "$1" == "bazel.with_async_export.test" ]]; then
bazel $BAZEL_STARTUP_OPTIONS build $BAZEL_OPTIONS_ASYNC //...
bazel $BAZEL_STARTUP_OPTIONS test $BAZEL_TEST_OPTIONS_ASYNC //...
Expand All @@ -262,8 +279,8 @@ elif [[ "$1" == "bazel.legacy.test" ]]; then
elif [[ "$1" == "bazel.noexcept" ]]; then
# there are some exceptions and error handling code from the Prometheus and Jaeger Clients
# that make this test always fail. ignore Prometheus and Jaeger exporters in the noexcept here.
bazel $BAZEL_STARTUP_OPTIONS build --copt=-fno-exceptions --build_tag_filters=-jaeger $BAZEL_OPTIONS_ASYNC -- //... -//exporters/prometheus/... -//exporters/jaeger/... -//examples/prometheus/...
bazel $BAZEL_STARTUP_OPTIONS test --copt=-fno-exceptions --build_tag_filters=-jaeger $BAZEL_TEST_OPTIONS_ASYNC -- //... -//exporters/prometheus/... -//exporters/jaeger/... -//examples/prometheus/...
bazel $BAZEL_STARTUP_OPTIONS build --copt=-fno-exceptions --build_tag_filters=-jaeger $BAZEL_OPTIONS_ASYNC -- //... -//exporters/prometheus/... -//exporters/jaeger/... -//examples/prometheus/... -//sdk/test/metrics:attributes_hashmap_test
bazel $BAZEL_STARTUP_OPTIONS test --copt=-fno-exceptions --build_tag_filters=-jaeger $BAZEL_TEST_OPTIONS_ASYNC -- //... -//exporters/prometheus/... -//exporters/jaeger/... -//examples/prometheus/... -//sdk/test/metrics:attributes_hashmap_test
exit 0
elif [[ "$1" == "bazel.nortti" ]]; then
# there are some exceptions and error handling code from the Prometheus and Jaeger Clients
Expand Down

1 comment on commit d04e1ce

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'OpenTelemetry-cpp api Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: d04e1ce Previous: 1b9aa31 Ratio
BM_SpinLockThrashing/1/process_time/real_time 0.5326006147596571 ms/iter 0.11080479792321457 ms/iter 4.81
BM_SpinLockThrashing/2/process_time/real_time 1.4015281641924824 ms/iter 0.25704355954688035 ms/iter 5.45
BM_ProcYieldSpinLockThrashing/1/process_time/real_time 0.6934117846389907 ms/iter 0.11189979842946499 ms/iter 6.20
BM_ProcYieldSpinLockThrashing/2/process_time/real_time 1.3216937984432187 ms/iter 0.21705680089042015 ms/iter 6.09
BM_NaiveSpinLockThrashing/1/process_time/real_time 0.5020203552846834 ms/iter 0.10891377274964045 ms/iter 4.61
BM_NaiveSpinLockThrashing/2/process_time/real_time 0.9426991801616574 ms/iter 0.21307860932699063 ms/iter 4.42
BM_ThreadYieldSpinLockThrashing/1/process_time/real_time 29.327774047851562 ms/iter 6.498878652399236 ms/iter 4.51

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.