Git Product home page Git Product logo

flask-dashboard / flask-monitoringdashboard Goto Github PK

View Code? Open in Web Editor NEW
735.0 735.0 158.0 15.68 MB

Automatically monitor the evolving performance of Flask/Python web services.

Home Page: http://flask-monitoringdashboard.readthedocs.io/

License: MIT License

Python 30.03% CSS 51.96% JavaScript 9.85% HTML 8.09% Shell 0.02% SCSS 0.04% Procfile 0.01%
dashboard flask flask-extension flask-monitoring-dashboard monitoring profiler python

flask-monitoringdashboard's Introduction


Flask Monitoring Dashboard

A dashboard for automatic monitoring of Flask web-services.

Build Status Documentation Status codecov PyPI version Py-version Downloads Tweet

Key FeaturesHow to useLive DemoFeedbackDocumentationScreenshotsLicense

gif

Motivation

image

Key Features

The Flask Monitoring Dashboard is an extension for Flask applications that offers four main functionalities with little effort from the Flask developer:

  • Monitor the performance and utilization: The Dashboard allows you to see which endpoints process a lot of requests and how fast. Additionally, it provides information about the evolving performance of an endpoint throughout different versions if you're using git.

  • Profile requests and endpoints: The execution path of every request is tracked and stored into the database. This allows you to gain insight over which functions in your code take the most time to execute. Since all requests for an endpoint are also merged together, the Dashboard provides an overview of which functions are used in which endpoint.

  • Collect extra information about outliers: Outliers are requests that take much longer to process than regular requests. The Dashboard automatically detects that a request is an outlier and stores extra information about it (stack trace, request values, Request headers, Request environment).

  • Collect additional information about your Flask-application: Suppose you have an User-table and you want to know how many users are registered on your Flask-application. Then, you can run the following query: 'SELECT Count(*) FROM USERS;'. But this is just annoying to do regularly. Therefore, you can configure this in the Flask-MonitoringDashboard, which will provide you this information per day (or other time interval).

The dashboard is automatically added to your existing Flask application. You can view the results by default using the default endpoint (this can be configured to another route):

/dashboard

For more advanced documentation, take a look at the information on this site.

How to use

Installation

To install from source, download the source code, then run this:

python setup.py install

Or install with pip:

pip install flask_monitoringdashboard

Setup

Adding the extension to your Flask app is simple:

from flask import Flask
import flask_monitoringdashboard as dashboard

app = Flask(__name__)

@app.route("/test")
def test():
    return 'ok'

dashboard.bind(app)
app.run()

Live Demo

To view a live deployment of the Flask-MonitoringDashboard, check this site. Use the credentials u:admin, p:admin to log in.

Feedback

In order to improve our Flask-MonitoringDashboard, we would like to hear from you! Therefore, we made a questionnaire with a few questions. Filling in this form takes less than 3 minutes. You can find the form here.

Alternatively, feel free to write to our email-address.

Documentation

For more advanced documentation, see this site. If you run into trouble migrating from version 1.X.X to version 2.0.0, this site will help you solve this too.

Screenshots

Screenshot 1 Screenshot 2 Screenshot 3 Screenshot 4 Screenshot 5

Development

If you like our project, and willing to contribute, you can get started by cloning it and then running the following command:

. ./config/install.sh

For more information, check this page.

License

This project is licensed under the MIT License - see the LICENSE file for details.

flask-monitoringdashboard's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flask-monitoringdashboard's Issues

ordering of the "graphs" is quite random and so are their names...

ordering should should start from the most interesting view to the least interesting
probably:

  • Time per Version
  • Heatmap

Some of the more experimental ones might even be hid by default...e.g. time per ip...

also, the naming is not principled:

  • time per version -- what is being shown
  • heatmap -- how is the stuff being shown (we don't even know what)

installer complains about missing package

does this happen to you too?

$ python setup.py install
...
Searching for traceback
Reading https://pypi.python.org/simple/traceback/
Couldn't find index page for 'traceback' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
No local packages or working download links found for traceback
error: Could not find suitable distribution for Requirement.parse('traceback')

Error 500 on Test Monitor page

Since I cannot see the specific error the app throws, I can only guess as to what might have caused this exception.

There is a chance this issue will be resolved after redeploying the app when the updated db migration has been run:
DROP TABLE Settings;
DELETE FROM testRun;
DELETE FROM tests;
ALTER TABLE testRun ADD COLUMN suite INTEGER;
ALTER TABLE testRun ADD COLUMN run INTEGER;

exception in outlier.py

[Mon Mar 05 12:19:53.260897 2018] [wsgi:error] [pid 7790:tid 140474868172544] Exception occurred:
[Mon Mar 05 12:19:53.263324 2018] [wsgi:error] [pid 7790:tid 140474868172544] Traceback (most recent call last):
[Mon Mar 05 12:19:53.263386 2018] [wsgi:error] [pid 7790:tid 140474868172544]   File "/usr/local/lib/python3.6/site-packages/flask_monitoring_dashboard-1.9-py3.6.egg/dashboard/outlier.py", line 40, in log_stack_trace
[Mon Mar 05 12:19:53.263397 2018] [wsgi:error] [pid 7790:tid 140474868172544]     stack_list.extend(['', str(th)])
[Mon Mar 05 12:19:53.263415 2018] [wsgi:error] [pid 7790:tid 140474868172544]   File "/usr/local/lib/python3.6/threading.py", line 819, in __repr__
[Mon Mar 05 12:19:53.263424 2018] [wsgi:error] [pid 7790:tid 140474868172544]     self.is_alive() # easy way to get ._is_stopped set when appropriate
[Mon Mar 05 12:19:53.263446 2018] [wsgi:error] [pid 7790:tid 140474868172544]   File "/usr/local/lib/python3.6/threading.py", line 1115, in is_alive
[Mon Mar 05 12:19:53.264237 2018] [wsgi:error] [pid 7790:tid 140474868172544]     self._wait_for_tstate_lock(False)
[Mon Mar 05 12:19:53.264462 2018] [wsgi:error] [pid 7790:tid 140474868172544]   File "/usr/local/lib/python3.6/threading.py", line 1071, in _wait_for_tstate_lock
[Mon Mar 05 12:19:53.264471 2018] [wsgi:error] [pid 7790:tid 140474868172544]     assert self._is_stopped
[Mon Mar 05 12:19:53.264502 2018] [wsgi:error] [pid 7790:tid 140474868172544] AssertionError
[Mon Mar 05 12:19:53.264656 2018] [wsgi:error] [pid 7790:tid 140474868172544] Exception occurred:
[Mon Mar 05 12:19:53.264769 2018] [wsgi:error] [pid 7790:tid 140474868172544] Traceback (most recent call last):
[Mon Mar 05 12:19:53.264818 2018] [wsgi:error] [pid 7790:tid 140474868172544]   File "/usr/local/lib/python3.6/site-packages/flask_monitoring_dashboard-1.9-py3.6.egg/dashboard/outlier.py", line 40, in log_stack_trace
[Mon Mar 05 12:19:53.265607 2018] [wsgi:error] [pid 7790:tid 140474868172544]     stack_list.extend(['', str(th)])
[Mon Mar 05 12:19:53.265629 2018] [wsgi:error] [pid 7790:tid 140474868172544]   File "/usr/local/lib/python3.6/threading.py", line 819, in __repr__
[Mon Mar 05 12:19:53.265638 2018] [wsgi:error] [pid 7790:tid 140474868172544]     self.is_alive() # easy way to get ._is_stopped set when appropriate
[Mon Mar 05 12:19:53.265654 2018] [wsgi:error] [pid 7790:tid 140474868172544]   File "/usr/local/lib/python3.6/threading.py", line 1115, in is_alive
[Mon Mar 05 12:19:53.265662 2018] [wsgi:error] [pid 7790:tid 140474868172544]     self._wait_for_tstate_lock(False)
[Mon Mar 05 12:19:53.265678 2018] [wsgi:error] [pid 7790:tid 140474868172544]   File "/usr/local/lib/python3.6/threading.py", line 1071, in _wait_for_tstate_lock
[Mon Mar 05 12:19:53.265686 2018] [wsgi:error] [pid 7790:tid 140474868172544]     assert self._is_stopped
[Mon Mar 05 12:19:53.265711 2018] [wsgi:error] [pid 7790:tid 140474868172544] AssertionError
[Mon Mar 05 12:19:53.265832 2018] [wsgi:error] [pid 7790:tid 140474868172544] Exception occurred:
[Mon Mar 05 12:19:53.265932 2018] [wsgi:error] [pid 7790:tid 140474868172544] Traceback (most recent call last):
[Mon Mar 05 12:19:53.265990 2018] [wsgi:error] [pid 7790:tid 140474868172544]   File "/usr/local/lib/python3.6/site-packages/flask_monitoring_dashboard-1.9-py3.6.egg/dashboard/outlier.py", line 40, in log_stack_trace
[Mon Mar 05 12:19:53.265999 2018] [wsgi:error] [pid 7790:tid 140474868172544]     stack_list.extend(['', str(th)])
[Mon Mar 05 12:19:53.266016 2018] [wsgi:error] [pid 7790:tid 140474868172544]   File "/usr/local/lib/python3.6/threading.py", line 819, in __repr__
[Mon Mar 05 12:19:53.266024 2018] [wsgi:error] [pid 7790:tid 140474868172544]     self.is_alive() # easy way to get ._is_stopped set when appropriate
[Mon Mar 05 12:19:53.266040 2018] [wsgi:error] [pid 7790:tid 140474868172544]   File "/usr/local/lib/python3.6/threading.py", line 1115, in is_alive
[Mon Mar 05 12:19:53.266048 2018] [wsgi:error] [pid 7790:tid 140474868172544]     self._wait_for_tstate_lock(False)
[Mon Mar 05 12:19:53.266063 2018] [wsgi:error] [pid 7790:tid 140474868172544]   File "/usr/local/lib/python3.6/threading.py", line 1071, in _wait_for_tstate_lock
[Mon Mar 05 12:19:53.266071 2018] [wsgi:error] [pid 7790:tid 140474868172544]     assert self._is_stopped
[Mon Mar 05 12:19:53.266095 2018] [wsgi:error] [pid 7790:tid 140474868172544] AssertionError
[Mon Mar 05 12:19:53.266213 2018] [wsgi:error] [pid 7790:tid 140474868172544] Exception occurred:
[Mon Mar 05 12:19:53.266313 2018] [wsgi:error] [pid 7790:tid 140474868172544] Traceback (most recent call last):
[Mon Mar 05 12:19:53.266361 2018] [wsgi:error] [pid 7790:tid 140474868172544]   File "/usr/local/lib/python3.6/site-packages/flask_monitoring_dashboard-1.9-py3.6.egg/dashboard/outlier.py", line 40, in log_stack_trace
[Mon Mar 05 12:19:53.266370 2018] [wsgi:error] [pid 7790:tid 140474868172544]     stack_list.extend(['', str(th)])
[Mon Mar 05 12:19:53.266386 2018] [wsgi:error] [pid 7790:tid 140474868172544]   File "/usr/local/lib/python3.6/threading.py", line 819, in __repr__
[Mon Mar 05 12:19:53.266394 2018] [wsgi:error] [pid 7790:tid 140474868172544]     self.is_alive() # easy way to get ._is_stopped set when appropriate
[Mon Mar 05 12:19:53.266410 2018] [wsgi:error] [pid 7790:tid 140474868172544]   File "/usr/local/lib/python3.6/threading.py", line 1115, in is_alive
[Mon Mar 05 12:19:53.266418 2018] [wsgi:error] [pid 7790:tid 140474868172544]     self._wait_for_tstate_lock(False)
[Mon Mar 05 12:19:53.266434 2018] [wsgi:error] [pid 7790:tid 140474868172544]   File "/usr/local/lib/python3.6/threading.py", line 1071, in _wait_for_tstate_lock
[Mon Mar 05 12:19:53.266442 2018] [wsgi:error] [pid 7790:tid 140474868172544]     assert self._is_stopped
[Mon Mar 05 12:19:53.266466 2018] [wsgi:error] [pid 7790:tid 140474868172544] AssertionError
[Mon Mar 05 12:19:53.266584 2018] [wsgi:error] [pid 7790:tid 140474868172544] Exception occurred:
[Mon Mar 05 12:19:53.266684 2018] [wsgi:error] [pid 7790:tid 140474868172544] Traceback (most recent call last):
[Mon Mar 05 12:19:53.266730 2018] [wsgi:error] [pid 7790:tid 140474868172544]   File "/usr/local/lib/python3.6/site-packages/flask_monitoring_dashboard-1.9-py3.6.egg/dashboard/outlier.py", line 40, in log_stack_trace
[Mon Mar 05 12:19:53.266739 2018] [wsgi:error] [pid 7790:tid 140474868172544]     stack_list.extend(['', str(th)])
[Mon Mar 05 12:19:53.266756 2018] [wsgi:error] [pid 7790:tid 140474868172544]   File "/usr/local/lib/python3.6/threading.py", line 819, in __repr__
[Mon Mar 05 12:19:53.266764 2018] [wsgi:error] [pid 7790:tid 140474868172544]     self.is_alive() # easy way to get ._is_stopped set when appropriate
[Mon Mar 05 12:19:53.266780 2018] [wsgi:error] [pid 7790:tid 140474868172544]   File "/usr/local/lib/python3.6/threading.py", line 1115, in is_alive
[Mon Mar 05 12:19:53.266788 2018] [wsgi:error] [pid 7790:tid 140474868172544]     self._wait_for_tstate_lock(False)
[Mon Mar 05 12:19:53.266804 2018] [wsgi:error] [pid 7790:tid 140474868172544]   File "/usr/local/lib/python3.6/threading.py", line 1071, in _wait_for_tstate_lock
[Mon Mar 05 12:19:53.266812 2018] [wsgi:error] [pid 7790:tid 140474868172544]     assert self._is_stopped
[Mon Mar 05 12:19:53.266843 2018] [wsgi:error] [pid 7790:tid 140474868172544] AssertionError

more variety in endpoint colors

can we get more diverse endpoint colors?
currently they all seem to be shades of green.

this being said, it's awesome that an endpoint
has now a fixed color! Cool job!!

Detecting that an Endpoint has been renamed

It would be nice if the history of an endpoint that was renamed would not be lost,
but rather, the rename would be detected and taken into account in the UI and in
the analysis.

I wonder how difficult this would be.

Two challenges I see:

  • identifying that it's a rename and not a delete + new addition (could be done based on source code analysis, or even based on traces... etc.)
  • finding a good way to display this in the UI... and maybe also asking the user to confirm to make sure that it's not a confusion

Finally, the easy solution would be to let the user add some extra configuration for this.

Python version

Since the usage (from commit: 62cf9da) of python string interpolation (https://www.python.org/dev/peps/pep-0498/), backwards compatibility is removed from any python interpreter lower than python 3.6.

So, the question is whether we should use string interpolation, as fewer people are able to deploy the Flask-Monitoring-Dashboard?

Second question, what is the minimum python version that we should support?

Patrick

Static file statistics error

Hi, great job on the monitor. I am a python developer loves flask as well.
But I found some problem in the current version about static file access.
Here I attached the error prompt when accessing static files if /<path:filename> was ticked.

image

Thanks!

numpy missing

the latest version of the dashboard fails with:
i did pip install -r requirements.txt but i think the dependency is not in there.
can you fix this?

[Sat Apr 28 00:04:13.676574 2018] [wsgi:error] [pid 13140:tid 139939926939392] [remote 130.92.64.84:43763] mod_wsgi (pid=13140): Target WSGI script '/home/mircea/zee/http/api/zeeguu_api.wsgi' cannot be loaded as Python module.
[Sat Apr 28 00:04:13.676650 2018] [wsgi:error] [pid 13140:tid 139939926939392] [remote 130.92.64.84:43763] mod_wsgi (pid=13140): Exception occurred processing WSGI script '/home/mircea/zee/http/api/zeeguu_api.wsgi'.
[Sat Apr 28 00:04:13.677812 2018] [wsgi:error] [pid 13140:tid 139939926939392] [remote 130.92.64.84:43763] Traceback (most recent call last):
[Sat Apr 28 00:04:13.677887 2018] [wsgi:error] [pid 13140:tid 139939926939392] [remote 130.92.64.84:43763]   File "/home/mircea/zee/http/api/zeeguu_api.wsgi", line 14, in <module>
[Sat Apr 28 00:04:13.677899 2018] [wsgi:error] [pid 13140:tid 139939926939392] [remote 130.92.64.84:43763]     from zeeguu_api.app import app as application
[Sat Apr 28 00:04:13.677917 2018] [wsgi:error] [pid 13140:tid 139939926939392] [remote 130.92.64.84:43763]   File "/home/mircea/zee/http/api/zeeguu_api/app.py", line 43, in <module>
[Sat Apr 28 00:04:13.677926 2018] [wsgi:error] [pid 13140:tid 139939926939392] [remote 130.92.64.84:43763]     dashboard.bind(app=app, blue_print=api)
[Sat Apr 28 00:04:13.677946 2018] [wsgi:error] [pid 13140:tid 139939926939392] [remote 130.92.64.84:43763]   File "/usr/local/lib/python3.6/site-packages/Flask_MonitoringDashboard-1.12.0-py3.6.egg/flask_monitoringdashboard/__init__.py", line 64, in bind
[Sat Apr 28 00:04:13.677955 2018] [wsgi:error] [pid 13140:tid 139939926939392] [remote 130.92.64.84:43763]     import flask_monitoringdashboard.views
[Sat Apr 28 00:04:13.677977 2018] [wsgi:error] [pid 13140:tid 139939926939392] [remote 130.92.64.84:43763]   File "/usr/local/lib/python3.6/site-packages/Flask_MonitoringDashboard-1.12.0-py3.6.egg/flask_monitoringdashboard/views/__init__.py", line 11, in <module>
[Sat Apr 28 00:04:13.677986 2018] [wsgi:error] [pid 13140:tid 139939926939392] [remote 130.92.64.84:43763]     from . import dashboard
[Sat Apr 28 00:04:13.678005 2018] [wsgi:error] [pid 13140:tid 139939926939392] [remote 130.92.64.84:43763]   File "/usr/local/lib/python3.6/site-packages/Flask_MonitoringDashboard-1.12.0-py3.6.egg/flask_monitoringdashboard/views/dashboard/__init__.py", line 12, in <module>
[Sat Apr 28 00:04:13.678015 2018] [wsgi:error] [pid 13140:tid 139939926939392] [remote 130.92.64.84:43763]     from flask_monitoringdashboard.views.dashboard.endpoints import page_boxplot_per_endpoint
[Sat Apr 28 00:04:13.678055 2018] [wsgi:error] [pid 13140:tid 139939926939392] [remote 130.92.64.84:43763]   File "/usr/local/lib/python3.6/site-packages/Flask_MonitoringDashboard-1.12.0-py3.6.egg/flask_monitoringdashboard/views/dashboard/endpoints.py", line 6, in <module>
[Sat Apr 28 00:04:13.678068 2018] [wsgi:error] [pid 13140:tid 139939926939392] [remote 130.92.64.84:43763]     from flask_monitoringdashboard.core.utils import simplify
[Sat Apr 28 00:04:13.678087 2018] [wsgi:error] [pid 13140:tid 139939926939392] [remote 130.92.64.84:43763]   File "/usr/local/lib/python3.6/site-packages/Flask_MonitoringDashboard-1.12.0-py3.6.egg/flask_monitoringdashboard/core/utils.py", line 4, in <module>
[Sat Apr 28 00:04:13.678096 2018] [wsgi:error] [pid 13140:tid 139939926939392] [remote 130.92.64.84:43763]     import numpy as np
[Sat Apr 28 00:04:13.678131 2018] [wsgi:error] [pid 13140:tid 139939926939392] [remote 130.92.64.84:43763] ModuleNotFoundError: No module named 'numpy'

dashboard module's templates conflict with app's templates

Since the source code defines templates of dashboard module in the same folder of app's templates,
the appearance has conflict if i did not edit my base.html as the module one implies.

em... i'm not sure whether you intentionally did this, but i guess you want to make the appearance consistent with original app. Then should i edit my base.html like yours?

why is the dashboard menu always closing?

It should stay open once i've selected 'measurements' from the navigation menu. In fact it should also highlight the current open page.

in fact it should open by default on the 'measurements' page, because this is what i care about in the first place! once there are measurements set up, i don't want to read again about how to use the dashboard ;)

api tests failing due to collect_performance

The Zeeguu-API tests are failing with the following:

Traceback (most recent call last):
  File "collect_performance.py", line 73, in <module>
    with open('endpoint_hits.log') as log:
FileNotFoundError: [Errno 2] No such file or directory: 'endpoint_hits.log'
The command "python collect_performance.py" exited with 1.

See more info at: https://travis-ci.org/zeeguu-ecosystem/Zeeguu-API/builds/334398408#L2346

This is a new error AFAIK. Probably since the latest changes to the Dashboard? Can you look into it?

do surround the group_by with a try/catch

if the group_by function fails, the entire endpoint fails.

solution would be to surround the call to the function in the dashboard with a try/catch.

(this was not a problem, since in the past, the try/catch was provided by the client.
but the code in the client looked quite ugly...)

remove IDE files from version control

.idea/automatic-monitoring-dasboard.iml | 19 +++++
.idea/inspectionProfiles/profiles_settings.xml | 7 ++
.idea/misc.xml | 4 +
.idea/modules.xml | 8 ++
.idea/vcs.xml | 6 ++
.idea/workspace.xml | 453 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Need information regarding when the logs are written in database

Hi,

I don't have an issue to report, so not following the template. Rather, I need some information. I'm trying to figure out when the logs are written to the database to have an idea if the end performance will take any hit if, let's say, the db this library is writing to is blocked for some reason. Is the write done in a background job? I went through the code but didn't see that happening. I think you're using a decorator to wrap the views and then log their time taken with a direct function call and inside that the db is being written. Am I write?

Can you please clarify how much, if any, performance hit I can expect on a high traffic site?

Thanks for all the great work. Hope to contribute to this library sometime. :)

Evolution of Utilization

Folks, I just realized that for the evolution we have views about performance, but we don't have any views about utilization.

I'm thinking about something like:

screenshot 2018-03-26 18 52 37

On a view like this, you can for example, see clearly that recommended articles only appeared in version n but not in version n-1.

Also, a view like this would allow the spotting of renames, because a new endpoint, with very similar usage profile would appear where another one would not be used. (which is the case in the figure)

there seems to be a bug in the dashboard which breaks the api.

[Fri Jan 12 20:47:46.278009 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] response = self.full_dispatch_request()
[Fri Jan 12 20:47:46.278034 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] File "/usr/local/lib/python3.6/site-packages/Flask-0.12.2-py3.6.egg/flask/app.py", line 1614, in full_dispatch_request
[Fri Jan 12 20:47:46.278048 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] rv = self.handle_user_exception(e)
[Fri Jan 12 20:47:46.278063 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] File "/usr/local/lib/python3.6/site-packages/Flask_Cors-3.0.2-py3.6.egg/flask_cors/extension.py", line 161, in wrapped_function
[Fri Jan 12 20:47:46.278075 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] return cors_after_request(app.make_response(f(*args, **kwargs)))
[Fri Jan 12 20:47:46.289690 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] File "/usr/local/lib/python3.6/site-packages/Flask-0.12.2-py3.6.egg/flask/app.py", line 1517, in handle_user_exception
[Fri Jan 12 20:47:46.289704 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] reraise(exc_type, exc_value, tb)
[Fri Jan 12 20:47:46.289719 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] File "/usr/local/lib/python3.6/site-packages/Flask-0.12.2-py3.6.egg/flask/_compat.py", line 33, in reraise
[Fri Jan 12 20:47:46.289732 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] raise value
[Fri Jan 12 20:47:46.289747 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] File "/usr/local/lib/python3.6/site-packages/Flask-0.12.2-py3.6.egg/flask/app.py", line 1612, in full_dispatch_request
[Fri Jan 12 20:47:46.301353 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] rv = self.dispatch_request()
[Fri Jan 12 20:47:46.301377 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] File "/usr/local/lib/python3.6/site-packages/Flask-0.12.2-py3.6.egg/flask/app.py", line 1598, in dispatch_request
[Fri Jan 12 20:47:46.301392 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] return self.view_functionsrule.endpoint
[Fri Jan 12 20:47:46.301408 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] File "/usr/local/lib/python3.6/site-packages/flask_monitoring_dashboard-1.8-py3.6.egg/dashboard/measurement.py", line 87, in wrapper
[Fri Jan 12 20:47:46.302489 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] return func(*args, **kwargs)
[Fri Jan 12 20:47:46.313096 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] File "/home/mircea/zee/http/api/zeeguu_api/api/utils/route_wrappers.py", line 43, in wrapped_view
[Fri Jan 12 20:47:46.313111 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] response = flask.make_response(view(*args, **kwargs))
[Fri Jan 12 20:47:46.313127 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] File "/home/mircea/zee/http/api/zeeguu_api/api/utils/route_wrappers.py", line 29, in wrapped_view
[Fri Jan 12 20:47:46.313140 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] return view(*args, **kwargs)
[Fri Jan 12 20:47:46.313159 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] File "/home/mircea/zee/http/api/zeeguu_api/api/upload_user_activity_data.py", line 44, in upload_user_activity_data
[Fri Jan 12 20:47:46.313857 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] datetime.strptime(time, "%Y-%m-%dT%H:%M:%S"),
[Fri Jan 12 20:47:46.313880 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] File "/usr/local/lib/python3.6/_strptime.py", line 565, in _strptime_datetime
[Fri Jan 12 20:47:46.313892 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] tt, fraction = _strptime(data_string, format)
[Fri Jan 12 20:47:46.313910 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] File "/usr/local/lib/python3.6/_strptime.py", line 362, in _strptime
[Fri Jan 12 20:47:46.313921 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] (data_string, format))
[Fri Jan 12 20:47:46.314761 2018] [wsgi:error] [pid 15650:tid 139659333158656] [remote 145.97.138.189:52060] ValueError: time data '2018-0-12T19:47:47' does not match format '%Y-%m-%dT%H:%M:%S'

