From 244ae6cafe231b0ebe81274158d6f4789c276f2c Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Thu, 2 Jul 2020 20:23:16 +0200 Subject: [PATCH] write_stackdriver plugin: Log sd_output_register_metric errors. --- src/write_stackdriver.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/write_stackdriver.c b/src/write_stackdriver.c index f540f92f7..c77bcb709 100644 --- a/src/write_stackdriver.c +++ b/src/write_stackdriver.c @@ -417,7 +417,14 @@ static int wg_metric_descriptors_create(wg_callback_t *cb, metric_t const *m) { } STRBUF_DESTROY(buf); - return sd_output_register_metric(cb->formatter, m); + + status = sd_output_register_metric(cb->formatter, m); + if (status != 0) { + ERROR("write_stackdriver plugin: sd_output_register_metric failed: %s", STRERROR(status)); + return status; + } + + return 0; } /* }}} int wg_metric_descriptors_create */ static int wg_output_add(wg_callback_t *cb, metric_t const *m) { -- 2.47.2