如何在代码中集成prometheus client例子

作者: admin 分类: prometheus 发布时间: 2017-11-07 16:23 ė 6 没有评论

https://github.com/prometheus-zh/prometheus-py-client/blob/master/prometheus_cls.py

官方示例:https://github.com/prometheus/client_python
HTTP
Metrics are usually exposed over HTTP, to be read by the Prometheus server.
The easiest way to do this is via start_http_server, which will start a HTTP server in a daemon thread on the given port:
from prometheus_client import start_http_server

start_http_server(8000)
Visit http://localhost:8000/ to view the metrics.
To add Prometheus exposition to an existing HTTP server, see the MetricsHandler class which provides a BaseHTTPRequestHandler. It also serves as a simple example of how to write a custom endp

我这里卖新疆阿克苏苹果 加微信:1.pic

本文出自 小Q,转载时请注明出处及相应链接。

本文永久链接: http://www.linuxqq.com/archives/1705.html

0
更多
Ɣ回顶部