allow time period selection for every view

this would be good to have for the CR ready version of the paper.
should be quite straightforward.

and would allow us to regenerate some of the older graphs with the new colors. which would make the paper even more awesome than it is now!

opt-in / opt-out

for testing reasons, but also in general i started to think that it could make sense to provide a config option which would allow one to set the default state of all the endpoints.

now they are by default not tracked, and one can choose to opt-in to the ones they want to track.

a config option that would allow setting the default state of an endpoint might be good also for evolution analysis. now, if you rename an endpoint, you have to remember to start tracking the new one. if they would all be tracked by default, this would not be needed.

what do you think?

option could be:

default_track = [True | False]

DB error (OperationalError) after removing and renaming several endpoints.

I've removed several endpoints and also renamed several.
when i redeployed the API i had no errors.
however, later, when accessing the renamed endpoint
( i remember for sure that it happened when i accessed
'stop_following_feed' which occurs also in this trace)
an exception in the Dashboard is thrown which kills the
entire endpoint which results in a 500 error.

Great would be to:

  • make sure the exception is not thrown
    Better than nothing would be to:
  • catch such exceptions and let the endpoint do it's
    job even if the tracking crashes.

To fix this I've deployed the API with dasboardEnabled=False
once. Then re-enabled it and it worked.

I can't reproduce, because now it works.

