Skip to content

Commit

Permalink
ETW Tracer exporter (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
mishal23 authored Jan 6, 2021
1 parent 614d3c0 commit e8ef7ea
Show file tree
Hide file tree
Showing 15 changed files with 2,220 additions and 4 deletions.
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
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(
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.h",
],
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.h",
],
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

0 comments on commit e8ef7ea

Please sign in to comment.