2

Python Flask with Prometheus Basic Example

 2 years ago
source link: https://gist.github.com/ruanbekker/e5b1e7895f62b020ff29b5f40767190c
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Python Flask with Prometheus Basic Example · GitHub

Instantly share code, notes, and snippets.

Python Flask with Prometheus Basic Example
$ curl http://localhost:5000/metrics
# HELP python_gc_objects_collected_total Objects collected during gc
# TYPE python_gc_objects_collected_total counter
python_gc_objects_collected_total{generation="0"} 317.0
python_gc_objects_collected_total{generation="1"} 71.0
python_gc_objects_collected_total{generation="2"} 0.0
# HELP python_gc_objects_uncollectable_total Uncollectable object found during GC
# TYPE python_gc_objects_uncollectable_total counter
python_gc_objects_uncollectable_total{generation="0"} 0.0
python_gc_objects_uncollectable_total{generation="1"} 0.0
python_gc_objects_uncollectable_total{generation="2"} 0.0
# HELP python_gc_collections_total Number of times this generation was collected
# TYPE python_gc_collections_total counter
python_gc_collections_total{generation="0"} 66.0
python_gc_collections_total{generation="1"} 6.0
python_gc_collections_total{generation="2"} 0.0
# HELP python_info Python platform information
# TYPE python_info gauge
python_info{implementation="CPython",major="3",minor="7",patchlevel="9",version="3.7.9"} 1.0
# HELP process_virtual_memory_bytes Virtual memory size in bytes.
# TYPE process_virtual_memory_bytes gauge
process_virtual_memory_bytes 2.9003776e+07
# HELP process_resident_memory_bytes Resident memory size in bytes.
# TYPE process_resident_memory_bytes gauge
process_resident_memory_bytes 2.4039424e+07
# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
# TYPE process_start_time_seconds gauge
process_start_time_seconds 1.61037167605e+09
# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
# TYPE process_cpu_seconds_total counter
process_cpu_seconds_total 0.17
# HELP process_open_fds Number of open file descriptors.
# TYPE process_open_fds gauge
process_open_fds 7.0
# HELP process_max_fds Maximum number of open file descriptors.
# TYPE process_max_fds gauge
process_max_fds 1.048576e+06
# HELP number_of_requests_total The number of requests, its a counter so the value can increase or reset to zero.
# TYPE number_of_requests_total counter
number_of_requests_total 1.0
# HELP number_of_requests_created The number of requests, its a counter so the value can increase or reset to zero.
# TYPE number_of_requests_created gauge
number_of_requests_created 1.6103716764095376e+09
# HELP current_memory_usage_locally The current value of memory usage, its a gauge so it can go up or down.
# TYPE current_memory_usage_locally gauge
current_memory_usage_locally{server_name="server-a"} 62497.0

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK