全部 新建

user:thomas 由使用者建立的 Gists

title:mygist Gists 的標題

filename:myfile.txt Gists 的檔案名稱

extension:yml Gists 的副檔名

language:go Gists 的程式語言

topic:homelab gists with given topic

登錄


全部 新建 登錄

All gists matching topic prometheus

倒序排序 創建
順序排序 創建
倒序排序 更新
順序排序 更新

timmy / Flask + Prometheus 快速監控

0 喜歡
0 分支
1 檔案
最後活躍 7 months ago
使用 Flask 和 Prometheus 客戶端,快速設置基本的應用監控,輕鬆追蹤請求數量和延遲。
flask metrics monitoring prometheus python webapp
1 from flask import Flask, Response
2 from prometheus_client import Counter, Summary, generate_latest, CONTENT_TYPE_LATEST
3 import time
4
5 app = Flask(__name__)
6
7 # 自訂 metrics
8 REQUEST_COUNT = Counter('app_requests_total', 'Total number of requests')
9 REQUEST_LATENCY = Summary('app_request_latency_seconds', 'Request latency')
上一頁 下一頁

由 Opengist 提供支持 ⋅ Load: 32ms⋅

繁體中文
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文