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

ETW Tracer exporter #376

Merged
merged 32 commits into from
Jan 6, 2021
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1af25dc
[Issue #326] ETW Tracer Exporter
mishal23 Nov 14, 2020
84834dd
add etwData class to use for recordable
mishal23 Nov 17, 2020
6978658
Added ETWSpan child from Recordable and defined MakeRecordable function
mishal23 Nov 18, 2020
3787b6a
replace NullKeyValueIterable with GetEmptyAttributes, use existing Cl…
mishal23 Nov 29, 2020
aaa949e
removed Invalid Span Context, fix formatter issues
mishal23 Nov 29, 2020
e8c0cf3
add spankind method, return in shutdown method
mishal23 Dec 13, 2020
faaf5c0
move etw_data to exporters/etw, wrap modules with if _WIN32
mishal23 Dec 19, 2020
2b87061
Merge branch 'master' into etw_exporter
maxgolov Dec 22, 2020
73cf5ec
Resolving code review comments
maxgolov Dec 23, 2020
8c4996e
Merge branch 'master' into etw_exporter
maxgolov Dec 23, 2020
fce52ec
Merge branch 'master' of http://github.com/open-telemetry/opentelemet…
maxgolov Dec 28, 2020
30c886d
Merge branch 'master' into etw_exporter
maxgolov Dec 28, 2020
97256c4
Merge branch 'etw_exporter' of https://github.com/mishal23/openteleme…
maxgolov Dec 28, 2020
5f5c16c
Merge branch 'master' into etw_exporter
maxgolov Dec 30, 2020
cac5150
Merge branch 'etw_exporter' of https://github.com/mishal23/openteleme…
maxgolov Dec 30, 2020
4ef7e81
Merge branch 'master' into etw_exporter
maxgolov Dec 30, 2020
6f74947
Merge branch 'etw_exporter' of https://github.com/mishal23/openteleme…
maxgolov Dec 30, 2020
19788f3
Fix compilation error with C++20 STL
maxgolov Dec 31, 2020
33505c6
Rename option to WITH_ETW to be consistent with other exporters
maxgolov Dec 31, 2020
ee99010
Fix missing include when compiling with C++20
maxgolov Dec 31, 2020
ec0e6ba
Resolve code review issue with NUL terminator
maxgolov Dec 31, 2020
466be98
Fix an issue that required C++-latest
maxgolov Dec 31, 2020
7acc32f
Add comment that highlights the places of code that turn-off TraceLog…
maxgolov Dec 31, 2020
c902bb2
Fix formatting issue
maxgolov Dec 31, 2020
1b1a5f2
Addressing code review comments: refactoring event::UUID to utils::UU…
maxgolov Dec 31, 2020
1d1e63d
Fix compiler error due to code review refactor
maxgolov Dec 31, 2020
27455e1
Addressing code review comment: review unused includes
maxgolov Dec 31, 2020
cf311b7
Merge branch 'master' into etw_exporter
maxgolov Dec 31, 2020
77c49e7
Merge branch 'master' into etw_exporter
maxgolov Jan 4, 2021
9ec1d2b
Move ETW exporter to 'exporter' namespace
maxgolov Jan 4, 2021
ea2a4e4
Apply code formatting
maxgolov Jan 4, 2021
a373b98
Merge branch 'master' into etw_exporter
lalitb Jan 6, 2021
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
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ option(WITH_ELASTICSEARCH
"Whether to include the Elasticsearch Client in the SDK" OFF)

option(BUILD_TESTING "Whether to enable tests" ON)
if(WIN32)
option(WITH_ETW "Whether to include the ETW Exporter in the SDK" ON)
if(WITH_ETW)
add_definitions(-DHAVE_MSGPACK)
# Option below will be removed once we donate the TraceLoggingDynamic.h to
# OSS
add_definitions(-DHAVE_NO_TLD)
endif(WITH_ETW)
endif(WIN32)

option(WITH_EXAMPLES "Whether to build examples" ON)

find_package(Threads)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class HttpTraceContext : public HTTPTextFormat<T>
// Converts the hex numbers stored as strings into bytes stored in a buffer.
static void GenerateHexFromString(nostd::string_view string, int bytes, uint8_t *buf)
{
const char *str_id = string.begin();
const char *str_id = string.data();
for (int i = 0; i < bytes; i++)
{
int tmp = HexToInt(str_id[i]);
Expand Down
4 changes: 4 additions & 0 deletions exporters/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ endif()
if(WITH_ELASTICSEARCH)
add_subdirectory(elasticsearch)
endif()

if(WITH_ETW)
add_subdirectory(etw)
endif()
55 changes: 55 additions & 0 deletions exporters/etw/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package(default_visibility = ["//visibility:public"])

cc_library(
maxgolov marked this conversation as resolved.
Show resolved Hide resolved
name = "etw_provider_exporter",
srcs = [
"src/etw_provider_exporter.cc",
],
hdrs = [
"include/opentelemetry/exporters/etw/etw_provider_exporter.h",
"include/opentelemetry/exporters/etw/utils.h",
"include/opentelemetry/exporters/etw/uuid.hpp",
],
strip_include_prefix = "include",
deps = [
"//api",
"//sdk/src/trace",
],
)

cc_test(
name = "etw_provider_test",
srcs = ["test/etw_provider_test.cc"],
deps = [
":etw_provider_exporter",
"@com_google_googletest//:gtest_main",
],
)

cc_library(
name = "etw_tracer_exporter",
srcs = [
"src/etw_tracer_exporter.cc",
],
hdrs = [
"include/opentelemetry/exporters/etw/etw_data.h",
"include/opentelemetry/exporters/etw/etw_tracer_exporter.h",
"include/opentelemetry/exporters/etw/utils.h",
"include/opentelemetry/exporters/etw/uuid.hpp",
],
strip_include_prefix = "include",
deps = [
":etw_provider_exporter",
"//api",
"//sdk/src/trace",
],
)

cc_test(
name = "etw_tracer_test",
srcs = ["test/etw_tracer_test.cc"],
deps = [
":etw_tracer_exporter",
"@com_google_googletest//:gtest_main",
],
)
26 changes: 26 additions & 0 deletions exporters/etw/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
include_directories(include)

add_library(opentelemetry_exporter_etw_provider src/etw_provider_exporter.cc)
add_library(opentelemetry_exporter_etw_tracer src/etw_tracer_exporter.cc)

if(BUILD_TESTING)
add_executable(etw_provider_test test/etw_provider_test.cc)
add_executable(etw_tracer_test test/etw_tracer_test.cc)

target_link_libraries(
etw_provider_test ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
opentelemetry_exporter_etw_provider)

target_link_libraries(
etw_tracer_test ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
opentelemetry_exporter_etw_tracer)

gtest_add_tests(
TARGET etw_provider_test
TEST_PREFIX exporter.
TEST_LIST etw_provider_test)
gtest_add_tests(
TARGET etw_tracer_test
TEST_PREFIX exporter.
TEST_LIST etw_tracer_test)
endif() # BUILD_TESTING
Loading