Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding grafana, prometheus dashboard for analysing APIs #357

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions api/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
render_template,
send_file)
from flask import request as flask_request
from prometheus_flask_exporter import PrometheusMetrics

from api.database_queries import (
filter_by_date,
filter_by_fields,
Expand Down Expand Up @@ -61,6 +63,11 @@
__name__,
template_folder=template_dir
)
metrics = PrometheusMetrics(app)

metrics.info('app_info', 'OWASP Honeypot is an open-source software in Python language which designed '
'for creating honeypot and honeynet in an easy and secure way', version='1.0.0')

app.config.from_object(
__name__
)
Expand Down Expand Up @@ -232,6 +239,7 @@ def index():

@app.route("/", defaults={"path": ""})
@app.route("/<path:path>")
@metrics.do_not_track()
def get_static_files(path):
"""
getting static files and return content mime types
Expand Down
14 changes: 14 additions & 0 deletions data/grafana/dashboards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: 1

providers:
- name: 'provisionned dashboards'
orgId: 1
folder: ''
folderUid: ''
type: file
disableDeletion: false
editable: true
updateIntervalSeconds: 10
allowUiUpdates: false
options:
path: /var/lib/grafana/dashboards
Loading