File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1584,6 +1584,20 @@ def _update_server_extensions(self, change):
15841584 """
15851585 ).tag (config = True )
15861586
1587+ @default ('authenticate_prometheus' )
1588+ def _default_authenticate_prometheus (self ):
1589+ """ Authenticate Prometheus by default, unless auth is disabled. """
1590+ return bool (self .password ) or bool (self .token )
1591+
1592+ @observe ('authenticate_prometheus' )
1593+ def _update_authenticate_prometheus (self , change ):
1594+ self .authenticate_prometheus = change ['new' ]
1595+ if self .authenticate_prometheus :
1596+ self .log .info (_ ("Authentication of /metrics is ON." ))
1597+ else :
1598+ self .log .info (_ ("Authentication of /metrics is OFF." ))
1599+
1600+
15871601 # Since use of terminals is also a function of whether the terminado package is
15881602 # available, this variable holds the "final indication" of whether terminal functionality
15891603 # should be considered (particularly during shutdown/cleanup). It is enabled only
You can’t perform that action at this time.
0 commit comments