rycus86 / prometheus_flask_exporter

Prometheus exporter for Flask applications
https://pypi.python.org/pypi/prometheus-flask-exporter
MIT License
645 stars 161 forks source link

how to make my metrics? #177

Closed wuhaotju closed 5 months ago

wuhaotju commented 5 months ago

my code is here ` @app.route('/s1imple') def simple_get1(): return 'pass'

mypy_extensions = metrics.histogram( 'wwwwwwwwwwwwww', 'Request count by request paths', labels={'status': lambda r: r.status_code, 'uri': lambda: request.path} ) metrics.register_default(mypy_extensions) metrics.start_http_server(9999)

`

and i get the result wwwwwwwwwwwwww_bucket{le="0.005",status="<function <lambda> at 0x00000210D9BC9310>",uri="<function <lambda> at 0x00000210D9BC94C0>"} 0.0 wwwwwwwwwwwwww_bucket{le="0.01",status="<function <lambda> at 0x00000210D9BC9310>",uri="<function <lambda> at 0x00000210D9BC94C0>"} 0.0 wwwwwwwwwwwwww_bucket{le="0.025",status="<function <lambda> at 0x00000210D9BC9310>",uri="<function <lambda> at 0x00000210D9BC94C0>"} 0.0 wwwwwwwwwwwwww_bucket{le="0.05",status="<function <lambda> at 0x00000210D9BC9310>",uri="<function <lambda> at 0x00000210D9BC94C0>"} 0.0 wwwwwwwwwwwwww_bucket{le="0.075",status="<function <lambda> at 0x00000210D9BC9310>",uri="<function <lambda> at 0x00000210D9BC94C0>"} 0.0 wwwwwwwwwwwwww_bucket{le="0.1",status="<function <lambda> at 0x00000210D9BC9310>",uri="<function <lambda> at 0x00000210D9BC94C0>"} 0.0 wwwwwwwwwwwwww_bucket{le="0.25",status="<function <lambda> at 0x00000210D9BC9310>",uri="<function <lambda> at 0x00000210D9BC94C0>"} 0.0 wwwwwwwwwwwwww_bucket{le="0.5",status="<function <lambda> at 0x00000210D9BC9310>",uri="<function <lambda> at 0x00000210D9BC94C0>"} 0.0 wwwwwwwwwwwwww_bucket{le="0.75",status="<function <lambda> at 0x00000210D9BC9310>",uri="<function <lambda> at 0x00000210D9BC94C0>"} 0.0 wwwwwwwwwwwwww_bucket{le="1.0",status="<function <lambda> at 0x00000210D9BC9310>",uri="<function <lambda> at 0x00000210D9BC94C0>"} 0.0 wwwwwwwwwwwwww_bucket{le="2.5",status="<function <lambda> at 0x00000210D9BC9310>",uri="<function <lambda> at 0x00000210D9BC94C0>"} 0.0 wwwwwwwwwwwwww_bucket{le="5.0",status="<function <lambda> at 0x00000210D9BC9310>",uri="<function <lambda> at 0x00000210D9BC94C0>"} 0.0 wwwwwwwwwwwwww_bucket{le="7.5",status="<function <lambda> at 0x00000210D9BC9310>",uri="<function <lambda> at 0x00000210D9BC94C0>"} 0.0 wwwwwwwwwwwwww_bucket{le="10.0",status="<function <lambda> at 0x00000210D9BC9310>",uri="<function <lambda> at 0x00000210D9BC94C0>"} 0.0

why i get so much at 0x00000210D9BC9310>?