From c5d48d73093d3a6cc4131792d2ae5e0ca15efe46 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Tue, 5 Dec 2023 23:56:41 +0100 Subject: [PATCH] More zpages cleanup --- INSTALL.md | 4 -- ci/do_ci.sh | 3 +- cmake/opentelemetry-cpp-config.cmake.in | 2 - docs/dependencies.md | 3 -- examples/zpages/BUILD | 21 --------- examples/zpages/zpages_example.cc | 60 ------------------------- 6 files changed, 1 insertion(+), 92 deletions(-) delete mode 100644 examples/zpages/BUILD delete mode 100644 examples/zpages/zpages_example.cc diff --git a/INSTALL.md b/INSTALL.md index 68fefff1fe..9cd9cef6e2 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -124,10 +124,6 @@ You can link OpenTelemetry C++ SDK with libraries provided in -- Installing: //lib/cmake/opentelemetry-cpp/opentelemetry-cpp-config.cmake -- Installing: //lib/cmake/opentelemetry-cpp/opentelemetry-cpp-config-version.cmake ... - -- Installing: //include/opentelemetry//ext/zpages/static/tracez_index.h - -- Installing: //include/opentelemetry//ext/zpages/static/tracez_style.h - -- Installing: //include/opentelemetry//ext/zpages/threadsafe_span_data.h - -- Installing: //lib/libopentelemetry_zpages.a $ ``` diff --git a/ci/do_ci.sh b/ci/do_ci.sh index f679c6af04..de03a2585e 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -459,8 +459,7 @@ elif [[ "$1" == "bazel.asan" ]]; then elif [[ "$1" == "bazel.tsan" ]]; then # TODO - potential race condition in Civetweb server used by prometheus-cpp during shutdown # https://github.com/civetweb/civetweb/issues/861, so removing prometheus from the test -# zpages test failing with tsan. Ignoring the tests for now, as zpages will be removed soon. - bazel $BAZEL_STARTUP_OPTIONS test --config=tsan $BAZEL_TEST_OPTIONS_ASYNC -- //... -//exporters/prometheus/... -//ext/test/zpages/... + bazel $BAZEL_STARTUP_OPTIONS test --config=tsan $BAZEL_TEST_OPTIONS_ASYNC -- //... -//exporters/prometheus/... exit 0 elif [[ "$1" == "bazel.valgrind" ]]; then bazel $BAZEL_STARTUP_OPTIONS build $BAZEL_OPTIONS_ASYNC //... diff --git a/cmake/opentelemetry-cpp-config.cmake.in b/cmake/opentelemetry-cpp-config.cmake.in index 5c450c1df6..86098f7d7c 100644 --- a/cmake/opentelemetry-cpp-config.cmake.in +++ b/cmake/opentelemetry-cpp-config.cmake.in @@ -46,7 +46,6 @@ # opentelemetry-cpp::ostream_span_exporter - Imported target of opentelemetry-cpp::ostream_span_exporter # opentelemetry-cpp::elasticsearch_log_record_exporter - Imported target of opentelemetry-cpp::elasticsearch_log_record_exporter # opentelemetry-cpp::etw_exporter - Imported target of opentelemetry-cpp::etw_exporter -# opentelemetry-cpp::zpages - Imported target of opentelemetry-cpp::zpages # opentelemetry-cpp::http_client_curl - Imported target of opentelemetry-cpp::http_client_curl # opentelemetry-cpp::opentracing_shim - Imported target of opentelemetry-cpp::opentracing_shim # @@ -100,7 +99,6 @@ set(_OPENTELEMETRY_CPP_LIBRARIES_TEST_TARGETS prometheus_exporter elasticsearch_log_record_exporter etw_exporter - zpages http_client_curl opentracing_shim) foreach(_TEST_TARGET IN LISTS _OPENTELEMETRY_CPP_LIBRARIES_TEST_TARGETS) diff --git a/docs/dependencies.md b/docs/dependencies.md index 2f2f2368f6..da6c584fe8 100644 --- a/docs/dependencies.md +++ b/docs/dependencies.md @@ -92,9 +92,6 @@ Both these dependencies are listed here: - `libcurl` for connecting with Elasticsearch server over HTTP protocol. - `nlohmann/json` for encoding Elastic Search messages. -- [Zpages](/ext/src/zpages): - - None - - [Opentracing](/opentracing-shim) shim: - [`opentracing-cpp`](https://github.com/opentracing/opentracing-cpp) diff --git a/examples/zpages/BUILD b/examples/zpages/BUILD deleted file mode 100644 index 529c839cb7..0000000000 --- a/examples/zpages/BUILD +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - -package(default_visibility = ["//visibility:public"]) - -cc_binary( - name = "zpages_example", - srcs = [ - "zpages_example.cc", - ], - linkopts = select({ - "//bazel:windows": [], - "//conditions:default": ["-pthread"], - }), - tags = ["examples"], - deps = [ - "//ext:headers", - "//ext/src/zpages", - "//sdk/src/trace", - ], -) diff --git a/examples/zpages/zpages_example.cc b/examples/zpages/zpages_example.cc deleted file mode 100644 index 2691a73158..0000000000 --- a/examples/zpages/zpages_example.cc +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -/** - * This is a basic example for zpages that helps users get familiar with how to - * use this feature in OpenTelemetery - */ -#include -#include -#include - -#include "opentelemetry/ext/zpages/zpages.h" // Required file include for zpages - -using opentelemetry::common::SteadyTimestamp; -namespace trace_api = opentelemetry::trace; - -int main(int argc, char *argv[]) -{ - - /** - * The following line initializes zPages and starts a webserver at - * http://localhost:30000/tracez/ where spans that are created in the application - * can be viewed. - * Note that the webserver is destroyed after the application ends execution. - */ - ZPages::Initialize(); - auto tracer = trace_api::Provider::GetTracerProvider()->GetTracer(""); - - std::cout << "This example for zPages creates a few types of spans and then " - << "creates a span every second for the duration of the application" - << "\n"; - - // Error span - std::map attribute_map; - attribute_map["completed_search_for"] = "Unknown user"; - tracer->StartSpan("find user", attribute_map) - ->SetStatus(trace_api::StatusCode::kError, "User not found"); - - // Long time duration span - std::map attribute_map2; - attribute_map2["completed_search_for"] = "John Doe"; - trace_api::StartSpanOptions start; - start.start_steady_time = SteadyTimestamp(nanoseconds(1)); - trace_api::EndSpanOptions end; - end.end_steady_time = SteadyTimestamp(nanoseconds(1000000000000)); - tracer->StartSpan("find user", attribute_map2, start)->End(end); - - // Running(deadlock) span - std::map attribute_map3; - attribute_map3["searching_for"] = "Deleted user"; - auto running_span = tracer->StartSpan("find user", attribute_map3); - - // Create a completed span every second till user stops the loop - std::cout << "Presss CTRL+C to stop...\n"; - while (true) - { - std::this_thread::sleep_for(seconds(1)); - tracer->StartSpan("ping user")->End(); - } -}