What is the use case of the unregister?

86 views
Skip to first unread message

Sicheng

unread,
Jul 25, 2023, 4:17:41 PM7/25/23
to Prometheus Users
Hello:
    We are using the golang Prometheus package, and the metrics is pulled from the /metric endpoint of the HTTP server.
The package provides a function called unregister.
I want to know what is the use case for this function? 
In some UTs, we called the unregister function to make sure the code will not panic. 
Apart from that, is there any place I should call the unregister function?

Best regards

Julien Pivotto

unread,
Jul 25, 2023, 6:21:27 PM7/25/23
to Sicheng, Prometheus Users
Unregister is mainly there for unit tests. I think it is very uncommon to see it
used elsewhere.

>
> --
> You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/2adf21ef-a032-483f-a5b1-afe3016f4165n%40googlegroups.com.


--
Julien Pivotto
@roidelapluie
Reply all
Reply to author
Forward
0 new messages