diff --git a/prometheus_flask_exporter/__init__.py b/prometheus_flask_exporter/__init__.py index 93ec1ce..4d98bbe 100644 --- a/prometheus_flask_exporter/__init__.py +++ b/prometheus_flask_exporter/__init__.py @@ -263,12 +263,17 @@ def register_endpoint(self, path, app=None): (by default it is the application registered with this class) """ - if is_running_from_reloader() and not os.environ.get('DEBUG_METRICS'): - return - if app is None: app = self.app or current_app + if is_running_from_reloader() and not os.environ.get('DEBUG_METRICS'): + app.logger.debug( + 'Metrics are disabled when run in the Flask development server' + ' with reload enabled. Set the environment variable' + ' DEBUG_METRICS=1 to enable them anyway.' + ) + return + @self.do_not_track() def prometheus_metrics(): accept_header = request.headers.get("Accept")