Skip to content

Commit 9d5a3d9

Browse files
Initial
0 parents  commit 9d5a3d9

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[![PyPI](https://img.shields.io/pypi/v/flask-pyctuator?color=green&style=plastic)](https://pypi.org/project/flask-pyctuator/)
2+
[![build](https://github.com/SolarEdgeTech/flasl-pyctuator/workflows/build/badge.svg)](https://github.com/SolarEdgeTech/flask-pyctuator/)
3+
4+
# Flask Pyctuator Extension
5+
A [Flask extension](https://flask.palletsprojects.com/en/2.0.x/extensions/) that uses [Pyctuator](https://github.com/SolarEdgeTech/pyctuator) to enable [Spring Boot Admin](https://github.com/codecentric/spring-boot-admin) (SBA) to monitor health, configuration, log-file and resource-usage of a Flask application.
6+
7+
Please see [Pyctuator](https://github.com/SolarEdgeTech/pyctuator) for the complete documentation and **note** that the some features such as monitoring memory/disk usage **require instlaling of additional modules**.
8+
9+
10+
# Quick Start
11+
1. Install Flask and the flask-pyctuator extension using your favorite python package manager
12+
2. Start a local SBA (Spring Boot Admin) server using Dockers:
13+
```sh
14+
docker run --rm -p 8080:8080 --add-host=host.docker.internal:host-gateway michayaak/spring-boot-admin:2.2.3-1
15+
```
16+
3. Open SBA's main page, http://localhost:8080, in your browser
17+
4. Run the following Flask application:
18+
```python
19+
from flask import Flask
20+
from flask_pyctuator.flask_pyctuator import FlaskPyctuator
21+
22+
app = Flask("Flask App with Pyctuator")
23+
24+
25+
@app.route("/")
26+
def hello():
27+
return "Hello World!"
28+
29+
30+
FlaskPyctuator(
31+
app,
32+
pyctuator_endpoint_url="http://host.docker.internal:5000/pyctuator",
33+
)
34+
35+
app.run(debug=False, port=5000, host="0.0.0.0")
36+
```

0 commit comments

Comments
 (0)