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

[EXPORTER] Add OTLP HTTP SSL support #1793

Merged
merged 90 commits into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
e3f1b17
[WIP] Implement OTLP HTTP SSL
marcalff Nov 23, 2022
236832d
Merge branch 'main' into fix_otlp_http_ssl_1402
marcalff Nov 23, 2022
9f5c8aa
Format cleanup
marcalff Nov 23, 2022
82341ef
Cleanup
marcalff Nov 23, 2022
000e36d
Fixed windows build
marcalff Nov 24, 2022
29f2851
PROTOTYPE, investigating CURLOPT for SSL.
marcalff Nov 24, 2022
98cf4bb
Build cleanup
marcalff Nov 25, 2022
0a7d8a6
Merge branch 'open-telemetry:main' into fix_otlp_http_ssl_1402
marcalff Nov 25, 2022
8362479
Build cleanup
marcalff Nov 25, 2022
20d0e16
Implement CURLOPT for SSL.
marcalff Nov 25, 2022
e4afdb6
Merge branch 'open-telemetry:main' into fix_otlp_http_ssl_1402
marcalff Nov 28, 2022
41dfeb9
Merge branch 'main' into fix_otlp_http_ssl_1402
marcalff Dec 1, 2022
461eec5
Work in progress
marcalff Dec 1, 2022
8c7e68e
Merge branch 'main' into fix_otlp_http_ssl_1402
marcalff Dec 2, 2022
d25fae8
Work in progress
marcalff Dec 6, 2022
d5164e3
Work in progress, continued.
marcalff Dec 6, 2022
d686852
Merge branch 'main' into fix_otlp_http_ssl_1402
marcalff Dec 7, 2022
cf6cb43
Used CAINFO
marcalff Dec 7, 2022
51eaad7
Merge branch 'open-telemetry:main' into fix_otlp_http_ssl_1402
marcalff Dec 7, 2022
eba3156
Merge branch 'open-telemetry:main' into fix_otlp_http_ssl_1402
marcalff Dec 11, 2022
21acc47
Merge branch 'open-telemetry:main' into fix_otlp_http_ssl_1402
marcalff Dec 13, 2022
956774a
Added doc, testing with SSL/TLS.
marcalff Dec 13, 2022
299d774
Implemented flag ssl_insecure_skip_verify.
marcalff Dec 13, 2022
d5a54fd
Format cleanup
marcalff Dec 13, 2022
e17c891
Merge branch 'open-telemetry:main' into fix_otlp_http_ssl_1402
marcalff Dec 13, 2022
1e96070
Code cleanup.
marcalff Dec 14, 2022
512e793
Merge branch 'open-telemetry:main' into fix_otlp_http_ssl_1402
marcalff Jan 2, 2023
becf5df
Merge branch 'main' into fix_otlp_http_ssl_1402
marcalff Jan 4, 2023
9fc560d
Add TLS support - work in progress
marcalff Jan 4, 2023
09204ba
WIP
marcalff Jan 10, 2023
dfcd670
Merge branch 'main' into fix_otlp_http_ssl_1402
marcalff Jan 16, 2023
e49eef5
SSL TLS
marcalff Jan 16, 2023
4c78897
TLS SSL, continued.
marcalff Jan 17, 2023
46c0662
WIP
marcalff Jan 17, 2023
7294163
Revert TLS 1.2 and 1.3 mix, fixed build breaks.
marcalff Jan 17, 2023
88e88e1
Merge branch 'main' into fix_otlp_http_ssl_1402
marcalff Jan 17, 2023
7c3f50c
Format
marcalff Jan 17, 2023
4f301cb
Merge branch 'open-telemetry:main' into fix_otlp_http_ssl_1402
marcalff Jan 17, 2023
cb9e025
Resolved TLS 1.2 vs TLS 1.3 CIPHER.
marcalff Jan 18, 2023
cd8a172
Merge branch 'main' into fix_otlp_http_ssl_1402
marcalff Jan 24, 2023
71e83c1
Implemented code review comments.
marcalff Jan 24, 2023
e0f91a0
Fixed GCC 12 warnings
marcalff Jan 24, 2023
e0bc8bb
Code cleanup for TLS version.
marcalff Jan 24, 2023
3b0663f
Code cleanup
marcalff Jan 25, 2023
3b31f96
Implemented test client (draft)
marcalff Jan 29, 2023
ab3bba8
format cleanup, maintainer build
marcalff Jan 29, 2023
1e2a610
add grpc in maintainer ci
marcalff Jan 29, 2023
2266202
CI
marcalff Jan 29, 2023
ea15e31
PROTOBUF_VERSION: 3.21.12
marcalff Jan 29, 2023
835fab4
Back to probuf 3.20.3,
marcalff Jan 29, 2023
72edc68
Do not check in cert, generate them (todo)
marcalff Jan 29, 2023
7b7009c
CI protobuf
marcalff Jan 29, 2023
05e4419
Merge branch 'open-telemetry:main' into fix_otlp_http_ssl_1402
marcalff Jan 29, 2023
beb6aa8
Protobuf tar name
marcalff Jan 29, 2023
9cc76a9
Run func test
marcalff Jan 29, 2023
f6fff95
Func test, continued.
marcalff Jan 29, 2023
65b72e3
Fix cfssl
marcalff Jan 29, 2023
25bc4f7
functional test client, continued.
marcalff Jan 30, 2023
e493ed1
Fixed build warnings.
marcalff Feb 1, 2023
8ed1403
Merge branch 'main' into fix_otlp_http_ssl_1402
marcalff Feb 1, 2023
1a26090
Integration of functional tests to CI
marcalff Feb 2, 2023
e228383
Run both sync and async functional tests, added report in CI.
marcalff Feb 2, 2023
4458dac
Merge branch 'main' into fix_otlp_http_ssl_1402
marcalff Feb 3, 2023
4074614
ASYNC tests failed,
marcalff Feb 4, 2023
62ce2e8
Implemented warnings on duration env var, when parsing failed.
marcalff Feb 8, 2023
750155e
Merge branch 'main' into fix_otlp_http_ssl_1402
marcalff Feb 8, 2023
73eca29
Fixed copyright.
marcalff Feb 8, 2023
4074120
Fixed code review comments.
marcalff Feb 9, 2023
3bc586b
Merge branch 'main' into fix_otlp_http_ssl_1402
marcalff Feb 13, 2023
34eff9e
Merge branch 'main' into fix_otlp_http_ssl_1402
marcalff Feb 13, 2023
0f17600
Code cleanup
marcalff Feb 14, 2023
4437433
Merge branch 'main' into fix_otlp_http_ssl_1402
marcalff Feb 17, 2023
cb9b6eb
Merge branch 'main' into fix_otlp_http_ssl_1402
marcalff Mar 3, 2023
af04e5d
WIP
marcalff Mar 3, 2023
2613c7d
Merge branch 'main' into fix_otlp_http_ssl_1402
marcalff Mar 11, 2023
eb9bc19
Cleanup env var names.
marcalff Mar 11, 2023
f6d6c04
Resolved duplication of SSL options.
marcalff Mar 11, 2023
f088bbc
Code cleanup
marcalff Mar 12, 2023
dce246e
CHANGELOG
marcalff Mar 12, 2023
ba6d403
Removed notes.txt, duplicated with ssl doc.
marcalff Mar 12, 2023
659ff69
Build cleanup
marcalff Mar 12, 2023
a5e6cdf
Merge branch 'main' into fix_otlp_http_ssl_1402
marcalff Mar 23, 2023
df6335e
Fixed code review comments, added _PREVIEW to feature flags.
marcalff Mar 24, 2023
663f009
Fixed warnings in maintainer mode.
marcalff Mar 24, 2023
5b529bd
Merge branch 'main' into fix_otlp_http_ssl_1402
marcalff Mar 29, 2023
eb6c362
Implemented code review comments.
marcalff Mar 30, 2023
0593b4c
Fixed http examples
marcalff Mar 30, 2023
340ac8d
Build cleanup for windows / gmock
marcalff Mar 30, 2023
c247437
Build cleanup, windows + gmock macros
marcalff Mar 30, 2023
8a47cf8
Merge branch 'main' into fix_otlp_http_ssl_1402
esigo Apr 1, 2023
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
1 change: 1 addition & 0 deletions .copyright-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
*.patch
*.json
*.nuspec
*.pem

