我正在尝试通过 Flask 为自定义 Prometheus 指标提供服务。查看https://github.com/prometheus/client_python,我有类似以下的代码:
from flask import Flask
from werkzeug.middleware.dispatcher import DispatcherMiddleware
from prometheus_client import make_wsgi_app
# Create my app
app = Flask(__name__)
# Add prometheus wsgi middleware to route /metrics requests
app.wsgi_app = DispatcherMiddleware(app.wsgi_app, {
'/metrics': make_wsgi_app()
})
通过此设置,我不太确定应该在哪里声明我的自定义指标?
慕工程0101907
相关分类