Skip to content

Commit

Permalink
[TEST] Functional tests for OTLP/gRPC with mutual TLS (open-telemetry…
Browse files Browse the repository at this point in the history
  • Loading branch information
chusitoo authored Jan 6, 2025
1 parent 4998eb1 commit bb68f49
Show file tree
Hide file tree
Showing 9 changed files with 984 additions and 11 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,15 @@ jobs:
run: |
sudo ./ci/setup_grpc.sh
./ci/do_ci.sh cmake.exporter.otprotocol.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_modern_protobuf_grpc_with_abseil_test:
name: CMake test (with modern protobuf,grpc and abseil)
Expand Down
6 changes: 6 additions & 0 deletions exporters/otlp/src/otlp_grpc_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ sdk::common::ExportResult OtlpGrpcExporter::Export(
else
{
#endif
const auto resource_spans_size = request->resource_spans_size();
grpc::Status status =
OtlpGrpcClient::DelegateExport(trace_service_stub_.get(), std::move(context),
std::move(arena), std::move(*request), response);
Expand All @@ -160,6 +161,11 @@ sdk::common::ExportResult OtlpGrpcExporter::Export(
<< "\" error_message: \"" << status.error_message() << "\"");
return sdk::common::ExportResult::kFailure;
}
else
{
OTEL_INTERNAL_LOG_DEBUG("[OTLP TRACE GRPC Exporter] Export " << resource_spans_size
<< " trace span(s) success");
}
#ifdef ENABLE_ASYNC_EXPORT
}
#endif
Expand Down
6 changes: 6 additions & 0 deletions functional/otlp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

include_directories(${CMAKE_SOURCE_DIR}/exporters/otlp/include)

if(WITH_OTLP_GRPC)
add_executable(func_otlp_grpc func_grpc_main.cc)
target_link_libraries(func_otlp_grpc ${CMAKE_THREAD_LIBS_INIT}
opentelemetry_trace opentelemetry_exporter_otlp_grpc)
endif()

if(WITH_OTLP_HTTP)
add_executable(func_otlp_http func_http_main.cc)
target_link_libraries(func_otlp_http ${CMAKE_THREAD_LIBS_INIT}
Expand Down
1 change: 1 addition & 0 deletions functional/otlp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
FROM otel/opentelemetry-collector
COPY . .
CMD ["--config", "/otel-cpp/otel-config.yaml"]
EXPOSE 4317
EXPOSE 4318
Loading

1 comment on commit bb68f49

@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: bb68f49 Previous: 4998eb1 Ratio
BM_BaselineBuffer/1 15394058.227539062 ns/iter 6773012.638092041 ns/iter 2.27

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

Please sign in to comment.