Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 23 additions & 3 deletions exporters/otlp/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ cc_library(
],
hdrs = [
"include/opentelemetry/exporters/otlp/otlp_environment.h",
"include/opentelemetry/exporters/otlp/otlp_preferred_temporality.h",
],
strip_include_prefix = "include",
tags = ["otlp"],
Expand Down Expand Up @@ -81,8 +82,9 @@ cc_library(
strip_include_prefix = "include",
tags = ["otlp"],
deps = [
":otlp_http_client",
":otlp_recordable",
":otlp_common",
"//sdk/src/common:global_log_handler",
"//sdk/src/configuration:configuration_core",
],
)

Expand Down Expand Up @@ -114,6 +116,7 @@ cc_library(
deps = [
":otlp_common",
"//ext:headers",
"//sdk:headers",
"//sdk/src/common:global_log_handler",
"@com_github_grpc_grpc//:grpc++",
"@com_github_opentelemetry_proto//:common_proto_cc",
Expand Down Expand Up @@ -176,6 +179,7 @@ cc_library(
"src/otlp_grpc_span_builder.cc",
],
hdrs = [
"include/opentelemetry/exporters/otlp/otlp_grpc_builder_utils.h",
"include/opentelemetry/exporters/otlp/otlp_grpc_span_builder.h",
],
defines = ["ENABLE_OTLP_GRPC_SSL_MTLS_PREVIEW"],
Expand All @@ -187,6 +191,8 @@ cc_library(
deps = [
":otlp_builder_utils",
":otlp_grpc_exporter",
"//sdk/src/common:global_log_handler",
"//sdk/src/configuration:configuration_core",
],
)

Expand Down Expand Up @@ -267,6 +273,7 @@ cc_library(
"src/otlp_http_span_builder.cc",
],
hdrs = [
"include/opentelemetry/exporters/otlp/otlp_http_builder_utils.h",
"include/opentelemetry/exporters/otlp/otlp_http_span_builder.h",
],
strip_include_prefix = "include",
Expand All @@ -277,6 +284,7 @@ cc_library(
deps = [
":otlp_builder_utils",
":otlp_http_exporter",
"//sdk/src/configuration:configuration_core",
],
)

Expand Down Expand Up @@ -353,6 +361,7 @@ cc_library(
],
deps = [
":otlp_file_exporter",
"//sdk/src/configuration:configuration_core",
],
)

Expand Down Expand Up @@ -396,6 +405,7 @@ cc_library(
"src/otlp_grpc_push_metric_builder.cc",
],
hdrs = [
"include/opentelemetry/exporters/otlp/otlp_grpc_builder_utils.h",
"include/opentelemetry/exporters/otlp/otlp_grpc_push_metric_builder.h",
],
defines = ["ENABLE_OTLP_GRPC_SSL_MTLS_PREVIEW"],
Expand All @@ -407,6 +417,8 @@ cc_library(
deps = [
":otlp_builder_utils",
":otlp_grpc_metric_exporter",
"//sdk/src/common:global_log_handler",
"//sdk/src/configuration:configuration_core",
],
)

Expand Down Expand Up @@ -446,6 +458,7 @@ cc_library(
"src/otlp_http_push_metric_builder.cc",
],
hdrs = [
"include/opentelemetry/exporters/otlp/otlp_http_builder_utils.h",
"include/opentelemetry/exporters/otlp/otlp_http_push_metric_builder.h",
],
strip_include_prefix = "include",
Expand All @@ -456,6 +469,7 @@ cc_library(
deps = [
":otlp_builder_utils",
":otlp_http_metric_exporter",
"//sdk/src/configuration:configuration_core",
],
)

Expand Down Expand Up @@ -505,6 +519,7 @@ cc_library(
deps = [
":otlp_builder_utils",
":otlp_file_metric_exporter",
"//sdk/src/configuration:configuration_core",
],
)

Expand Down Expand Up @@ -544,6 +559,7 @@ cc_library(
"src/otlp_http_log_record_builder.cc",
],
hdrs = [
"include/opentelemetry/exporters/otlp/otlp_http_builder_utils.h",
"include/opentelemetry/exporters/otlp/otlp_http_log_record_builder.h",
],
strip_include_prefix = "include",
Expand All @@ -554,6 +570,7 @@ cc_library(
deps = [
":otlp_builder_utils",
":otlp_http_log_record_exporter",
"//sdk/src/configuration:configuration_core",
],
)

Expand Down Expand Up @@ -601,8 +618,8 @@ cc_library(
"otlp_file_log",
],
deps = [
":otlp_builder_utils",
":otlp_file_log_record_exporter",
"//sdk/src/configuration:configuration_core",
],
)

Expand Down Expand Up @@ -645,6 +662,7 @@ cc_library(
"src/otlp_grpc_log_record_builder.cc",
],
hdrs = [
"include/opentelemetry/exporters/otlp/otlp_grpc_builder_utils.h",
"include/opentelemetry/exporters/otlp/otlp_grpc_log_record_builder.h",
],
defines = ["ENABLE_OTLP_GRPC_SSL_MTLS_PREVIEW"],
Expand All @@ -656,6 +674,8 @@ cc_library(
deps = [
":otlp_builder_utils",
":otlp_grpc_log_record_exporter",
"//sdk/src/common:global_log_handler",
"//sdk/src/configuration:configuration_core",
],
)

Expand Down
47 changes: 22 additions & 25 deletions exporters/otlp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ target_include_directories(

target_link_libraries(
opentelemetry_exporter_otlp_builder_utils
PUBLIC opentelemetry_otlp_recordable opentelemetry_configuration_core)
PUBLIC opentelemetry_otlp_common opentelemetry_configuration_core)

if(OTELCPP_INSTALL)
opentelemetry_add_pkgconfig(
Expand All @@ -93,8 +93,7 @@ if(OTELCPP_INSTALL)

opentelemetry_add_pkgconfig(
exporter_otlp_builder_utils "OpenTelemetry OTLP - Builder Utils"
"Common utilities for OTLP exporter builders."
"opentelemetry_otlp_recordable")
"Common utilities for OTLP exporter builders." "opentelemetry_otlp_common")
endif()

if(OTELCPP_WITH_OTLP_GRPC)
Expand Down Expand Up @@ -183,7 +182,7 @@ if(OTELCPP_WITH_OTLP_GRPC)

target_link_libraries(
opentelemetry_exporter_otlp_grpc_builder
PUBLIC opentelemetry_exporter_otlp_grpc
PUBLIC opentelemetry_exporter_otlp_grpc opentelemetry_configuration_core
PRIVATE opentelemetry_exporter_otlp_builder_utils)

list(APPEND OPENTELEMETRY_OTLP_GRPC_BUILDER_TARGETS
Expand Down Expand Up @@ -226,7 +225,7 @@ if(OTELCPP_WITH_OTLP_GRPC)

target_link_libraries(
opentelemetry_exporter_otlp_grpc_log_builder
PUBLIC opentelemetry_exporter_otlp_grpc_log
PUBLIC opentelemetry_exporter_otlp_grpc_log opentelemetry_configuration_core
PRIVATE opentelemetry_exporter_otlp_builder_utils)

list(APPEND OPENTELEMETRY_OTLP_GRPC_BUILDER_TARGETS
Expand Down Expand Up @@ -270,6 +269,7 @@ if(OTELCPP_WITH_OTLP_GRPC)
target_link_libraries(
opentelemetry_exporter_otlp_grpc_metric_builder
PUBLIC opentelemetry_exporter_otlp_grpc_metrics
opentelemetry_configuration_core
PRIVATE opentelemetry_exporter_otlp_builder_utils)

list(APPEND OPENTELEMETRY_OTLP_GRPC_BUILDER_TARGETS
Expand All @@ -291,7 +291,7 @@ if(OTELCPP_WITH_OTLP_GRPC)
exporter_otlp_grpc_builder
"OpenTelemetry OTLP - gRPC Span Builder"
"Builder for OTLP gRPC span exporter."
"opentelemetry_exporter_otlp_grpc opentelemetry_exporter_otlp_builder_utils"
"opentelemetry_exporter_otlp_grpc opentelemetry_exporter_otlp_builder_utils opentelemetry_configuration_core"
)

opentelemetry_add_pkgconfig(
Expand All @@ -305,7 +305,7 @@ if(OTELCPP_WITH_OTLP_GRPC)
exporter_otlp_grpc_log_builder
"OpenTelemetry OTLP - gRPC Log Builder"
"Builder for OTLP gRPC log record exporter."
"opentelemetry_exporter_otlp_grpc_log opentelemetry_exporter_otlp_builder_utils"
"opentelemetry_exporter_otlp_grpc_log opentelemetry_exporter_otlp_builder_utils opentelemetry_configuration_core"
)

opentelemetry_add_pkgconfig(
Expand All @@ -319,7 +319,7 @@ if(OTELCPP_WITH_OTLP_GRPC)
exporter_otlp_grpc_metric_builder
"OpenTelemetry OTLP - gRPC Metric Builder"
"Builder for OTLP gRPC metric exporter."
"opentelemetry_exporter_otlp_grpc_metrics opentelemetry_exporter_otlp_builder_utils"
"opentelemetry_exporter_otlp_grpc_metrics opentelemetry_exporter_otlp_builder_utils opentelemetry_configuration_core"
)
endif()

Expand Down Expand Up @@ -392,7 +392,7 @@ if(OTELCPP_WITH_OTLP_HTTP)

target_link_libraries(
opentelemetry_exporter_otlp_http_builder
PUBLIC opentelemetry_exporter_otlp_http
PUBLIC opentelemetry_exporter_otlp_http opentelemetry_configuration_core
PRIVATE opentelemetry_exporter_otlp_builder_utils)

list(APPEND OPENTELEMETRY_OTLP_HTTP_BUILDER_TARGETS
Expand Down Expand Up @@ -435,7 +435,7 @@ if(OTELCPP_WITH_OTLP_HTTP)

target_link_libraries(
opentelemetry_exporter_otlp_http_log_builder
PUBLIC opentelemetry_exporter_otlp_http_log
PUBLIC opentelemetry_exporter_otlp_http_log opentelemetry_configuration_core
PRIVATE opentelemetry_exporter_otlp_builder_utils)

list(APPEND OPENTELEMETRY_OTLP_HTTP_BUILDER_TARGETS
Expand Down Expand Up @@ -479,6 +479,7 @@ if(OTELCPP_WITH_OTLP_HTTP)
target_link_libraries(
opentelemetry_exporter_otlp_http_metric_builder
PUBLIC opentelemetry_exporter_otlp_http_metric
opentelemetry_configuration_core
PRIVATE opentelemetry_exporter_otlp_builder_utils)

list(APPEND OPENTELEMETRY_OTLP_HTTP_BUILDER_TARGETS
Expand All @@ -500,7 +501,7 @@ if(OTELCPP_WITH_OTLP_HTTP)
exporter_otlp_http_builder
"OpenTelemetry OTLP - HTTP Span Builder"
"Builder for OTLP HTTP span exporter."
"opentelemetry_exporter_otlp_http opentelemetry_exporter_otlp_builder_utils"
"opentelemetry_exporter_otlp_http opentelemetry_exporter_otlp_builder_utils opentelemetry_configuration_core"
)

opentelemetry_add_pkgconfig(
Expand All @@ -514,7 +515,7 @@ if(OTELCPP_WITH_OTLP_HTTP)
exporter_otlp_http_log_builder
"OpenTelemetry OTLP - HTTP Log Builder"
"Builder for OTLP HTTP log record exporter."
"opentelemetry_exporter_otlp_http_log opentelemetry_exporter_otlp_builder_utils"
"opentelemetry_exporter_otlp_http_log opentelemetry_exporter_otlp_builder_utils opentelemetry_configuration_core"
)

opentelemetry_add_pkgconfig(
Expand All @@ -528,7 +529,7 @@ if(OTELCPP_WITH_OTLP_HTTP)
exporter_otlp_http_metric_builder
"OpenTelemetry OTLP - HTTP Metric Builder"
"Builder for OTLP HTTP metric exporter."
"opentelemetry_exporter_otlp_http_metric opentelemetry_exporter_otlp_builder_utils"
"opentelemetry_exporter_otlp_http_metric opentelemetry_exporter_otlp_builder_utils opentelemetry_configuration_core"
)
endif()

Expand Down Expand Up @@ -595,8 +596,7 @@ if(OTELCPP_WITH_OTLP_FILE)

target_link_libraries(
opentelemetry_exporter_otlp_file_builder
PUBLIC opentelemetry_exporter_otlp_file
PRIVATE opentelemetry_exporter_otlp_builder_utils)
PUBLIC opentelemetry_exporter_otlp_file opentelemetry_configuration_core)

list(APPEND OPENTELEMETRY_OTLP_FILE_BUILDER_TARGETS
opentelemetry_exporter_otlp_file_builder)
Expand Down Expand Up @@ -639,7 +639,7 @@ if(OTELCPP_WITH_OTLP_FILE)
target_link_libraries(
opentelemetry_exporter_otlp_file_log_builder
PUBLIC opentelemetry_exporter_otlp_file_log
PRIVATE opentelemetry_exporter_otlp_builder_utils)
opentelemetry_configuration_core)

list(APPEND OPENTELEMETRY_OTLP_FILE_BUILDER_TARGETS
opentelemetry_exporter_otlp_file_log_builder)
Expand Down Expand Up @@ -682,6 +682,7 @@ if(OTELCPP_WITH_OTLP_FILE)
target_link_libraries(
opentelemetry_exporter_otlp_file_metric_builder
PUBLIC opentelemetry_exporter_otlp_file_metric
opentelemetry_configuration_core
PRIVATE opentelemetry_exporter_otlp_builder_utils)

list(APPEND OPENTELEMETRY_OTLP_FILE_BUILDER_TARGETS
Expand All @@ -700,11 +701,9 @@ if(OTELCPP_WITH_OTLP_FILE)
)

opentelemetry_add_pkgconfig(
exporter_otlp_file_builder
"OpenTelemetry OTLP - File Span Builder"
exporter_otlp_file_builder "OpenTelemetry OTLP - File Span Builder"
"Builder for OTLP file span exporter."
"opentelemetry_exporter_otlp_file opentelemetry_exporter_otlp_builder_utils"
)
"opentelemetry_exporter_otlp_file opentelemetry_configuration_core")

opentelemetry_add_pkgconfig(
exporter_otlp_file_log
Expand All @@ -714,11 +713,9 @@ if(OTELCPP_WITH_OTLP_FILE)
)

opentelemetry_add_pkgconfig(
exporter_otlp_file_log_builder
"OpenTelemetry OTLP - File Log Builder"
exporter_otlp_file_log_builder "OpenTelemetry OTLP - File Log Builder"
"Builder for OTLP file log record exporter."
"opentelemetry_exporter_otlp_file_log opentelemetry_exporter_otlp_builder_utils"
)
"opentelemetry_exporter_otlp_file_log opentelemetry_configuration_core")

opentelemetry_add_pkgconfig(
exporter_otlp_file_metric
Expand All @@ -731,7 +728,7 @@ if(OTELCPP_WITH_OTLP_FILE)
exporter_otlp_file_metric_builder
"OpenTelemetry OTLP - File Metric Builder"
"Builder for OTLP file metric exporter."
"opentelemetry_exporter_otlp_file_metric opentelemetry_exporter_otlp_builder_utils"
"opentelemetry_exporter_otlp_file_metric opentelemetry_exporter_otlp_builder_utils opentelemetry_configuration_core"
)
endif()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@
#include <string>

#include "opentelemetry/exporters/otlp/otlp_environment.h" // For OtlpHeaders
#include "opentelemetry/exporters/otlp/otlp_http.h"
#include "opentelemetry/exporters/otlp/otlp_preferred_temporality.h"
#include "opentelemetry/sdk/configuration/grpc_tls_configuration.h"
#include "opentelemetry/sdk/configuration/headers_configuration.h"
#include "opentelemetry/sdk/configuration/otlp_http_encoding.h"
#include "opentelemetry/sdk/configuration/temporality_preference.h"
#include "opentelemetry/version.h"

Expand All @@ -23,18 +20,12 @@ namespace otlp
class OtlpBuilderUtils
{
public:
static HttpRequestContentType ConvertOtlpHttpEncoding(
opentelemetry::sdk::configuration::OtlpHttpEncoding model);

static OtlpHeaders ConvertHeadersConfigurationModel(
const opentelemetry::sdk::configuration::HeadersConfiguration *model,
const std::string &headers_list);

static PreferredAggregationTemporality ConvertTemporalityPreference(
opentelemetry::sdk::configuration::TemporalityPreference model);

static bool GrpcUseSsl(const std::string &endpoint,
const opentelemetry::sdk::configuration::GrpcTlsConfiguration *tls);
};

} // namespace otlp
Expand Down
Loading
Loading