<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">
<div class="moz-cite-prefix">Hello Marat,</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">(my previous email did not pass
moderation filter)</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">
<div class="moz-cite-prefix">modparam only declares a counter
because it only defines label names.</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">When a counter is added or reset
then label values are set so the counter is actually created.</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">If you want a counter to be reset
once, you could use a trick. May be setting a shared variable,
<br>
</div>
<div class="moz-cite-prefix">change that variable first time
used and execute prom_counter_reset inside an if to check <br>
</div>
<div class="moz-cite-prefix">the value of that variable.</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Regards,</div>
<div class="moz-cite-prefix">Vicente.</div>
<div class="moz-cite-prefix"><br>
</div>
</div>
<div class="moz-cite-prefix"><br>
</div>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">On 7/15/20 11:06 AM, Marat Gareev
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAGBFc1VCzRmPC+=FCcjYLbsi9VJwZqJrLwRestFxe4_QqPmBPQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Hello.
<div><br>
</div>
<div>Are there any ways to reset the Prometheus counter once?<br>
</div>
<div>I can do something like this, but counter will be reset on
each request</div>
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">loadmodule
"xhttp_prom.so"<br>
modparam("xhttp_prom", "prom_counter", "name=mycounter;")<br>
route {<br>
prom_counter_reset("mycounter");<br>
}</blockquote>
<div> <br>
</div>
<div>Otherwise, I will not receive the counter until a special
and rare event occurs.<br>
</div>
<div><br>
</div>
<div>Regards,</div>
<div>Marat</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<p><br>
</p>
</body>
</html>