Skip to content

Commit 32742ba

Browse files
authored
Merge pull request #137 from open-telemetry/main
[TEST] Functional tests for OTLP/gRPC with mutual TLS (open-telemetry#3227)
2 parents 992b21a + bb68f49 commit 32742ba

File tree

9 files changed

+984
-11
lines changed

9 files changed

+984
-11
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,15 @@ jobs:
452452
run: |
453453
sudo ./ci/setup_grpc.sh
454454
./ci/do_ci.sh cmake.exporter.otprotocol.test
455+
- name: generate test cert
456+
env:
457+
CFSSL_VERSION: 1.6.3
458+
run: |
459+
sudo -E ./tools/setup-cfssl.sh
460+
(cd ./functional/cert; ./generate_cert.sh)
461+
- name: run func test
462+
run: |
463+
(cd ./functional/otlp; ./run_test.sh)
455464
456465
cmake_modern_protobuf_grpc_with_abseil_test:
457466
name: CMake test (with modern protobuf,grpc and abseil)

exporters/otlp/src/otlp_grpc_exporter.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ sdk::common::ExportResult OtlpGrpcExporter::Export(
150150
else
151151
{
152152
#endif
153+
const auto resource_spans_size = request->resource_spans_size();
153154
grpc::Status status =
154155
OtlpGrpcClient::DelegateExport(trace_service_stub_.get(), std::move(context),
155156
std::move(arena), std::move(*request), response);
@@ -160,6 +161,11 @@ sdk::common::ExportResult OtlpGrpcExporter::Export(
160161
<< "\" error_message: \"" << status.error_message() << "\"");
161162
return sdk::common::ExportResult::kFailure;
162163
}
164+
else
165+
{
166+
OTEL_INTERNAL_LOG_DEBUG("[OTLP TRACE GRPC Exporter] Export " << resource_spans_size
167+
<< " trace span(s) success");
168+
}
163169
#ifdef ENABLE_ASYNC_EXPORT
164170
}
165171
#endif

functional/otlp/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33

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

6+
if(WITH_OTLP_GRPC)
7+
add_executable(func_otlp_grpc func_grpc_main.cc)
8+
target_link_libraries(func_otlp_grpc ${CMAKE_THREAD_LIBS_INIT}
9+
opentelemetry_trace opentelemetry_exporter_otlp_grpc)
10+
endif()
11+
612
if(WITH_OTLP_HTTP)
713
add_executable(func_otlp_http func_http_main.cc)
814
target_link_libraries(func_otlp_http ${CMAKE_THREAD_LIBS_INIT}

functional/otlp/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
FROM otel/opentelemetry-collector
55
COPY . .
66
CMD ["--config", "/otel-cpp/otel-config.yaml"]
7+
EXPOSE 4317
78
EXPOSE 4318

0 commit comments

Comments
 (0)