add missing gauge resets
This commit is contained in:
parent
b0c91b2a34
commit
29d6c752ce
2 changed files with 3 additions and 1 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "mtproto_exporter",
|
"name": "mtproto_exporter",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"packageManager": "pnpm@10.6.5",
|
"packageManager": "pnpm@10.6.5",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ function newStaticPeerInfoGauge(tg: TelegramClient) {
|
||||||
help: "Dialog information exposed as labels",
|
help: "Dialog information exposed as labels",
|
||||||
labelNames: ["peerId", "peerType", "displayName"],
|
labelNames: ["peerId", "peerType", "displayName"],
|
||||||
collect: async () => {
|
collect: async () => {
|
||||||
|
gauge.reset();
|
||||||
for await (const d of tg.iterDialogs()) {
|
for await (const d of tg.iterDialogs()) {
|
||||||
gauge.set({
|
gauge.set({
|
||||||
peerId: d.peer.id,
|
peerId: d.peer.id,
|
||||||
|
|
@ -44,6 +45,7 @@ function newUnreadCountGauge(tg: TelegramClient) {
|
||||||
help: "Number of unread messages in dialogs",
|
help: "Number of unread messages in dialogs",
|
||||||
labelNames: ["peerId"],
|
labelNames: ["peerId"],
|
||||||
collect: async () => {
|
collect: async () => {
|
||||||
|
gauge.reset();
|
||||||
for await (const d of tg.iterDialogs()) {
|
for await (const d of tg.iterDialogs()) {
|
||||||
gauge.set({
|
gauge.set({
|
||||||
peerId: d.peer.id,
|
peerId: d.peer.id,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue