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

Status code incorrectly logged #401

Open
thomsentner opened this issue Jul 27, 2021 · 3 comments · Fixed by #402
Open

Status code incorrectly logged #401

thomsentner opened this issue Jul 27, 2021 · 3 comments · Fixed by #402

Comments

@thomsentner
Copy link

thomsentner commented Jul 27, 2021

Describe the bug
Responses initiated through flask.abort / werkzeug.exceptions.abort are always logged as HTTP status code 500 by Flask-MonitoringDashboard, even when e.g. flask.abort(400) is called.

To Reproduce

import flask_monitoringdashboard as dashboard
from flask import Flask, abort

app = Flask(__name__)
dashboard.bind(app)

@app.route("/endpoint")
def endpoint():
    abort(400)

if __name__ == "__main__":
    app.run(port=5001)
curl "http://127.0.0.1:5001/endpoint"

When navigating to http://127.0.0.1:5001/dashboard/endpoint/1/status_code_distribution, a status code 500 is incorrectly logged.

Expected behavior
The actual HTTP codes to be logged.

Desktop (please complete the following information):
Flask==1.1.2
Flask-MonitoringDashboard==3.1.0

thomsentner pushed a commit to thomsentner/Flask-MonitoringDashboard that referenced this issue Jul 30, 2021
@thomsentner
Copy link
Author

thomsentner commented Jul 30, 2021

I've submitted a PR that seems to resolve this issue. As werkzeug.exceptions.abort and flask.abort are regularly used functions, I think these should be accounted for in Flask-MonitoringDashboard.

@thomsentner
Copy link
Author

Simplified dummy code above for clarity.

@HrisyToteva
Copy link

Hi @thomsentner , thank you for bringing up this issue and taking the time to contribute to the Flask-MonitoringDashboard project.

As part of my school project, my team is conducting a usability research study to improve the dashboard. I noticed your experience with the app and thought it would be valuable to gather more insights from you.

Would you be open to receiving a few questions about your experience with Flask-MonitoringDashboard? It won't take more than 20 minutes to answer them. Your feedback will play a vital role in enhancing the app's functionality and addressing any existing limitations.

If you're interested, please let me know, and I will send you the questions. Your involvement would be highly valuable and greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants