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] Change OTLP HTTP content_type default to binary #2480

Closed
wants to merge 5 commits into from
Closed
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Breaking changes:
* CMake options `WITH_OTLP_HTTP_SSL_PREVIEW`
and `WITH_OTLP_HTTP_SSL_TLS_PREVIEW` are removed.
Building opentelemetry-cpp without SSL support is no longer possible.
* [#2480] Change default OTLP Http Exporter content type from kJson to kBInary
See The default is http/protobuf, which means binary, [HERE](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#specify-protocol

## [1.13.0] 2023-12-06

Expand Down
2 changes: 1 addition & 1 deletion exporters/otlp/src/otlp_http_exporter_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace otlp
OtlpHttpExporterOptions::OtlpHttpExporterOptions()
{
url = GetOtlpDefaultHttpTracesEndpoint();
content_type = HttpRequestContentType::kJson;
content_type = HttpRequestContentType::kBinary;
json_bytes_mapping = JsonBytesMappingKind::kHexId;
use_json_name = false;
console_debug = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace otlp
OtlpHttpLogRecordExporterOptions::OtlpHttpLogRecordExporterOptions()
{
url = GetOtlpDefaultHttpLogsEndpoint();
content_type = HttpRequestContentType::kJson;
content_type = HttpRequestContentType::kBinary;
json_bytes_mapping = JsonBytesMappingKind::kHexId;
use_json_name = false;
console_debug = false;
Expand Down
2 changes: 1 addition & 1 deletion exporters/otlp/src/otlp_http_metric_exporter_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace otlp
OtlpHttpMetricExporterOptions::OtlpHttpMetricExporterOptions()
{
url = GetOtlpDefaultMetricsEndpoint();
content_type = HttpRequestContentType::kJson;
content_type = HttpRequestContentType::kBinary;
json_bytes_mapping = JsonBytesMappingKind::kHexId;
use_json_name = false;
console_debug = false;
Expand Down
2 changes: 1 addition & 1 deletion exporters/otlp/test/otlp_http_exporter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class OtlpHttpExporterTestPeer : public ::testing::Test
void ExportJsonIntegrationTestAsync()
{
auto mock_otlp_client =
OtlpHttpExporterTestPeer::GetMockOtlpHttpClient(HttpRequestContentType::kJson, true);
OtlpHttpExporterTestPeer::GetMockOtlpHttpClient(HttpRequestContentType::kBinary, true);
auto mock_otlp_http_client = mock_otlp_client.first;
auto client = mock_otlp_client.second;
auto exporter = GetExporter(std::unique_ptr<OtlpHttpClient>{mock_otlp_http_client});
Expand Down
4 changes: 2 additions & 2 deletions exporters/otlp/test/otlp_http_log_record_exporter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class OtlpHttpLogRecordExporterTestPeer : public ::testing::Test
void ExportJsonIntegrationTest()
{
auto mock_otlp_client =
OtlpHttpLogRecordExporterTestPeer::GetMockOtlpHttpClient(HttpRequestContentType::kJson);
OtlpHttpLogRecordExporterTestPeer::GetMockOtlpHttpClient(HttpRequestContentType::kBinary);
auto mock_otlp_http_client = mock_otlp_client.first;
auto client = mock_otlp_client.second;
auto exporter = GetExporter(std::unique_ptr<OtlpHttpClient>{mock_otlp_http_client});
Expand Down Expand Up @@ -221,7 +221,7 @@ class OtlpHttpLogRecordExporterTestPeer : public ::testing::Test
void ExportJsonIntegrationTestAsync()
{
auto mock_otlp_client = OtlpHttpLogRecordExporterTestPeer::GetMockOtlpHttpClient(
HttpRequestContentType::kJson, true);
HttpRequestContentType::kBinary, true);
auto mock_otlp_http_client = mock_otlp_client.first;
auto client = mock_otlp_client.second;
auto exporter = GetExporter(std::unique_ptr<OtlpHttpClient>{mock_otlp_http_client});
Expand Down
6 changes: 3 additions & 3 deletions exporters/otlp/test/otlp_http_metric_exporter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class OtlpHttpMetricExporterTestPeer : public ::testing::Test
)
{
auto mock_otlp_client =
OtlpHttpMetricExporterTestPeer::GetMockOtlpHttpClient(HttpRequestContentType::kJson
OtlpHttpMetricExporterTestPeer::GetMockOtlpHttpClient(HttpRequestContentType::kBinary
#ifdef ENABLE_ASYNC_EXPORT
,
async_mode
Expand Down Expand Up @@ -293,7 +293,7 @@ class OtlpHttpMetricExporterTestPeer : public ::testing::Test
)
{
auto mock_otlp_client =
OtlpHttpMetricExporterTestPeer::GetMockOtlpHttpClient(HttpRequestContentType::kJson
OtlpHttpMetricExporterTestPeer::GetMockOtlpHttpClient(HttpRequestContentType::kBinary
#ifdef ENABLE_ASYNC_EXPORT
,
async_mode
Expand Down Expand Up @@ -483,7 +483,7 @@ class OtlpHttpMetricExporterTestPeer : public ::testing::Test
)
{
auto mock_otlp_client =
OtlpHttpMetricExporterTestPeer::GetMockOtlpHttpClient(HttpRequestContentType::kJson
OtlpHttpMetricExporterTestPeer::GetMockOtlpHttpClient(HttpRequestContentType::kBinary
#ifdef ENABLE_ASYNC_EXPORT
,
async_mode
Expand Down
Loading