Skip to content

Commit 2381031

Browse files
committed
out_opentelemetry: show grpc response status and msg
Signed-off-by: Florian Bezannier <[email protected]>
1 parent c638a19 commit 2381031

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

plugins/out_opentelemetry/opentelemetry.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,21 @@ int opentelemetry_post(struct opentelemetry_context *ctx,
437437
}
438438
else {
439439
if (ctx->log_response_payload &&
440+
strncasecmp(response->content_type, "application/grpc", 16)
441+
== 0){
442+
grpc_status = flb_hash_table_get_ptr(response->headers,
443+
"grpc-status", 11);
444+
grpc_message = flb_hash_table_get_ptr(response->headers,
445+
"grpc-message", 12);
446+
flb_plg_info(ctx->ins,
447+
"%s:%i, HTTP status=%i GRPC status=%s \n%s",
448+
ctx->host,
449+
ctx->port,
450+
response->status,
451+
grpc_status,
452+
grpc_message);
453+
}
454+
else if (ctx->log_response_payload &&
440455
response->body != NULL &&
441456
cfl_sds_len(response->body) > 0) {
442457
flb_plg_info(ctx->ins, "%s:%i, HTTP status=%i\n%s",

0 commit comments

Comments
 (0)