Use prometheus as a metric backend

This entails writing a metric aggregation program since each worker has its
own memory, and thus own metrics because of python gunicorn. The python
client is a simple wrapper that makes web requests to it.
This commit is contained in:
Matt Jibson 2015-11-20 15:32:17 -05:00 committed by Joseph Schorr
parent 781f2eec72
commit 3d9acf2fff
10 changed files with 502 additions and 0 deletions

3
app.py
View file

@ -25,6 +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.analytics import Analytics
from util.saas.exceptionlog import Sentry
from util.names import urn_generator
@ -207,6 +208,8 @@ 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
model.config.store = storage