Tutti Nuovi

user:thomas utente che ha creato il gist

title:mygist titolo del gist

filename:myfile.txt nome di file nel gist

extension:yml estensione del file nel gist

language:go linguaggio del file nel gist

topic:homelab gists with given topic

Entra


Tutti Nuovi Entra

All gists matching topic metrics

Più recente creazione
Meno recente creazione
Più recente aggiornamento
Meno recente aggiornamento

timmy / Flask + Prometheus 快速監控

0 mi piace
0 forks
1 files
Ultima volta attivo 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')
Più nuovi Più vecchi

Creato da Opengist ⋅ Load: 18ms⋅

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