# Packaging
*/CONTROL
Expand Down
102 changes: 94 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
sudo -E ./ci/setup_thrift.sh
./ci/do_ci.sh cmake.test

cmake_gcc_maintainer_test:
name: CMake gcc 12 (maintainer mode)
cmake_gcc_maintainer_sync_test:
name: CMake gcc 12 (maintainer mode, sync)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -46,16 +46,59 @@ jobs:
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: run cmake gcc (maintainer mode)
- name: run cmake gcc (maintainer mode, sync)
env:
CC: /usr/bin/gcc-12
CXX: /usr/bin/g++-12
run: |
sudo -E ./ci/setup_thrift.sh
./ci/do_ci.sh cmake.maintainer.test
./ci/do_ci.sh cmake.maintainer.sync.test
- name: generate test cert
env:
CFSSL_VERSION: 1.6.3
run: |
sudo -E ./tools/setup-cfssl.sh
(cd ./functional/cert; ./generate_cert.sh)
- name: run func test
run: |
(cd ./functional/otlp; ./run_test.sh)

cmake_gcc_maintainer_async_test:
name: CMake gcc 12 (maintainer mode, async)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/gcc-12
CXX: /usr/bin/g++-12
GOOGLETEST_VERSION: 1.12.1
PROTOBUF_VERSION: 21.12
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: run cmake gcc (maintainer mode, async)
env:
CC: /usr/bin/gcc-12
CXX: /usr/bin/g++-12
run: |
sudo -E ./ci/setup_thrift.sh
./ci/do_ci.sh cmake.maintainer.async.test
- name: generate test cert
env:
CFSSL_VERSION: 1.6.3
run: |
sudo -E ./tools/setup-cfssl.sh
(cd ./functional/cert; ./generate_cert.sh)
- name: run func test
run: |
(cd ./functional/otlp; ./run_test.sh)