But this might be useful for you.

[Wed Feb 21 15:24:15.754589 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61859] compiled_sql, distilled_params
[Wed Feb 21 15:24:15.754605 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61859] File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
[Wed Feb 21 15:24:15.754613 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61859] context)
[Wed Feb 21 15:24:15.754628 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61859] File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1402, in _handle_dbapi_exception
[Wed Feb 21 15:24:15.754637 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61859] exc_info
[Wed Feb 21 15:24:15.754652 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61859] File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
[Wed Feb 21 15:24:15.754660 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61859] reraise(type(exception), exception, tb=exc_tb, cause=cause)
[Wed Feb 21 15:24:15.754676 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61859] File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 186, in reraise
[Wed Feb 21 15:24:15.754685 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61859] raise value.with_traceback(tb)
[Wed Feb 21 15:24:15.754700 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61859] File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
[Wed Feb 21 15:24:15.754708 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61859] context)
[Wed Feb 21 15:24:15.754723 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61859] File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
[Wed Feb 21 15:24:15.754732 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61859] cursor.execute(statement, parameters)
[Wed Feb 21 15:24:15.754759 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61859] sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked [SQL: 'UPDATE rules SET last_accessed=? WHERE rules.endpoint = ?'] [parameters: ('2018-02-21 15:24:10.741125', 'api.get_non_subscribed_feeds')]
[Wed Feb 21 15:24:22.525761 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] mod_wsgi (pid=3664): Exception occurred processing WSGI script '/home/mircea/zee/http/api/zeeguu_api.wsgi'.
[Wed Feb 21 15:24:22.526359 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] Traceback (most recent call last):
[Wed Feb 21 15:24:22.526402 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
[Wed Feb 21 15:24:22.526412 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] context)
[Wed Feb 21 15:24:22.526448 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
[Wed Feb 21 15:24:22.526457 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] cursor.execute(statement, parameters)
[Wed Feb 21 15:24:22.526488 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] sqlite3.OperationalError: database is locked
[Wed Feb 21 15:24:22.526512 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866]
[Wed Feb 21 15:24:22.526521 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] The above exception was the direct cause of the following exception:
[Wed Feb 21 15:24:22.526528 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866]
[Wed Feb 21 15:24:22.526543 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] Traceback (most recent call last):
[Wed Feb 21 15:24:22.526705 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/Flask-0.12.2-py3.6.egg/flask/app.py", line 1997, in call
[Wed Feb 21 15:24:22.526714 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] return self.wsgi_app(environ, start_response)
[Wed Feb 21 15:24:22.526730 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/Flask-0.12.2-py3.6.egg/flask/app.py", line 1985, in wsgi_app

[Wed Feb 21 15:24:22.526739 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] response = self.handle_exception(e)
[Wed Feb 21 15:24:22.526755 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/Flask_Cors-3.0.2-py3.6.egg/flask_cors/extension.py", line 161, in wrapped_function
[Wed Feb 21 15:24:22.526764 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] return cors_after_request(app.make_response(f(*args, **kwargs)))
[Wed Feb 21 15:24:22.526780 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/Flask-0.12.2-py3.6.egg/flask/app.py", line 1540, in handle_exception
[Wed Feb 21 15:24:22.526789 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] reraise(exc_type, exc_value, tb)
[Wed Feb 21 15:24:22.526804 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/Flask-0.12.2-py3.6.egg/flask/_compat.py", line 33, in reraise
[Wed Feb 21 15:24:22.526812 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] raise value
[Wed Feb 21 15:24:22.526828 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/Flask-0.12.2-py3.6.egg/flask/app.py", line 1982, in wsgi_app
[Wed Feb 21 15:24:22.526836 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] response = self.full_dispatch_request()
[Wed Feb 21 15:24:22.526852 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/Flask-0.12.2-py3.6.egg/flask/app.py", line 1614, in full_dispatch_request
[Wed Feb 21 15:24:22.526861 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] rv = self.handle_user_exception(e)
[Wed Feb 21 15:24:22.526876 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/Flask_Cors-3.0.2-py3.6.egg/flask_cors/extension.py", line 161, in wrapped_function
[Wed Feb 21 15:24:22.526885 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] return cors_after_request(app.make_response(f(*args, **kwargs)))
[Wed Feb 21 15:24:22.526907 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/Flask-0.12.2-py3.6.egg/flask/app.py", line 1517, in handle_user_exception
[Wed Feb 21 15:24:22.526916 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] reraise(exc_type, exc_value, tb)
[Wed Feb 21 15:24:22.526932 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/Flask-0.12.2-py3.6.egg/flask/_compat.py", line 33, in reraise
[Wed Feb 21 15:24:22.526940 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] raise value
[Wed Feb 21 15:24:22.526955 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/Flask-0.12.2-py3.6.egg/flask/app.py", line 1612, in full_dispatch_request
[Wed Feb 21 15:24:22.526964 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] rv = self.dispatch_request()
[Wed Feb 21 15:24:22.526979 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/Flask-0.12.2-py3.6.egg/flask/app.py", line 1598, in dispatch_request
[Wed Feb 21 15:24:22.526988 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] return self.view_functionsrule.endpoint
[Wed Feb 21 15:24:22.527004 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/flask_monitoring_dashboard-1.9-py3.6.egg/dashboard/measurement.py", line 86, in wrapper
[Wed Feb 21 15:24:22.527013 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] update_last_accessed(endpoint=endpoint, value=datetime.datetime.now())
[Wed Feb 21 15:24:22.527029 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/flask_monitoring_dashboard-1.9-py3.6.egg/dashboard/database/endpoint.py", line 132, in update_last_accessed
[Wed Feb 21 15:24:22.527038 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] update({MonitorRule.last_accessed: value})
[Wed Feb 21 15:24:22.527053 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3345, in update

[Wed Feb 21 15:24:22.527062 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] update_op.exec_()
[Wed Feb 21 15:24:22.527077 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 1179, in exec_
[Wed Feb 21 15:24:22.527085 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] self._do_exec()
[Wed Feb 21 15:24:22.527100 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 1334, in _do_exec
[Wed Feb 21 15:24:22.527109 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] mapper=self.mapper)
[Wed Feb 21 15:24:22.527124 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 1139, in execute
[Wed Feb 21 15:24:22.527132 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] bind, close_with_result=True).execute(clause, params or {})
[Wed Feb 21 15:24:22.527148 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 945, in execute
[Wed Feb 21 15:24:22.527156 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] return meth(self, multiparams, params)
[Wed Feb 21 15:24:22.527172 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection
[Wed Feb 21 15:24:22.527186 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] return connection._execute_clauseelement(self, multiparams, params)
[Wed Feb 21 15:24:22.527203 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement
[Wed Feb 21 15:24:22.527211 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] compiled_sql, distilled_params
[Wed Feb 21 15:24:22.527226 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
[Wed Feb 21 15:24:22.527235 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] context)
[Wed Feb 21 15:24:22.527250 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1402, in _handle_dbapi_exception
[Wed Feb 21 15:24:22.527258 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] exc_info
[Wed Feb 21 15:24:22.527274 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
[Wed Feb 21 15:24:22.527282 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] reraise(type(exception), exception, tb=exc_tb, cause=cause)
[Wed Feb 21 15:24:22.527298 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 186, in reraise
[Wed Feb 21 15:24:22.527307 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] raise value.with_traceback(tb)
[Wed Feb 21 15:24:22.527322 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
[Wed Feb 21 15:24:22.527330 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] context)
[Wed Feb 21 15:24:22.527345 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
[Wed Feb 21 15:24:22.527354 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] cursor.execute(statement, parameters)
[Wed Feb 21 15:24:22.527381 2018] [wsgi:error] [pid 3664:tid 140584959235840] [remote 94.214.187.58:61866] sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked [SQL: 'UPDATE rules SET last_accessed=? WHERE rules.endpoint = ?'] [parameters: ('2018-02-21 15:24:17.520847', 'api.stop_following_feed')]

exception in the deployed version

looks like this:

[Fri Aug 11 13:12:05.653499 2017] [wsgi:error] [pid 31972:tid 140340353804032] Traceback (most recent call last):
[Fri Aug 11 13:12:05.653550 2017] [wsgi:error] [pid 31972:tid 140340353804032]   File "/usr/local/lib/python3.6/site-packages/flask_monitoring_dashboard-1.8-py3.6.egg/dashboard/outlier.py", line 42, in log_stack_trace
[Fri Aug 11 13:12:05.653558 2017] [wsgi:error] [pid 31972:tid 140340353804032]     stack_list.extend(['', str(th)])
[Fri Aug 11 13:12:05.653573 2017] [wsgi:error] [pid 31972:tid 140340353804032]   File "/usr/local/lib/python3.6/threading.py", line 819, in __repr__
[Fri Aug 11 13:12:05.653579 2017] [wsgi:error] [pid 31972:tid 140340353804032]     self.is_alive() # easy way to get ._is_stopped set when appropriate
[Fri Aug 11 13:12:05.653592 2017] [wsgi:error] [pid 31972:tid 140340353804032]   File "/usr/local/lib/python3.6/threading.py", line 1115, in is_alive
[Fri Aug 11 13:12:05.653599 2017] [wsgi:error] [pid 31972:tid 140340353804032]     self._wait_for_tstate_lock(False)
[Fri Aug 11 13:12:05.653612 2017] [wsgi:error] [pid 31972:tid 140340353804032]   File "/usr/local/lib/python3.6/threading.py", line 1071, in _wait_for_tstate_lock
[Fri Aug 11 13:12:05.653619 2017] [wsgi:error] [pid 31972:tid 140340353804032]     assert self._is_stopped

do you have any idea why?

setup.py should be in the root of the repository

guys,

the Zeeguu-API automated testing breaks now since it has a dependency to the dashboard.

It turns out that for Travis / pip to be able to automatically pull a library from github the setup.py should be in the root of the project.

so if you could make this happen it would be great!

MySql database connection error

herllo i'm trying to specify a path to a mysql db in the config file:
DATABASE=mysql://username:pswd@host/db_name

and i get the sequent stack trace error when trying to run the app.py for my flask project:

Traceback (most recent call last):
  File "/home/andreamarino/www/flask_project/app.py", line 21, in <module>
    dashboard.bind(app)
  File "/usr/local/lib/python2.7/dist-packages/flask_monitoringdashboard/__init__.py", line 64, in bind
    import flask_monitoringdashboard.views
  File "/usr/local/lib/python2.7/dist-packages/flask_monitoringdashboard/views/__init__.py", line 11, in <module>
    from . import dashboard
  File "/usr/local/lib/python2.7/dist-packages/flask_monitoringdashboard/views/dashboard/__init__.py", line 12, in <module>
    from flask_monitoringdashboard.views.dashboard.endpoints import page_boxplot_per_endpoint
  File "/usr/local/lib/python2.7/dist-packages/flask_monitoringdashboard/views/dashboard/endpoints.py", line 6, in <module>
    from flask_monitoringdashboard.core.utils import simplify
  File "/usr/local/lib/python2.7/dist-packages/flask_monitoringdashboard/core/utils.py", line 7, in <module>
    from flask_monitoringdashboard.database.endpoint import get_monitor_rule
  File "/usr/local/lib/python2.7/dist-packages/flask_monitoringdashboard/database/__init__.py", line 121, in <module>
    Base.metadata.create_all(engine)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/schema.py", line 4004, in create_all
    tables=tables)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1940, in _run_visitor
    conn._run_visitor(visitorcallable, element, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1549, in _run_visitor
    **kwargs).traverse_single(element)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/visitors.py", line 121, in traverse_single
    return meth(obj, **kw)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/ddl.py", line 757, in visit_metadata
    _is_metadata_operation=True)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/visitors.py", line 121, in traverse_single
    return meth(obj, **kw)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/ddl.py", line 791, in visit_table
    include_foreign_key_constraints=include_foreign_key_constraints
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 948, in execute
    return meth(self, multiparams, params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/ddl.py", line 68, in _execute_on_connection
    return connection._execute_ddl(self, multiparams, params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1009, in _execute_ddl
    compiled
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context
    context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1413, in _handle_dbapi_exception
    exc_info
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
    context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 507, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (1074, "Column length too big for column 'stacktrace' (max = 21845); use BLOB or TEXT instead") [SQL: u'\nCREATE TABLE outliers (\n\tid INTEGER NOT NULL AUTO_INCREMENT, \n\tendpoint VARCHAR(250) NOT NULL, \n\trequest_values VARCHAR(10000), \n\trequest_headers VARCHAR(10000), \n\trequest_environment VARCHAR(10000), \n\trequest_url VARCHAR(1000), \n\tcpu_percent VARCHAR(100), \n\tmemory VARCHAR(10000), \n\tstacktrace VARCHAR(100000), \n\texecution_time FLOAT NOT NULL, \n\ttime DATETIME, \n\tPRIMARY KEY (id)\n)\n\n'] (Background on this error at: http://sqlalche.me/e/e3q8)

refactor the group_by

such that it matches the API presented in the paper.
most importance changes: shorten the name of the config option and take the name of the category as the first element in the tuple

# LOC #2: configure the dashboard
# to group requests by the user id
dashboard.config.group_by = 'User',
	lambda: Session.find(flask.request).user.id

bug when i remove an endpoint

it seems that if i remove an endopint, (e.g. the commented out here: https://github.com/mircealungu/Zeeguu-API/blob/master/zeeguu_api/api/feeds.py#L300) the dashboard crashes on startup. can you have a look at this?

[Sat Jun 24 08:48:15.975501 2017] [wsgi:error] [pid 25280:tid 139895168640768] [remote 130.92.64.84:36387] KeyError: 'api.get_feed_items_for'
[Sat Jun 24 08:48:16.020493 2017] [wsgi:error] [pid 25280:tid 139895051142912] [remote 130.92.64.84:36388] mod_wsgi (pid=25280): Exception occurred processing WSGI script '/home/mircea/zee/http/api/zeeguu_api.wsgi'.
[Sat Jun 24 08:48:16.020730 2017] [wsgi:error] [pid 25280:tid 139895051142912] [remote 130.92.64.84:36388] Traceback (most recent call last):
[Sat Jun 24 08:48:16.020813 2017] [wsgi:error] [pid 25280:tid 139895051142912] [remote 130.92.64.84:36388]   File "/usr/local/lib/python3.6/site-packages/Flask-0.12.2-py3.6.egg/flask/app.py", line 1997, in __call__
[Sat Jun 24 08:48:16.020822 2017] [wsgi:error] [pid 25280:tid 139895051142912] [remote 130.92.64.84:36388]     return self.wsgi_app(environ, start_response)
[Sat Jun 24 08:48:16.020836 2017] [wsgi:error] [pid 25280:tid 139895051142912] [remote 130.92.64.84:36388]   File "/usr/local/lib/python3.6/site-packages/Flask-0.12.2-py3.6.egg/flask/app.py", line 1985, in wsgi_app
[Sat Jun 24 08:48:16.020843 2017] [wsgi:error] [pid 25280:tid 139895051142912] [remote 130.92.64.84:36388]     response = self.handle_exception(e)
[Sat Jun 24 08:48:16.020875 2017] [wsgi:error] [pid 25280:tid 139895051142912] [remote 130.92.64.84:36388]   File "/usr/local/lib/python3.6/site-packages/Flask_Cors-3.0.2-py3.6.egg/flask_cors/extension.py", line 161, in wrapped_function
[Sat Jun 24 08:48:16.020883 2017] [wsgi:error] [pid 25280:tid 139895051142912] [remote 130.92.64.84:36388]     return cors_after_request(app.make_response(f(*args, **kwargs)))
[Sat Jun 24 08:48:16.020896 2017] [wsgi:error] [pid 25280:tid 139895051142912] [remote 130.92.64.84:36388]   File "/usr/local/lib/python3.6/site-packages/Flask-0.12.2-py3.6.egg/flask/app.py", line 1540, in handle_exception
[Sat Jun 24 08:48:16.020903 2017] [wsgi:error] [pid 25280:tid 139895051142912] [remote 130.92.64.84:36388]     reraise(exc_type, exc_value, tb)
[Sat Jun 24 08:48:16.020916 2017] [wsgi:error] [pid 25280:tid 139895051142912] [remote 130.92.64.84:36388]   File "/usr/local/lib/python3.6/site-packages/Flask-0.12.2-py3.6.egg/flask/_compat.py", line 33, in reraise
[Sat Jun 24 08:48:16.020923 2017] [wsgi:error] [pid 25280:tid 139895051142912] [remote 130.92.64.84:36388]     raise value
[Sat Jun 24 08:48:16.020935 2017] [wsgi:error] [pid 25280:tid 139895051142912] [remote 130.92.64.84:36388]   File "/usr/local/lib/python3.6/site-packages/Flask-0.12.2-py3.6.egg/flask/app.py", line 1982, in wsgi_app
[Sat Jun 24 08:48:16.020942 2017] [wsgi:error] [pid 25280:tid 139895051142912] [remote 130.92.64.84:36388]     response = self.full_dispatch_request()
[Sat Jun 24 08:48:16.020955 2017] [wsgi:error] [pid 25280:tid 139895051142912] [remote 130.92.64.84:36388]   File "/usr/local/lib/python3.6/site-packages/Flask-0.12.2-py3.6.egg/flask/app.py", line 1607, in full_dispatch_request
[Sat Jun 24 08:48:16.020963 2017] [wsgi:error] [pid 25280:tid 139895051142912] [remote 130.92.64.84:36388]     self.try_trigger_before_first_request_functions()
[Sat Jun 24 08:48:16.020976 2017] [wsgi:error] [pid 25280:tid 139895051142912] [remote 130.92.64.84:36388]   File "/usr/local/lib/python3.6/site-packages/Flask-0.12.2-py3.6.egg/flask/app.py", line 1654, in try_trigger_before_first_request_functions
[Sat Jun 24 08:48:16.020983 2017] [wsgi:error] [pid 25280:tid 139895051142912] [remote 130.92.64.84:36388]     func()
[Sat Jun 24 08:48:16.020996 2017] [wsgi:error] [pid 25280:tid 139895051142912] [remote 130.92.64.84:36388]   File "/usr/local/lib/python3.6/site-packages/dashboard-1.5-py3.6.egg/dashboard/measurement.py", line 31, in init_measurement
[Sat Jun 24 08:48:16.021003 2017] [wsgi:error] [pid 25280:tid 139895051142912] [remote 130.92.64.84:36388]     user_app.view_functions[rule.endpoint] = track_performance(user_app.view_functions[rule.endpoint],
[Sat Jun 24 08:48:16.021029 2017] [wsgi:error] [pid 25280:tid 139895051142912] [remote 130.92.64.84:36388] KeyError: 'api.get_feed_items_for'

error on the /measurements page

a fragment from the log on the server:

[Tue May 30 14:20:29.012349 2017] [wsgi:error] [pid 25729:tid 140150059906816] [remote 145.90.134.187:47175]     <td><a href="{{ url_for('dashboard.show_graph', endpoint=record.endpoint) }}">Show graph</a></td>
[Tue May 30 14:20:29.012376 2017] [wsgi:error] [pid 25729:tid 140150059906816] [remote 145.90.134.187:47175] TypeError: url_for() got multiple values for argument 'endpoint'

screenshot 2017-05-30 14 21 44

simplify the collect_performance

currently in order to run the collect_performance script we need to export two variables beforehand.
we could simply pass those arguments in the command line.

thus, instead of:

script: 
  - "export DASHBOARD_CONFIG=./dashboard_test.cfg"
  - "./run_tests.sh"
  - "export DASHBOARD_LOG_DIR=./"
  - "python -m flask_monitoringdashboard.collect_performance ./dashboard_test.cfg "

we should be able to write:

  - "./run_tests.sh"
  - "python -m flask_monitoringdashboard.collect_performance ./tests_zeeguu_api 5 https://zeeguu.unibe.ch/api/dashboard/submit-test-results
 "

in fact, we should even be able to write:

- "python -m flask_monitoringdashboard.collect_performance ./tests_zeeguu_api 5 https://zeeguu.unibe.ch/api/dashboard/submit-test-results

this would be great because it would be much more straightforward to understand.

i'll write the paper in this way for now because it's much clearer for the reader. then at some later point we'll have to make sure to implement this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.