Skip to content

Commit

Permalink
out_otlp: show grpc response status and msg
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Bezannier <florian.bezannier@hotmail.fr>
  • Loading branch information
flobz committed Jan 10, 2025
1 parent d198505 commit f69f7d9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions plugins/out_opentelemetry/opentelemetry.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,21 @@ int opentelemetry_post(struct opentelemetry_context *ctx,
}
else {
if (ctx->log_response_payload &&
strncasecmp(response->content_type, "application/grpc", 16)
== 0){
grpc_status = flb_hash_table_get_ptr(response->headers,
"grpc-status", 11);
grpc_message = flb_hash_table_get_ptr(response->headers,
"grpc-message", 12);
flb_plg_info(ctx->ins,
"%s:%i, HTTP status=%i GRPC status=%s \n%s",
ctx->host,
ctx->port,
response->status,
grpc_status,
grpc_message);
}
else if (ctx->log_response_payload &&
response->body != NULL &&
cfl_sds_len(response->body) > 0) {
flb_plg_info(ctx->ins, "%s:%i, HTTP status=%i\n%s",
Expand Down

0 comments on commit f69f7d9

Please sign in to comment.