diff --git a/plugins/out_stackdriver/stackdriver.c b/plugins/out_stackdriver/stackdriver.c index b394b1eb101..23d31ad4f0a 100644 --- a/plugins/out_stackdriver/stackdriver.c +++ b/plugins/out_stackdriver/stackdriver.c @@ -2500,13 +2500,12 @@ static void add_record_metrics(struct flb_stackdriver* ctx, { char grpc_code_label[32]; char response_code_label[32]; - char* name; + char* name = (char*) flb_output_name(ctx->ins); /* convert status to string format */ snprintf(response_code_label, sizeof(response_code_label) - 1, "%i", response_code); /* convert grpc_code to string format */ snprintf(grpc_code_label, sizeof(grpc_code_label) - 1, "%i", grpc_code); - name = (char*) flb_output_name(ctx->ins); /* processed records total */ cmt_counter_add(ctx->cmt_proc_records_total, ts, val, 3, diff --git a/plugins/out_stackdriver/stackdriver.h b/plugins/out_stackdriver/stackdriver.h index d7a5394e59f..41ec385b507 100644 --- a/plugins/out_stackdriver/stackdriver.h +++ b/plugins/out_stackdriver/stackdriver.h @@ -86,7 +86,8 @@ #define FLB_STACKDRIVER_FAILED_REQUESTS 1001 /* failed requests */ #endif -#define GRPC_STATUS_CODES_SIZE 32 +// https://grpc.github.io/grpc/core/md_doc_statuscodes.html +#define GRPC_STATUS_CODES_SIZE 17 #define PARTIAL_SUCCESS_GRPC_TYPE "type.googleapis.com/google.logging.v2.WriteLogEntriesPartialErrors" #define PARTIAL_SUCCESS_GRPC_TYPE_SIZE 66