Refactor prometheus integration
Move prometheus to SaaS and make it a plugin Move static callers to use metrics_queue plugin Change local-docker to support different quay clone dirnames Change prom_aggregator to use logrus
This commit is contained in:
parent
3d9acf2fff
commit
668a8edc50
10 changed files with 216 additions and 161 deletions
6
app.py
6
app.py
|
@ -25,7 +25,7 @@ from data.archivedlogs import LogArchive
|
|||
from data.userevent import UserEventsBuilderModule
|
||||
from data.queue import WorkQueue, MetricQueueReporter
|
||||
from util import get_app_url
|
||||
from util import prometheus
|
||||
from util.saas.prometheus import PrometheusPlugin
|
||||
from util.saas.analytics import Analytics
|
||||
from util.saas.exceptionlog import Sentry
|
||||
from util.names import urn_generator
|
||||
|
@ -168,7 +168,8 @@ Principal(app, use_sessions=False)
|
|||
avatar = Avatar(app)
|
||||
login_manager = LoginManager(app)
|
||||
mail = Mail(app)
|
||||
metric_queue = MetricQueue()
|
||||
prometheus = PrometheusPlugin(app)
|
||||
metric_queue = MetricQueue(prometheus)
|
||||
storage = Storage(app, metric_queue)
|
||||
userfiles = Userfiles(app, storage)
|
||||
log_archive = LogArchive(app, storage)
|
||||
|
@ -208,7 +209,6 @@ if os.path.exists(_v2_key_path):
|
|||
else:
|
||||
docker_v2_signing_key = RSAKey(key=RSA.generate(2048))
|
||||
|
||||
prometheus.init(app.config.get('PROMETHEUS_AGGREGATOR_URL'))
|
||||
|
||||
database.configure(app.config)
|
||||
model.config.app_config = app.config
|
||||
|
|
Reference in a new issue