cmake_clang_maintainer_test:
name: CMake clang 14 (maintainer mode)
cmake_clang_maintainer_sync_test:
name: CMake clang 14 (maintainer mode, sync)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -71,13 +114,56 @@ jobs:
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: run cmake clang (maintainer mode)
- name: run cmake clang (maintainer mode, sync)
env:
CC: /usr/bin/clang-14
CXX: /usr/bin/clang++-14
run: |
sudo -E ./ci/setup_thrift.sh
./ci/do_ci.sh cmake.maintainer.test
./ci/do_ci.sh cmake.maintainer.sync.test
- name: generate test cert
env:
CFSSL_VERSION: 1.6.3
run: |
sudo -E ./tools/setup-cfssl.sh
(cd ./functional/cert; ./generate_cert.sh)
- name: run func test
run: |
(cd ./functional/otlp; ./run_test.sh)

cmake_clang_maintainer_async_test:
name: CMake clang 14 (maintainer mode, async)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: setup
env:
CC: /usr/bin/clang-14
CXX: /usr/bin/clang++-14
GOOGLETEST_VERSION: 1.12.1
PROTOBUF_VERSION: 21.12
run: |
sudo -E ./ci/setup_cmake.sh
sudo -E ./ci/setup_ci_environment.sh
sudo -E ./ci/install_protobuf.sh
- name: run cmake clang (maintainer mode, async)
env:
CC: /usr/bin/clang-14
CXX: /usr/bin/clang++-14
run: |
sudo -E ./ci/setup_thrift.sh
./ci/do_ci.sh cmake.maintainer.async.test
- name: generate test cert
env:
CFSSL_VERSION: 1.6.3
run: |
sudo -E ./tools/setup-cfssl.sh
(cd ./functional/cert; ./generate_cert.sh)
- name: run func test
run: |
(cd ./functional/otlp; ./run_test.sh)

cmake_msvc_maintainer_test:
name: CMake msvc (maintainer mode)
Expand Down
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,24 @@ tags

# Temporary dir used when generating semconv
./buildscripts/semantic-convention/opentelemetry-specification

