File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -54,11 +54,14 @@ pub fn init_metrics_handle() -> Result<PrometheusHandle, BuildError> {
54
54
}
55
55
56
56
/// This method initialized metrics by installing a global metrics recorder.
57
- /// It also starts listening on an http endpoint at `0.0.0.0 :9000/metrics`
58
- /// for scrapers to collect metrics from. If the passed project_ref
59
- /// is not none, it is set as a global label named "project".
57
+ /// It also starts listening on an http endpoint at `[::] :9000/metrics`
58
+ /// for scrapers to collect metrics from. This listens on all IPv4 and IPv6 interfaces.
59
+ /// If the passed project_ref is not none, it is set as a global label named "project".
60
60
pub fn init_metrics ( project_ref : Option < String > ) -> Result < ( ) , BuildError > {
61
- let mut builder = PrometheusBuilder :: new ( ) ;
61
+ let mut builder = PrometheusBuilder :: new ( ) . with_http_listener ( std:: net:: SocketAddr :: new (
62
+ std:: net:: IpAddr :: V6 ( std:: net:: Ipv6Addr :: UNSPECIFIED ) ,
63
+ 9000 ,
64
+ ) ) ;
62
65
63
66
if let Some ( project_ref) = project_ref {
64
67
builder = builder. add_global_label ( "project" , project_ref) ;
You can’t perform that action at this time.
0 commit comments