diff --git a/bazel/repository.bzl b/bazel/repository.bzl index 9900f249fd..81c9b3f470 100644 --- a/bazel/repository.bzl +++ b/bazel/repository.bzl @@ -72,13 +72,23 @@ def opentelemetry_cpp_deps(): ], ) + maybe( + http_archive, + name = "com_github_grpc_grpc_latest11", + sha256 = "e266aa0d9d9cddb876484a370b94f468248594a96ca0b6f87c21f969db2b8c5b", + strip_prefix = "grpc-1.46.4", + urls = [ + "https://github.com/grpc/grpc/archive/v1.46.4.tar.gz", + ], + ) + maybe( http_archive, name = "com_github_grpc_grpc", - sha256 = "b74ce7d26fe187970d1d8e2c06a5d3391122f7bc1fdce569aff5e435fb8fe780", - strip_prefix = "grpc-1.43.2", + sha256 = "320366665d19027cda87b2368c03939006a37e0388bfd1091c8d2a96fbc93bd8", + strip_prefix = "grpc-1.48.1", urls = [ - "https://github.com/grpc/grpc/archive/v1.43.2.tar.gz", + "https://github.com/grpc/grpc/archive/v1.48.1.tar.gz", ], ) diff --git a/ci/do_ci.sh b/ci/do_ci.sh index d457495032..97f5b2b98b 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -25,7 +25,7 @@ function run_benchmarks [ -z "${BENCHMARK_DIR}" ] && export BENCHMARK_DIR=$HOME/benchmark mkdir -p $BENCHMARK_DIR - bazel $BAZEL_STARTUP_OPTIONS build $BAZEL_OPTIONS_ASYNC -c opt -- \ + bazel $BAZEL_STARTUP_OPTIONS build --cxxopt=-std=c++14 $BAZEL_OPTIONS_ASYNC -c opt -- \ $(bazel query 'attr("tags", "benchmark_result", ...)') echo "" echo "Benchmark results in $BENCHMARK_DIR:" @@ -59,7 +59,8 @@ mkdir -p "${BUILD_DIR}" [ -z "${PLUGIN_DIR}" ] && export PLUGIN_DIR=$HOME/plugin mkdir -p "${PLUGIN_DIR}" -BAZEL_OPTIONS="--copt=-DENABLE_LOGS_PREVIEW --copt=-DENABLE_TEST --copt=-DENABLE_METRICS_EXEMPLAR_PREVIEW" +BAZEL_OPTIONS_DEFAULT="--copt=-DENABLE_LOGS_PREVIEW --copt=-DENABLE_TEST --copt=-DENABLE_METRICS_EXEMPLAR_PREVIEW" +BAZEL_OPTIONS="--cxxopt=-std=c++14 $BAZEL_OPTIONS_DEFAULT" BAZEL_TEST_OPTIONS="$BAZEL_OPTIONS --test_output=errors" @@ -298,9 +299,13 @@ elif [[ "$1" == "bazel.valgrind" ]]; then bazel $BAZEL_STARTUP_OPTIONS build $BAZEL_OPTIONS_ASYNC //... bazel $BAZEL_STARTUP_OPTIONS test --run_under="/usr/bin/valgrind --leak-check=full --error-exitcode=1 --suppressions=\"${SRC_DIR}/ci/valgrind-suppressions\"" $BAZEL_TEST_OPTIONS_ASYNC //... exit 0 +elif [[ "$1" == "bazel.e2e" ]]; then + cd examples/e2e + bazel $BAZEL_STARTUP_OPTIONS build $BAZEL_OPTIONS_DEFAULT //... + exit 0 elif [[ "$1" == "benchmark" ]]; then [ -z "${BENCHMARK_DIR}" ] && export BENCHMARK_DIR=$HOME/benchmark - bazel $BAZEL_STARTUP_OPTIONS build $BAZEL_OPTIONS_ASYNC -c opt -- \ + bazel $BAZEL_STARTUP_OPTIONS build --cxxopt=-std=c++14 $BAZEL_OPTIONS_ASYNC -c opt -- \ $(bazel query 'attr("tags", "benchmark_result", ...)') echo "" echo "Benchmark results in $BENCHMARK_DIR:" diff --git a/exporters/otlp/test/otlp_grpc_exporter_benchmark.cc b/exporters/otlp/test/otlp_grpc_exporter_benchmark.cc index c86f5e53ba..b4a23c04a5 100644 --- a/exporters/otlp/test/otlp_grpc_exporter_benchmark.cc +++ b/exporters/otlp/test/otlp_grpc_exporter_benchmark.cc @@ -187,6 +187,10 @@ BENCHMARK(BM_OtlpExporterDenseSpans); } // namespace exporter OPENTELEMETRY_END_NAMESPACE +#ifdef NDEBUG +// disabled as valgrind reports a memroy leak at absl::lts_20220623::random_internal::(anonymous +// namespace)::PoolAlignedAlloc() +// see PR #1737 namespace { opentelemetry::exporter::otlp::OtlpGrpcExporterOptions opts; @@ -212,5 +216,6 @@ void BM_otlp_grpc_with_collector(benchmark::State &state) } BENCHMARK(BM_otlp_grpc_with_collector); } // namespace +#endif BENCHMARK_MAIN(); diff --git a/exporters/otlp/test/otlp_http_exporter_test.cc b/exporters/otlp/test/otlp_http_exporter_test.cc index 35ae5f50d7..fe2dd37e07 100644 --- a/exporters/otlp/test/otlp_http_exporter_test.cc +++ b/exporters/otlp/test/otlp_http_exporter_test.cc @@ -21,6 +21,7 @@ # include "opentelemetry/sdk/trace/tracer_provider.h" # include "opentelemetry/trace/provider.h" +# include # include # include "gmock/gmock.h" @@ -466,6 +467,7 @@ TEST_F(OtlpHttpExporterTestPeer, ExportJsonIntegrationTestSync) TEST_F(OtlpHttpExporterTestPeer, ExportJsonIntegrationTestAsync) { ExportJsonIntegrationTestAsync(); + google::protobuf::ShutdownProtobufLibrary(); } # endif diff --git a/exporters/otlp/test/otlp_http_log_record_exporter_test.cc b/exporters/otlp/test/otlp_http_log_record_exporter_test.cc index ca23fb7fe5..e1ab896083 100644 --- a/exporters/otlp/test/otlp_http_log_record_exporter_test.cc +++ b/exporters/otlp/test/otlp_http_log_record_exporter_test.cc @@ -26,6 +26,7 @@ # include "opentelemetry/sdk/logs/logger_provider.h" # include "opentelemetry/sdk/resource/resource.h" +# include # include # include "gmock/gmock.h" @@ -507,6 +508,7 @@ TEST_F(OtlpHttpLogRecordExporterTestPeer, ExportJsonIntegrationTestSync) TEST_F(OtlpHttpLogRecordExporterTestPeer, ExportJsonIntegrationTestAsync) { ExportJsonIntegrationTestAsync(); + google::protobuf::ShutdownProtobufLibrary(); } # endif diff --git a/exporters/otlp/test/otlp_http_metric_exporter_test.cc b/exporters/otlp/test/otlp_http_metric_exporter_test.cc index c8ccb8cc8f..7d4f2a1ebd 100644 --- a/exporters/otlp/test/otlp_http_metric_exporter_test.cc +++ b/exporters/otlp/test/otlp_http_metric_exporter_test.cc @@ -23,6 +23,7 @@ #include "opentelemetry/sdk/metrics/instruments.h" #include "opentelemetry/sdk/resource/resource.h" +#include #include #include "gmock/gmock.h" @@ -845,6 +846,7 @@ TEST_F(OtlpHttpMetricExporterTestPeer, ConfigJsonBytesMappingTest) opts.json_bytes_mapping = JsonBytesMappingKind::kHex; std::unique_ptr exporter(new OtlpHttpMetricExporter(opts)); EXPECT_EQ(GetOptions(exporter).json_bytes_mapping, JsonBytesMappingKind::kHex); + google::protobuf::ShutdownProtobufLibrary(); } #ifndef NO_GETENV