From 2e8c23e0f6fb4ef0ce61759394230e6291ba8cb2 Mon Sep 17 00:00:00 2001
From: Andrey Afoninsky <vkfont@gmail.com>
Date: Fri, 7 Jan 2022 15:15:34 +0100
Subject: [PATCH] chore: add vmalert_remotewrite_total metric (#2040)

Co-authored-by: Andrey Afoninsky <andrey.afoninsky@booking.com>
---
 app/vmalert/group.go | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/vmalert/group.go b/app/vmalert/group.go
index 45a10f0758..dc49798953 100644
--- a/app/vmalert/group.go
+++ b/app/vmalert/group.go
@@ -356,6 +356,7 @@ var (
 	execErrors = metrics.NewCounter(`vmalert_execution_errors_total`)
 
 	remoteWriteErrors = metrics.NewCounter(`vmalert_remotewrite_errors_total`)
+	remoteWriteTotal  = metrics.NewCounter(`vmalert_remotewrite_total`)
 )
 
 func (e *executor) exec(ctx context.Context, rule Rule, resolveDuration time.Duration) error {
@@ -369,6 +370,7 @@ func (e *executor) exec(ctx context.Context, rule Rule, resolveDuration time.Dur
 
 	if len(tss) > 0 && e.rw != nil {
 		for _, ts := range tss {
+			remoteWriteTotal.Inc()
 			if err := e.rw.Push(ts); err != nil {
 				remoteWriteErrors.Inc()
 				return fmt.Errorf("rule %q: remote write failure: %w", rule, err)