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

Restructure Ext folder #292

Closed
Closed
Show file tree
Hide file tree
Changes from all 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
3 changes: 1 addition & 2 deletions examples/zpages/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ cc_binary(
"//conditions:default": ["-pthread"],
}),
deps = [
"//ext:headers",
"//ext/src/zpages",
"//ext/zpages",
"//sdk/src/trace",
],
)
7 changes: 2 additions & 5 deletions ext/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
add_subdirectory(src)

if(BUILD_TESTING)
add_subdirectory(test)
endif()
add_subdirectory(http)
add_subdirectory(zpages)
1 change: 1 addition & 0 deletions ext/http/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(server)
File renamed without changes.
3 changes: 3 additions & 0 deletions ext/http/server/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
add_library(http_server INTERFACE)

target_include_directories(http_server INTERFACE include)
1 change: 0 additions & 1 deletion ext/src/CMakeLists.txt

This file was deleted.

28 changes: 0 additions & 28 deletions ext/src/zpages/BUILD

This file was deleted.

12 changes: 0 additions & 12 deletions ext/src/zpages/CMakeLists.txt

This file was deleted.

45 changes: 0 additions & 45 deletions ext/src/zpages/README.md

This file was deleted.

1 change: 0 additions & 1 deletion ext/test/CMakeLists.txt

This file was deleted.

14 changes: 14 additions & 0 deletions ext/zpages/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package(default_visibility = ["//visibility:public"])

cc_library(
name = "zpages",
srcs = glob(["src/**/*.cc"]),
hdrs = glob(["include/**/*.h"]),
strip_include_prefix = "include",
deps = [
"//api",
"//ext/http/server:headers",
"//sdk:headers",
"@github_nlohmann_json//:json",
],
)
14 changes: 14 additions & 0 deletions ext/zpages/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
add_library(
opentelemetry_zpages src/tracez_processor.cc src/tracez_data_aggregator.cc
# TODO: add Cmake build for nlohmann JSON
# src/tracez_http_server.cc
)

target_include_directories(opentelemetry_zpages PUBLIC include)

target_link_libraries(opentelemetry_zpages opentelemetry_api
opentelemetry_trace http_server)

if(BUILD_TESTING)
add_subdirectory(test)
endif()
28 changes: 28 additions & 0 deletions ext/zpages/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# zPages
## Overview
zPages are a quick and light way to view tracing and metrics information on standard OpenTelemetry C++ instrumented applications. It requires no external dependencies or backend setup. See more information in the OTel zPages experimental [spec](https://github.com/open-telemetry/opentelemetry-specification/blob/5b86d4b6c42e6d1e47d9155ac1e2e27f0f0b7769/experimental/trace/zpages.md). OTel C++ currently only offers Tracez; future zPages to potentially add include TraceConfigz, RPCz, and Statsz. Events and links need to be added to Tracez.

# Usage
> TODO: Add CMake instructions

1. Add the following 2 lines of code
- `#include opentelemetry/ext/zpages/zpages.h // include zPages`
- `zpages::Initialize; // start up zPages in your app, before any tracing/span code`
2. Build and run your application normally
- For example, you can do this for the zPages example while at the root `opentelemetry-cpp` directory with:
```
bazel build //examples/zpages:zpages_example
bazel-bin/examples/zpages/zpages_example
```
If you look at the zPages example's source [code](https://github.com/open-telemetry/opentelemetry-cpp/blob/master/examples/zpages/zpages_example.cc), it demonstrates adding zPages, manual application instrumentation (which sends data to zPages for viewing), and simulated use cases for zPages.
3. View zPages at http://localhost:3000/tracez


## More Information
- OTel zPages experimental [spec](https://github.com/open-telemetry/opentelemetry-specification/blob/5b86d4b6c42e6d1e47d9155ac1e2e27f0f0b7769/experimental/trace/zpages.md)
- [zPages General Direction Spec (OTEP)](https://github.com/open-telemetry/oteps/blob/master/text/0110-z-pages.md)
- OTel C++ Design Docs
- [Tracez Span Processor](https://docs.google.com/document/d/1kO4iZARYyr-EGBlY2VNM3ELU3iw6ZrC58Omup_YT-fU/edit#)
- [Tracez Data Aggregator](https://docs.google.com/document/d/1ziKFgvhXFfRXZjOlAHQRR-TzcNcTXzg1p2I9oPCEIoU/edit?ts=5ef0d177#heading=h.5irk4csrpu0y)
- [Tracez Http Server](https://docs.google.com/document/d/1U1V8QZ5LtGl4Mich-aJ6KZGLHrMIE8pWyspmzvnIefI/edit#) - also includes reference picturesof zPages/Tracez UI

File renamed without changes.
6 changes: 3 additions & 3 deletions ext/test/zpages/BUILD → ext/zpages/test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cc_test(
"threadsafe_span_data_test.cc",
],
deps = [
"//ext/src/zpages",
"//ext/zpages",
"//sdk/src/trace",
"@com_google_googletest//:gtest_main",
],
Expand All @@ -16,7 +16,7 @@ cc_test(
"tracez_data_aggregator_test.cc",
],
deps = [
"//ext/src/zpages",
"//ext/zpages",
"//sdk/src/trace",
"@com_google_googletest//:gtest_main",
],
Expand All @@ -28,7 +28,7 @@ cc_test(
"tracez_processor_test.cc",
],
deps = [
"//ext/src/zpages",
"//ext/zpages",
"//sdk/src/trace",
"@com_google_googletest//:gtest_main",
],
Expand Down
File renamed without changes.