Skip to content

Commit

Permalink
[EXPORTER] OTLP file exporter (#2540)
Browse files Browse the repository at this point in the history
  • Loading branch information
owent authored Apr 3, 2024
1 parent 13a4c45 commit e86ceba
Show file tree
Hide file tree
Showing 36 changed files with 4,515 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Increment the:

## [Unreleased]

* [EXPORTER] Add OTLP File exporters
[#2540](https://github.com/open-telemetry/opentelemetry-cpp/pull/2540)
* [EXPORTER] Gzip compression support for OTLP/HTTP and OTLP/gRPC exporter
[#2530](https://github.com/open-telemetry/opentelemetry-cpp/pull/2530)
* [EXPORTER] Support URL-encoded values for `OTEL_EXPORTER_OTLP_HEADERS`
Expand Down
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ option(WITH_OTLP_GRPC "Whether to include the OTLP gRPC exporter in the SDK"
option(WITH_OTLP_HTTP "Whether to include the OTLP http exporter in the SDK"
OFF)

option(WITH_OTLP_FILE "Whether to include the OTLP file exporter in the SDK"
OFF)

option(
WITH_OTLP_HTTP_COMPRESSION
"Whether to include gzip compression for the OTLP http exporter in the SDK"
Expand Down Expand Up @@ -370,7 +373,9 @@ if(WITH_ABSEIL)
find_package(absl CONFIG REQUIRED)
endif()

if(WITH_OTLP_GRPC OR WITH_OTLP_HTTP)
if(WITH_OTLP_GRPC
OR WITH_OTLP_HTTP
OR WITH_OTLP_FILE)
find_package(Protobuf)
if(Protobuf_VERSION AND Protobuf_VERSION VERSION_GREATER_EQUAL "3.22.0")
if(NOT WITH_ABSEIL)
Expand Down Expand Up @@ -473,6 +478,7 @@ endif()
if(WITH_ELASTICSEARCH
OR WITH_ZIPKIN
OR WITH_OTLP_HTTP
OR WITH_OTLP_FILE
OR BUILD_W3CTRACECONTEXT_TEST
OR WITH_ETW)
set(USE_NLOHMANN_JSON ON)
Expand Down
9 changes: 9 additions & 0 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ elif [[ "$1" == "cmake.maintainer.sync.test" ]]; then
rm -rf *
cmake "${CMAKE_OPTIONS[@]}" \
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_FILE=ON \
-DWITH_PROMETHEUS=ON \
-DWITH_EXAMPLES=ON \
-DWITH_EXAMPLES_HTTP=ON \
Expand All @@ -135,6 +136,7 @@ elif [[ "$1" == "cmake.maintainer.async.test" ]]; then
rm -rf *
cmake "${CMAKE_OPTIONS[@]}" \
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_FILE=ON \
-DWITH_PROMETHEUS=ON \
-DWITH_EXAMPLES=ON \
-DWITH_EXAMPLES_HTTP=ON \
Expand All @@ -157,6 +159,7 @@ elif [[ "$1" == "cmake.maintainer.cpp11.async.test" ]]; then
cmake "${CMAKE_OPTIONS[@]}" \
-DCMAKE_CXX_STANDARD=11 \
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_FILE=ON \
-DWITH_PROMETHEUS=ON \
-DWITH_EXAMPLES=ON \
-DWITH_EXAMPLES_HTTP=ON \
Expand All @@ -177,6 +180,7 @@ elif [[ "$1" == "cmake.maintainer.abiv2.test" ]]; then
rm -rf *
cmake "${CMAKE_OPTIONS[@]}" \
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_FILE=ON \
-DWITH_PROMETHEUS=ON \
-DWITH_EXAMPLES=ON \
-DWITH_EXAMPLES_HTTP=ON \
Expand Down Expand Up @@ -327,6 +331,7 @@ elif [[ "$1" == "cmake.legacy.exporter.otprotocol.test" ]]; then
-DCMAKE_CXX_STANDARD=11 \
-DWITH_OTLP_GRPC=ON \
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_FILE=ON \
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
"${SRC_DIR}"
grpc_cpp_plugin=`which grpc_cpp_plugin`
Expand All @@ -344,6 +349,7 @@ elif [[ "$1" == "cmake.exporter.otprotocol.test" ]]; then
cmake "${CMAKE_OPTIONS[@]}" \
-DWITH_OTLP_GRPC=ON \
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_FILE=ON \
-DWITH_OTLP_GRPC_SSL_MTLS_PREVIEW=ON \
"${SRC_DIR}"
grpc_cpp_plugin=`which grpc_cpp_plugin`
Expand All @@ -358,6 +364,7 @@ elif [[ "$1" == "cmake.exporter.otprotocol.shared_libs.with_static_grpc.test" ]]
cmake "${CMAKE_OPTIONS[@]}" \
-DWITH_OTLP_GRPC=ON \
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_FILE=ON \
-DBUILD_SHARED_LIBS=ON \
"${SRC_DIR}"
grpc_cpp_plugin=`which grpc_cpp_plugin`
Expand All @@ -372,6 +379,7 @@ elif [[ "$1" == "cmake.exporter.otprotocol.with_async_export.test" ]]; then
cmake "${CMAKE_OPTIONS[@]}" \
-DWITH_OTLP_GRPC=ON \
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_FILE=ON \
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
"${SRC_DIR}"
grpc_cpp_plugin=`which grpc_cpp_plugin`
Expand All @@ -386,6 +394,7 @@ elif [[ "$1" == "cmake.do_not_install.test" ]]; then
cmake "${CMAKE_OPTIONS[@]}" \
-DWITH_OTLP_GRPC=ON \
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_FILE=ON \
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
-DOPENTELEMETRY_INSTALL=OFF \
"${SRC_DIR}"
Expand Down
8 changes: 8 additions & 0 deletions cmake/opentelemetry-cpp-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
# opentelemetry-cpp::otlp_http_exporter - Imported target of opentelemetry-cpp::otlp_http_exporter
# opentelemetry-cpp::otlp_http_log_record_exporter - Imported target of opentelemetry-cpp::otlp_http_log_record_exporter
# opentelemetry-cpp::otlp_http_metric_exporter - Imported target of opentelemetry-cpp::otlp_http_metric_exporter
# opentelemetry-cpp::otlp_file_client - Imported target of opentelemetry-cpp::otlp_file_client
# opentelemetry-cpp::otlp_file_exporter - Imported target of opentelemetry-cpp::otlp_file_exporter
# opentelemetry-cpp::otlp_file_log_record_exporter - Imported target of opentelemetry-cpp::otlp_file_log_record_exporter
# opentelemetry-cpp::otlp_file_metric_exporter - Imported target of opentelemetry-cpp::otlp_file_metric_exporter
# opentelemetry-cpp::ostream_log_record_exporter - Imported target of opentelemetry-cpp::ostream_log_record_exporter
# opentelemetry-cpp::ostream_metrics_exporter - Imported target of opentelemetry-cpp::ostream_metrics_exporter
# opentelemetry-cpp::ostream_span_exporter - Imported target of opentelemetry-cpp::ostream_span_exporter
Expand Down Expand Up @@ -93,6 +97,10 @@ set(_OPENTELEMETRY_CPP_LIBRARIES_TEST_TARGETS
otlp_http_exporter
otlp_http_log_record_exporter
otlp_http_metric_exporter
otlp_file_client
otlp_file_exporter
otlp_file_log_record_exporter
otlp_file_metric_exporter
ostream_log_record_exporter
ostream_metrics_exporter
ostream_span_exporter
Expand Down
4 changes: 3 additions & 1 deletion exporters/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

if(WITH_OTLP_GRPC OR WITH_OTLP_HTTP)
if(WITH_OTLP_GRPC
OR WITH_OTLP_HTTP
OR WITH_OTLP_FILE)
add_subdirectory(otlp)
endif()

Expand Down
Loading

2 comments on commit e86ceba

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'OpenTelemetry-cpp sdk Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: e86ceba Previous: 13a4c45 Ratio
BM_BaselineBuffer/2 13978271.484375 ns/iter 2284317.6590124895 ns/iter 6.12
BM_BaselineBuffer/4 14494221.210479736 ns/iter 2457545.1696278206 ns/iter 5.90
BM_LockFreeBuffer/2 6788110.733032227 ns/iter 1042766.5710449219 ns/iter 6.51
BM_LockFreeBuffer/4 10395660.400390625 ns/iter 1054352.268259576 ns/iter 9.86

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'OpenTelemetry-cpp api Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: e86ceba Previous: 13a4c45 Ratio
BM_SpinLockThrashing/1/process_time/real_time 10.382986068725586 ms/iter 0.1098790168762207 ms/iter 94.49
BM_SpinLockThrashing/2/process_time/real_time 11.053085327148438 ms/iter 0.19379477426795763 ms/iter 57.04
BM_SpinLockThrashing/4/process_time/real_time 11.057376861572266 ms/iter 0.5648085626505189 ms/iter 19.58

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.