We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Using the OTLP HTTP exporter, and printing debug logs generated by otlp_http_client.cc leads to the following data:
2022-10-20T22:00:14.654921Z 0 [...] [OTEL DEBUG] /.../opentelemetry-cpp/opentelemetry-cpp-1.6.1/exporters/otlp/src/otlp_http_client.cc:126 [OTLP HTTP Client] Export success, Status:200Header: Content-Length : 0^M, Content-Type : application/x-protobuf^M, Date : Thu, 20 Oct 2022 22:00:14 GMT^M,Body:
Note how "Status:200Header:" is printed, without spaces or comma to separate status from header.
"Status:200Header:"
Note how fields are printed sometime as "field:value", sometime as "field : value" Because of this, logs are harder to parse that necessary.
"field:value"
"field : value"
If using spaces before and after ":", and a "," plus space to separate fields, then please use this consistently.
For example, print "Status : 200, Header :" instead.
"Status : 200, Header :"
The code printing this log is exporter::otlp::ResponseHandler::BuildResponseLogMessage
exporter::otlp::ResponseHandler::BuildResponseLogMessage
std::string BuildResponseLogMessage(http_client::Response &response, const std::string &body) noexcept { std::stringstream ss; ss << "Status:" << response.GetStatusCode() << "Header:"; response.ForEachHeader([&ss](opentelemetry::nostd::string_view header_name, opentelemetry::nostd::string_view header_value) { ss << "\t" << header_name.data() << " : " << header_value.data() << ","; return true; }); ss << "Body:" << body; return ss.str(); }
Also, as seen when reading the code in exporter::otlp::ResponseHandler::OnResponse,
exporter::otlp::ResponseHandler::OnResponse
if (response.GetStatusCode() != 200 && response.GetStatusCode() != 202) { log_message = BuildResponseLogMessage(response, body_); OTEL_INTERNAL_LOG_ERROR("OTLP HTTP Client] Export failed, " << log_message); result = sdk::common::ExportResult::kFailure; } if (console_debug_) { if (log_message.empty()) { log_message = BuildResponseLogMessage(response, body_); } OTEL_INTERNAL_LOG_DEBUG("[OTLP HTTP Client] Export success, " << log_message); } }
The OTEL_INTERNAL_LOG_DEBUG() log statement prints "Export success", including on failures.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Using the OTLP HTTP exporter, and printing debug logs generated by otlp_http_client.cc leads to the following data:
Note how
"Status:200Header:"
is printed, without spaces or comma to separate status from header.Note how fields are printed sometime as
"field:value"
, sometime as"field : value"
Because of this, logs are harder to parse that necessary.
If using spaces before and after ":", and a "," plus space to separate fields, then please use this consistently.
For example, print
"Status : 200, Header :"
instead.The code printing this log is
exporter::otlp::ResponseHandler::BuildResponseLogMessage
Also, as seen when reading the code in
exporter::otlp::ResponseHandler::OnResponse
,The OTEL_INTERNAL_LOG_DEBUG() log statement prints "Export success", including on failures.
The text was updated successfully, but these errors were encountered: