app: allow disabling metrics by environment variable
This commit is contained in:
parent
8a080f3eff
commit
62d87341ad
2 changed files with 3 additions and 2 deletions
|
@ -42,7 +42,7 @@ test:nose:
|
|||
- apt update && apt install build-essential
|
||||
- pip install -r requirements.txt --quiet
|
||||
- pip install nose
|
||||
- nosetests tests
|
||||
- DISABLE_METRICS=true nosetests tests
|
||||
|
||||
test:pylint:
|
||||
script:
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import os
|
||||
from typing import Iterator
|
||||
|
||||
from flask import Flask, redirect, url_for
|
||||
|
@ -100,7 +101,7 @@ class AutomationCollector(Collector):
|
|||
yield c
|
||||
|
||||
|
||||
if not_migrating():
|
||||
if not_migrating() and 'DISABLE_METRICS' not in os.environ:
|
||||
REGISTRY.register(DefinedProxiesCollector())
|
||||
REGISTRY.register(BlockedProxiesCollector())
|
||||
REGISTRY.register(AutomationCollector())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue