Add webhook queue monitoring
This commit is contained in:
parent
ac9f3aa1d3
commit
320a5e8f7c
|
@ -43,6 +43,9 @@ class TodoApp(SrhtFlask):
|
|||
self.add_template_filter(urls.tracker_url)
|
||||
self.add_template_filter(urls.user_url)
|
||||
|
||||
from todosrht.webhooks import webhook_metrics_collector
|
||||
self.metrics_registry.register(webhook_metrics_collector)
|
||||
|
||||
@self.context_processor
|
||||
def inject():
|
||||
return {
|
||||
|
|
|
@ -7,9 +7,13 @@ if not hasattr(db, "session"):
|
|||
db.init()
|
||||
from srht.webhook import Event
|
||||
from srht.webhook.celery import CeleryWebhook, make_worker
|
||||
from srht.metrics import RedisQueueCollector
|
||||
import sqlalchemy as sa
|
||||
|
||||
worker = make_worker(broker=cfg("todo.sr.ht", "webhooks"))
|
||||
|
||||
webhooks_broker = cfg("todo.sr.ht", "webhooks")
|
||||
worker = make_worker(broker=webhooks_broker)
|
||||
webhook_metrics_collector = RedisQueueCollector(webhook_broker, "srht_webhooks", "Webhook queue length")
|
||||
|
||||
import todosrht.tracker_import
|
||||
|
||||
|
|
Loading…
Reference in New Issue