From 5b91cd80da34100747df7a05944632f3cd332397 Mon Sep 17 00:00:00 2001 From: mohit Date: Tue, 12 Sep 2017 04:33:05 +0000 Subject: [PATCH 1/2] DefaultCounters to log 0 for counter stats this makes sure that we can get metrics when things are not flowing through one of the consumers --- batchconsumer/stats/stats.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/batchconsumer/stats/stats.go b/batchconsumer/stats/stats.go index 0eaccf2..947dbe4 100644 --- a/batchconsumer/stats/stats.go +++ b/batchconsumer/stats/stats.go @@ -8,6 +8,19 @@ import ( var log = logger.New("amazon-kinesis-client-go") +// DefaultCounters are core counters tracked by the batchconsumer +// These are stats we want to report on every tick, even if the values are zero +var DefaultCounters = []string{ + "batches-sent", + "checkpoints-sent", + "msg-batched", + "batch-log-failures", + "unknown-error", + "processed-messages", + "no-tags", + "black-tag", +} + type datum struct { name string value int @@ -32,6 +45,9 @@ func init() { } case <-tick: tmp := logger.M{} + for _, k := range DefaultCounters { + tmp[k] = 0 + } for k, v := range data { tmp[k] = v } From 22495acfe48a516ce3df60b4b5b52530797f1cf9 Mon Sep 17 00:00:00 2001 From: mohit Date: Wed, 13 Sep 2017 19:22:58 +0000 Subject: [PATCH 2/2] derpfix: s/black/blank --- batchconsumer/stats/stats.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/batchconsumer/stats/stats.go b/batchconsumer/stats/stats.go index 947dbe4..acc3800 100644 --- a/batchconsumer/stats/stats.go +++ b/batchconsumer/stats/stats.go @@ -18,7 +18,7 @@ var DefaultCounters = []string{ "unknown-error", "processed-messages", "no-tags", - "black-tag", + "blank-tag", } type datum struct {