forked from jcroyoaun/cerouno-prom-python-inst
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
19 lines (15 loc) · 709 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import http.server
#from prometheus_client import start_http_server
APP_PORT = 8000
#METRICS_PORT = 8001
class HandleRequests(http.server.BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header("Content-type", "text/html")
self.end_headers()
self.wfile.write(bytes("<html><head><title>Mi aplicacion instrumentada</title></head><body><center><h2>Cerouno - Demo de instrumentation para Prometheus con Python.</center></h2></body></html>", "utf-8"))
self.wfile.close()
if __name__ == "__main__":
#start_http_server(METRICS_PORT)
server = http.server.HTTPServer(('localhost', APP_PORT), HandleRequests)
server.serve_forever()