Skip to content

Commit 5823ea6

Browse files
authored
[CONFIGURATION/BUILD] Break up OTLP builder utils into gRPC and HTTP utils (#4533)
1 parent 93aa377 commit 5823ea6

28 files changed

Lines changed: 297 additions & 114 deletions

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ Increment the:
5353
longer injects a default `service.name`, since neither is part of the
5454
configuration model. Use the `service` detector or set the attributes in
5555
the configuration file instead.
56+
57+
* [CONFIGURATION/BUILD] Break up OTLP builder utils into gRPC and HTTP utils
58+
[#4533](https://github.com/open-telemetry/opentelemetry-cpp/pull/4533)
59+
5660
* [CONFIGURATION] Add a resource detector extension example
5761
[#4419](https://github.com/open-telemetry/opentelemetry-cpp/issues/4419)
5862

‎ci/do_ci.sh‎

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -814,13 +814,32 @@ elif [[ "$1" == "bazel.legacy.test" ]]; then
814814
bazel $BAZEL_STARTUP_OPTIONS test $BAZEL_TEST_OPTIONS_ASYNC -- //... -//exporters/otlp/... -//exporters/prometheus/...
815815
exit 0
816816
elif [[ "$1" == "bazel.noexcept" ]]; then
817-
# there are some exceptions and error handling code from the Prometheus Client
818-
# as well as Opentracing shim (due to some third party code in its Opentracing dependency)
819-
# that make this test always fail. Ignore these packages in the noexcept test here.
820-
# Set the api:with_cxx_stdlib=none because C++17 std::variant::get<> throws
817+
# The following directories and targets use exceptions and are excluded.
818+
# TODO: create an exception handling policy that defines which components allow excecptions.
819+
820+
NOEXCEPT_EXCLUDES=(
821+
-//exporters/prometheus/...
822+
-//examples/prometheus/...
823+
-//opentracing-shim/...
824+
-//examples/configuration/...
825+
-//sdk/src/configuration/...
826+
-//sdk/test/configuration/...
827+
-//resource_detectors/...
828+
-//exporters/otlp:otlp_builder_utils
829+
-//exporters/otlp:otlp_grpc_span_exporter_builder
830+
-//exporters/otlp:otlp_grpc_log_record_exporter_builder
831+
-//exporters/otlp:otlp_grpc_metric_exporter_builder
832+
-//exporters/otlp:otlp_http_span_exporter_builder
833+
-//exporters/otlp:otlp_http_log_record_exporter_builder
834+
-//exporters/otlp:otlp_http_metric_exporter_builder
835+
-//exporters/otlp:otlp_file_span_exporter_builder
836+
-//exporters/otlp:otlp_file_log_record_exporter_builder
837+
-//exporters/otlp:otlp_file_metric_exporter_builder
838+
)
821839

822-
bazel $BAZEL_STARTUP_OPTIONS build --copt=-fno-exceptions --//api:with_cxx_stdlib=none $BAZEL_OPTIONS_ASYNC -- //... -//exporters/prometheus/... -//examples/prometheus/... -//opentracing-shim/... -//examples/configuration/... -//sdk/src/configuration/... -//sdk/test/configuration/... -//resource_detectors/...
823-
bazel $BAZEL_STARTUP_OPTIONS test --copt=-fno-exceptions --//api:with_cxx_stdlib=none $BAZEL_TEST_OPTIONS_ASYNC -- //... -//exporters/prometheus/... -//examples/prometheus/... -//opentracing-shim/... -//examples/configuration/... -//sdk/src/configuration/... -//sdk/test/configuration/... -//resource_detectors/...
840+
# Set the api:with_cxx_stdlib=none because C++17 std::variant::get<> throws
841+
bazel $BAZEL_STARTUP_OPTIONS build --copt=-fno-exceptions --//api:with_cxx_stdlib=none $BAZEL_OPTIONS_ASYNC -- //... "${NOEXCEPT_EXCLUDES[@]}"
842+
bazel $BAZEL_STARTUP_OPTIONS test --copt=-fno-exceptions --//api:with_cxx_stdlib=none $BAZEL_TEST_OPTIONS_ASYNC -- //... "${NOEXCEPT_EXCLUDES[@]}"
824843
exit 0
825844
elif [[ "$1" == "bazel.nortti" ]]; then
826845
# there are some exceptions and error handling code from the Prometheus Client

‎examples/configuration/custom_log_record_exporter.cc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "opentelemetry/sdk/common/exporter_utils.h"
77
#include "opentelemetry/sdk/common/global_log_handler.h"
88
#include "opentelemetry/sdk/logs/read_write_log_record.h"
9+
#include "opentelemetry/sdk/logs/recordable.h"
910

1011
#include "custom_log_record_exporter.h"
1112

‎examples/configuration/custom_log_record_exporter_builder.cc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "opentelemetry/sdk/configuration/document_node.h"
99
#include "opentelemetry/sdk/configuration/extension_log_record_exporter_configuration.h"
1010
#include "opentelemetry/sdk/configuration/registry.h"
11+
#include "opentelemetry/sdk/logs/exporter.h"
1112

1213
#include "custom_log_record_exporter.h"
1314
#include "custom_log_record_exporter_builder.h"

‎examples/configuration/custom_log_record_processor_builder.cc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "opentelemetry/sdk/configuration/document_node.h"
99
#include "opentelemetry/sdk/configuration/extension_log_record_processor_configuration.h"
1010
#include "opentelemetry/sdk/configuration/registry.h"
11+
#include "opentelemetry/sdk/logs/processor.h"
1112

1213
#include "custom_log_record_processor.h"
1314
#include "custom_log_record_processor_builder.h"

‎examples/configuration/custom_pull_metric_exporter_builder.cc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "opentelemetry/sdk/configuration/document_node.h"
99
#include "opentelemetry/sdk/configuration/extension_pull_metric_exporter_configuration.h"
1010
#include "opentelemetry/sdk/configuration/registry.h"
11+
#include "opentelemetry/sdk/metrics/metric_reader.h"
1112

1213
#include "custom_pull_metric_exporter.h"
1314
#include "custom_pull_metric_exporter_builder.h"

‎examples/configuration/custom_push_metric_exporter_builder.cc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "opentelemetry/sdk/configuration/document_node.h"
99
#include "opentelemetry/sdk/configuration/extension_push_metric_exporter_configuration.h"
1010
#include "opentelemetry/sdk/configuration/registry.h"
11+
#include "opentelemetry/sdk/metrics/push_metric_exporter.h"
1112

1213
#include "custom_push_metric_exporter.h"
1314
#include "custom_push_metric_exporter_builder.h"

‎examples/configuration/custom_resource_detector_builder.cc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "opentelemetry/sdk/configuration/document_node.h"
99
#include "opentelemetry/sdk/configuration/extension_resource_detector_configuration.h"
1010
#include "opentelemetry/sdk/configuration/registry.h"
11+
#include "opentelemetry/sdk/resource/resource_detector.h"
1112

1213
#include "custom_resource_detector.h"
1314
#include "custom_resource_detector_builder.h"

‎examples/configuration/custom_sampler_builder.cc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "opentelemetry/sdk/configuration/document_node.h"
99
#include "opentelemetry/sdk/configuration/extension_sampler_configuration.h"
1010
#include "opentelemetry/sdk/configuration/registry.h"
11+
#include "opentelemetry/sdk/trace/sampler.h"
1112

1213
#include "custom_sampler.h"
1314
#include "custom_sampler_builder.h"

‎examples/configuration/custom_span_exporter.cc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include "opentelemetry/sdk/common/exporter_utils.h"
77
#include "opentelemetry/sdk/common/global_log_handler.h"
8+
#include "opentelemetry/sdk/trace/recordable.h"
89
#include "opentelemetry/sdk/trace/span_data.h"
910

1011
#include "custom_span_exporter.h"

0 commit comments

Comments
 (0)