mirror of
https://github.com/FlareSolverr/FlareSolverr.git
synced 2026-11-22 20:22:31 +00:00
Implement Prometheus metrics
This commit is contained in:
1 parent
313fb2c14b
commit
d2e144ea12
6 files changed
+135
-16
No files matched your search
+8
-4
@@ -8,6 +8,7 @@ from bottle import run, response, Bottle, request, ServerAdapter
|
||||
|
||||
from bottle_plugins.error_plugin import error_plugin
|
||||
from bottle_plugins.logger_plugin import logger_plugin
|
||||
from bottle_plugins import prometheus_plugin
|
||||
from dtos import V1RequestBase
|
||||
import flaresolverr_service
|
||||
import utils
|
||||
@@ -24,10 +25,6 @@ class JSONErrorBottle(Bottle):
|
||||
|
||||
app = JSONErrorBottle()
|
||||
|
||||
# plugin order is important
|
||||
app.install(logger_plugin)
|
||||
app.install(error_plugin)
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
@@ -101,6 +98,13 @@ if __name__ == "__main__":
|
||||
# test browser installation
|
||||
flaresolverr_service.test_browser_installation()
|
||||
|
||||
# start bootle plugins
|
||||
# plugin order is important
|
||||
app.install(logger_plugin)
|
||||
app.install(error_plugin)
|
||||
prometheus_plugin.setup()
|
||||
app.install(prometheus_plugin.prometheus_plugin)
|
||||
|
||||
# start webserver
|
||||
# default server 'wsgiref' does not support concurrent requests
|
||||
# https://github.com/FlareSolverr/FlareSolverr/issues/680
|
||||
|
||||
Reference in new issue
Block a user