diff --git a/plugins/out_stackdriver/stackdriver.c b/plugins/out_stackdriver/stackdriver.c index b09364f2764..4a858af0b72 100644 --- a/plugins/out_stackdriver/stackdriver.c +++ b/plugins/out_stackdriver/stackdriver.c @@ -2331,14 +2331,15 @@ static void update_http_metrics(struct flb_stackdriver *ctx, /* convert status to string format */ snprintf(tmp, sizeof(tmp) - 1, "%i", http_status); + char *name = (char *) flb_output_name(ctx->ins); /* processed records total */ cmt_counter_add(ctx->cmt_proc_records_total, ts, event_chunk->total_events, - 1, (char *[]) {tmp}); + 2, (char *[]) {tmp, name}); /* HTTP status */ if (http_status != STACKDRIVER_NET_ERROR) { - cmt_counter_inc(ctx->cmt_requests_total, ts, 1, (char *[]) {tmp}); + cmt_counter_inc(ctx->cmt_requests_total, ts, 2, (char *[]) {tmp, name}); } } #endif diff --git a/plugins/out_stackdriver/stackdriver_conf.c b/plugins/out_stackdriver/stackdriver_conf.c index e5640fe46c0..e08520658a1 100644 --- a/plugins/out_stackdriver/stackdriver_conf.c +++ b/plugins/out_stackdriver/stackdriver_conf.c @@ -537,21 +537,21 @@ struct flb_stackdriver *flb_stackdriver_conf_create(struct flb_output_instance * "stackdriver", "requests_total", "Total number of requests.", - 1, (char *[]) {"status"}); + 2, (char *[]) {"status", "name"}); ctx->cmt_proc_records_total = cmt_counter_create(ins->cmt, "fluentbit", "stackdriver", "proc_records_total", "Total number of processed records.", - 1, (char *[]) {"status"}); + 2, (char *[]) {"status", "name"}); ctx->cmt_retried_records_total = cmt_counter_create(ins->cmt, "fluentbit", "stackdriver", "retried_records_total", "Total number of retried records.", - 1, (char *[]) {"status"}); + 2, (char *[]) {"status", "name"}); /* OLD api */ flb_metrics_add(FLB_STACKDRIVER_SUCCESSFUL_REQUESTS,