Skip to content

Commit f0d4d6f

Browse files
authored
metrics: add more metrics and improve grafana (#3430)
ref #2751
1 parent 238ac34 commit f0d4d6f

File tree

8 files changed

+3968
-1415
lines changed

8 files changed

+3968
-1415
lines changed

logservice/eventstore/event_store.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ import (
4646
)
4747

4848
var (
49-
CounterKv = metrics.EventStoreReceivedEventCount.WithLabelValues("kv")
50-
CounterResolved = metrics.EventStoreReceivedEventCount.WithLabelValues("resolved")
49+
kvEventCount = metrics.EventStoreReceivedEventCount.WithLabelValues("kv")
50+
resolvedEventCount = metrics.EventStoreReceivedEventCount.WithLabelValues("resolved")
5151
scannedBytesMetrics = metrics.EventStoreScanBytes.WithLabelValues("scanned")
5252
skippedBytesMetrics = metrics.EventStoreScanBytes.WithLabelValues("skipped")
5353
)
@@ -612,7 +612,8 @@ func (e *eventStore) RegisterDispatcher(
612612
subscriber.notifyFunc(ts, subStat.maxEventCommitTs.Load())
613613
}
614614
}
615-
CounterResolved.Inc()
615+
resolvedEventCount.Inc()
616+
metrics.EventStoreNotifyDispatcherCount.Add(float64(len(subscribersData.subscribers)))
616617
metrics.EventStoreNotifyDispatcherDurationHist.Observe(float64(time.Since(start).Seconds()))
617618
}
618619
}
@@ -1147,7 +1148,7 @@ func (e *eventStore) writeEvents(db *pebble.DB, events []eventWithCallback, enco
11471148
}
11481149
}
11491150
}
1150-
CounterKv.Add(float64(kvCount))
1151+
kvEventCount.Add(float64(kvCount))
11511152
metrics.EventStoreWriteBatchEventsCountHist.Observe(float64(kvCount))
11521153
metrics.EventStoreWriteBatchSizeHist.Observe(float64(batch.Len()))
11531154
metrics.EventStoreWriteBytes.Add(float64(batch.Len()))

0 commit comments

Comments
 (0)