Skip to content

Commit

Permalink
(WIP) add prometheus metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoblitt committed Apr 26, 2024
1 parent 7970749 commit e19577b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions gnocpush/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@

from flask import Flask, request
from gnocpush import Pusher
from prometheus_flask_exporter import PrometheusMetrics

# from flask_httpauth import HTTPBasicAuth
# from werkzeug.security import generate_password_hash, check_password_hash

app = Flask(__name__)
app.config['MAX_CONTENT_LENGTH'] = 4 * 1024 * 1024 # 4 MB
metrics = PrometheusMetrics(app)
# alertmanager webhook_config does not support http digest auth
# auth = HTTPBasicAuth()

Expand Down Expand Up @@ -42,6 +44,7 @@ def push_endpoint():


@app.route('/healthz', methods=['GET'])
@metrics.do_not_track()
def healthz():
return {'status': 'ok'}

Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
name = "gnocpush"
version = "0.1.0"
dependencies = [
"flake8-pyproject",
"flask",
"flask-httpauth",
"globalnoc_alertmon_agent",
"prometheus-flask-exporter==0.23.0",
"python-dateutil",
"requests",
"flask",
"flask-httpauth",
"flake8-pyproject",
]

[build-system]
Expand Down

0 comments on commit e19577b

Please sign in to comment.