Skip to content

Commit

Permalink
Merge pull request #47 from open-telemetry/main
Browse files Browse the repository at this point in the history
merged from upstream
  • Loading branch information
malkia authored Jun 21, 2024
2 parents 2f48727 + 4e86a86 commit db0bd48
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ if(DEFINED WITH_OTLP)
)
endif()

option(WITH_OTLP_GRPC_SSL_MTLS_PREVIEW
"Whether to enable mTLS support fro gRPC" OFF)

option(WITH_OTLP_GRPC "Whether to include the OTLP gRPC exporter in the SDK"
OFF)

Expand Down
2 changes: 1 addition & 1 deletion exporters/elasticsearch/src/es_log_record_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ResponseHandler : public http_client::EventHandler
// Store the body of the request
body_ = std::string(response.GetBody().begin(), response.GetBody().end());

if (response.GetStatusCode() != 200 && response.GetStatusCode() != 202)
if (!(response.GetStatusCode() >= 200 && response.GetStatusCode() <= 299))
{
log_message = BuildResponseLogMessage(response, body_);

Expand Down
2 changes: 1 addition & 1 deletion exporters/otlp/src/otlp_http_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class ResponseHandler : public http_client::EventHandler
// Store the body of the request
body_ = std::string(response.GetBody().begin(), response.GetBody().end());

if (response.GetStatusCode() != 200 && response.GetStatusCode() != 202)
if (!(response.GetStatusCode() >= 200 && response.GetStatusCode() <= 299))
{
log_message = BuildResponseLogMessage(response, body_);

Expand Down
2 changes: 1 addition & 1 deletion exporters/zipkin/src/zipkin_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ sdk::common::ExportResult ZipkinExporter::Export(
http_client::Body body_v(body_s.begin(), body_s.end());
auto result = http_client_->PostNoSsl(url_parser_.url_, body_v, options_.headers);
if (result &&
(result.GetResponse().GetStatusCode() == 200 || result.GetResponse().GetStatusCode() == 202))
(result.GetResponse().GetStatusCode() >= 200 && result.GetResponse().GetStatusCode() <= 299))
{
return sdk::common::ExportResult::kSuccess;
}
Expand Down

0 comments on commit db0bd48

Please sign in to comment.