# Generated cert keys in functional tests
functional/cert/ca.csr
functional/cert/ca.pem
functional/cert/ca-key.pem
functional/cert/client_cert.csr
functional/cert/client_cert.pem
functional/cert/client_cert-key.pem
functional/cert/server_cert.csr
functional/cert/server_cert.pem
functional/cert/server_cert-key.pem
functional/cert/ca_b.csr
functional/cert/ca_b.pem
functional/cert/ca_b-key.pem
functional/cert/client_cert_b.csr
functional/cert/client_cert_b.pem
functional/cert/client_cert_b-key.pem
functional/cert/server_cert_b.csr
functional/cert/server_cert_b.pem
functional/cert/server_cert_b-key.pem
functional/cert/unreadable.pem
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Increment the:
top level.[#2062](https://github.com/open-telemetry/opentelemetry-cpp/pull/2062)
* [EXPORTERS]Add `ForceFlush` for `LogRecordExporter` and `SpanExporter`
[#2000](https://github.com/open-telemetry/opentelemetry-cpp/pull/2000)
* [EXPORTER] Add OTLP HTTP SSL support
[#1793](https://github.com/open-telemetry/opentelemetry-cpp/pull/1793)

Important changes:

Expand Down
20 changes: 20 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,18 @@ option(
"Whether to build http client/server examples. Requires WITH_EXAMPLES and CURL"
OFF)

option(WITH_FUNC_TESTS "Whether to build functional tests" ON)

option(WITH_LOGS_PREVIEW "Whether to build logs preview" OFF)
option(WITH_ASYNC_EXPORT_PREVIEW "Whether to enable async export" OFF)

# EXPERIMENTAL
option(WITH_OTLP_HTTP_SSL_PREVIEW "Whether to enable otlp http ssl export" OFF)

# EXPERIMENTAL
option(WITH_OTLP_HTTP_SSL_TLS_PREVIEW
"Whether to enable otlp http ssl tls min/max/cipher options" OFF)

# Exemplar specs status is experimental, so behind feature flag by default
option(WITH_METRICS_EXEMPLAR_PREVIEW
"Whether to enable exemplar within metrics" OFF)
Expand All @@ -233,6 +243,13 @@ if(WITH_EXAMPLES_HTTP AND NOT WITH_EXAMPLES)
message(FATAL_ERROR "WITH_EXAMPLES_HTTP=ON requires WITH_EXAMPLES=ON")
endif()

if(WITH_OTLP_HTTP_SSL_TLS_PREVIEW AND NOT WITH_OTLP_HTTP_SSL_PREVIEW)
message(
FATAL_ERROR
"WITH_OTLP_HTTP_SSL_TLS_PREVIEW=ON requires WITH_OTLP_HTTP_SSL_PREVIEW=ON"
)
endif()

find_package(Threads)

function(install_windows_deps)
Expand Down Expand Up @@ -584,6 +601,9 @@ if(NOT WITH_API_ONLY)
if(WITH_EXAMPLES)
add_subdirectory(examples)
endif()
if(WITH_FUNC_TESTS)
add_subdirectory(functional)
endif()
endif()

if(OPENTELEMETRY_INSTALL)
Expand Down
10 changes: 10 additions & 0 deletions api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@ if(WITH_ASYNC_EXPORT_PREVIEW)
target_compile_definitions(opentelemetry_api INTERFACE ENABLE_ASYNC_EXPORT)
endif()

# A better place should be in sdk, not api
if(WITH_OTLP_HTTP_SSL_PREVIEW)
target_compile_definitions(opentelemetry_api INTERFACE ENABLE_OTLP_HTTP_SSL)
marcalff marked this conversation as resolved.
Show resolved Hide resolved

if(WITH_OTLP_HTTP_SSL_TLS_PREVIEW)
target_compile_definitions(opentelemetry_api
INTERFACE ENABLE_OTLP_HTTP_SSL_TLS)
marcalff marked this conversation as resolved.
Show resolved Hide resolved
endif()
endif()

if(WITH_METRICS_EXEMPLAR_PREVIEW)
target_compile_definitions(opentelemetry_api
INTERFACE ENABLE_METRICS_EXEMPLAR_PREVIEW)
Expand Down
28 changes: 27 additions & 1 deletion ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,38 @@ if [[ "$1" == "cmake.test" ]]; then
make
make test
exit 0
elif [[ "$1" == "cmake.maintainer.test" ]]; then
elif [[ "$1" == "cmake.maintainer.sync.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake -DCMAKE_BUILD_TYPE=Debug \
-DWITH_OTLP=ON \
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_HTTP_SSL_PREVIEW=ON \
-DWITH_OTLP_HTTP_SSL_TLS_PREVIEW=ON \
-DWITH_PROMETHEUS=ON \
-DWITH_EXAMPLES=ON \
-DWITH_EXAMPLES_HTTP=ON \
-DWITH_ZIPKIN=ON \
-DWITH_JAEGER=OFF \
-DBUILD_W3CTRACECONTEXT_TEST=ON \
-DWITH_ELASTICSEARCH=ON \
-DWITH_LOGS_PREVIEW=ON \
-DWITH_METRICS_EXEMPLAR_PREVIEW=ON \
-DWITH_ASYNC_EXPORT_PREVIEW=OFF \
-DOTELCPP_MAINTAINER_MODE=ON \
-DWITH_NO_DEPRECATED_CODE=ON \
"${SRC_DIR}"
make -k
make test
exit 0
elif [[ "$1" == "cmake.maintainer.async.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake -DCMAKE_BUILD_TYPE=Debug \
-DWITH_OTLP=ON \
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_HTTP_SSL_PREVIEW=ON \
-DWITH_OTLP_HTTP_SSL_TLS_PREVIEW=ON \
-DWITH_PROMETHEUS=ON \
-DWITH_EXAMPLES=ON \
-DWITH_EXAMPLES_HTTP=ON \
Expand Down
Loading