🌐
client_python
prometheus.github.io › client_python › instrumenting › gauge
Gauge | client_python
April 24, 2026 - A Gauge tracks a value that can go up and down. Use it for things you sample at a point in time — active connections, queue depth, memory usage, temperature. from prometheus_client import Gauge g = Gauge('my_inprogress_requests', 'Description of gauge') g.inc() # Increment by 1 g.dec(10) ...
🌐
HexDocs
hexdocs.pm › prometheus_ex › Prometheus.Metric.Gauge.html
Prometheus.Metric.Gauge — Prometheus.ex v5.1.0
Resets the value of the gauge identified by spec. Raises Prometheus.UnknownMetricError exception if a gauge for spec can't be found.<br> Raises Prometheus.InvalidMetricArityError exception if labels count mismatch. Sets the gauge identified by spec to value.
Discussions

question about initial gauge/counter values
ok (r@turbot)9> prometheus_gauge:reset("name"). true (r@turbot)10> prometheus_gauge:value("name"). 0 · I expected the metric to be created with the default value, and also that reset would always work. More on github.com
🌐 github.com
4
September 15, 2016
Avoid reading zero values after a restart
There's no way to make Prometheus wait. Even if you could, if 0 is a valid value as you say then how would Prometheus know if a 0 reading was a "real" one or not? You should ideally handle this in your system being scraped, either by having it set the gauge on startup or by having it retrieve the current value in real-time whenever it is scraped. If for whatever reason neither of those is possible then you should avoid using 0 as the default value if it can also be a "real" value. Use NaN, -1, or something else that's more explicitly invalid, then set your rules up accordingly. More on reddit.com
🌐 r/PrometheusMonitoring
9
0
February 3, 2022
How to implement Prometheus Gauge Set method in open-telemetry?
Problem Statement A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] I'm trying to migrate an project's metric implement from Prometheus to open-telemetry,it heavily use gauge.Set to measure valu... More on github.com
🌐 github.com
8
April 11, 2023
If the metric is a timestamp, should it's name end with epoch or seconds?
The naming conventions suggest the timestamp_seconds suffix. More on reddit.com
🌐 r/PrometheusMonitoring
6
6
April 10, 2023
🌐
OneUptime
oneuptime.com › home › blog › how to create prometheus gauge patterns
How to Create Prometheus Gauge Patterns
January 30, 2026 - Track resource usage as a percentage or absolute value. from prometheus_client import Gauge import psutil cpu_usage = Gauge( 'system_cpu_usage_percent', 'Current CPU usage percentage', ['cpu'] ) memory_usage_percent = Gauge( 'system_memory_usage_percent', 'Current memory usage percentage' ) disk_usage = Gauge( 'system_disk_usage_bytes', 'Current disk usage in bytes', ['mount_point'] ) def collect_system_metrics(): # CPU per core for i, percent in enumerate(psutil.cpu_percent(percpu=True)): cpu_usage.labels(cpu=f'cpu{i}').set(percent) # Memory mem = psutil.virtual_memory() memory_usage_percent.set(mem.percent) # Disk per mount point for partition in psutil.disk_partitions(): usage = psutil.disk_usage(partition.mountpoint) disk_usage.labels(mount_point=partition.mountpoint).set(usage.used)
🌐
Mirage
mirage.github.io › prometheus › prometheus › Prometheus › Gauge › index.html
Gauge (prometheus.Prometheus.Gauge)
v_labels ~label_names ~help ~namespace ~subsystem name is a family of metrics with full name namespace_subsystem_name and documentation string help. Each metric in the family will provide a value for each of the labels.
🌐
Robust Perception
robustperception.io › how-does-a-prometheus-gauge-work
How does a Prometheus Gauge work? – Robust Perception | Prometheus Monitoring Experts
December 26, 2016 - Gauges can go up and down over time, and scrapes take a snapshot of the current value. There's no potential for messing around with moving averages or resets, as there is with counters. Where Prometheus differs from other other monitoring systems is the API for gauges in instrumentation. The Prometheus Gauge API covers all the gauge uses cases in one place. It has inc, dec, and set methods, plus various utility functions for common uses such as setting the current time.
🌐
GitHub
github.com › prometheus › client_golang › blob › main › prometheus › gauge.go
client_golang/prometheus/gauge.go at main · prometheus/client_golang
November 6, 2020 - // // A Gauge is typically used ... use NewGauge. type Gauge interface { Metric · Collector · · // Set sets the Gauge to an arbitrary value....
Author: prometheus
🌐
Last9
last9.io › blog › prometheus-gauges-vs-counters
Prometheus Gauges vs Counters: What to Use and When | Last9
February 21, 2026 - Use .Set() when your application can retrieve the current value directly, such as from in-memory queues or counters. With prometheus_client, define the gauge and call .set() directly.
🌐
GitHub
github.com › m3db › prometheus_client_golang › blob › master › prometheus › gauge.go
prometheus_client_golang/prometheus/gauge.go at master · m3db/prometheus_client_golang
// // A Gauge is typically used ... use NewGauge. type Gauge interface { Metric · Collector · · // Set sets the Gauge to an arbitrary value....
Author: m3db
🌐
Jupp0r
jupp0r.github.io › prometheus-cpp › classprometheus_1_1Gauge.html
Prometheus Client Library for Modern C++: prometheus::Gauge Class Reference
A gauge metric to represent a value that can arbitrarily go up and down. The class represents the metric type gauge: https://prometheus.io/docs/concepts/metric_types/#gauge
Find elsewhere
🌐
Spatie
spatie.be › docs › laravel-prometheus › v1 › basic-usage › creating-gauges
Creating gauges | laravel-prometheus | Spatie
January 1, 2023 - Prometheus::addGauge('User count') ->label('status') ->value(function() { return [ [User::where('status', 'active')->count(), ['active']], [User::where('status', 'inactive')->count(), ['inactive']], ]; }); Instead of using multiple methods, ...
Address: Kruikstraat 22 bus 12, 2060, Antwerp
🌐
InfluxData Documentation
docs.influxdata.com › flux › v0 › prometheus › metric-types › gauge
Work with Prometheus gauges - InfluxData Documentation
November 6, 2023 - Use Flux to query and transform Prometheus gauge metrics stored in InfluxDB. A gauge is a metric that represents a single numerical value that can arbitrarily go up and down.
🌐
GitHub
github.com › prometheus › client_python › discussions › 731
Gauge with no value? · prometheus/client_python · Discussion #731
Hello, the best solution is probably to use a Custom Collector to gather the temperature information and only create a gauge if there is a value. This keeps the behavior of reading the thermometer when Prometheus scrapes the endpoint, and allows you lots of control over the results.
Author: prometheus
🌐
NVIDIA
docs.nvidia.com › metropolis › deepstream › 9.1 › sdk-api › classprometheus_1_1Gauge.html
NVIDIA DeepStream SDK API Reference: prometheus::Gauge Class Reference | NVIDIA Docs
Decrement the gauge by 1. Decrement ... the gauge by 1. Increment the gauge by the given amount. Increment the gauge by the given amount. Set the gauge to the given value....
🌐
Prometheus
prometheus.io › docs › concepts › metric_types
Metric types | Prometheus
Gauges are typically used for measured values like temperatures or current memory usage, but also "counts" that can go up and down, like the number of concurrent requests.
🌐
GitHub
github.com › deadtrickster › prometheus.erl › issues › 37
question about initial gauge/counter values · Issue #37 · prometheus-erl/prometheus.erl
September 15, 2016 - (r@turbot)4> prometheus_gauge:new([{name,"name"},{help,"help me!"}]). ok (r@turbot)5> prometheus_gauge:value("name"). undefined (r@turbot)6> prometheus_gauge:reset("name"). false (r@turbot)7> prometheus_gauge:value("name"). undefined (r@turbot)8> prometheus_gauge:set("name",1).
Author: prometheus-erl
🌐
GitHub
github.com › open-telemetry › opentelemetry-go › issues › 3984
How to implement Prometheus Gauge Set method in open-telemetry? · Issue #3984 · open-telemetry/opentelemetry-go
April 11, 2023 - It have an gauge metric for conn pool stats, defined as: ... On other hand, another library we used only expose an Store method to the user, which is been called when the library want to set a metric to an concrete value (with different labels group), we implement Store use gauge.Set method.
Author: open-telemetry
🌐
Google Groups
groups.google.com › g › prometheus-developers › c › zTgIUR7Y-JQ
[python prometheus_client] is Gauge.set guaranteed to always cast as float given value?
I'm considering to use a gauge to reflect the evolution of a boolean value. Knowing that the set method of a Gauge cast the given value as a float, I could call directly my_gauge.set(my_bool_value), and have it set to 0.0 or 1.0.
🌐
Tom Gregory
tomgregory.com › how-and-when-to-use-a-prometheus-gauge
How and when to use a Prometheus gauge | Tom Gregory
February 5, 2021 - The max_over_time function calculates the gauge's maximum value over the time range. ... Most Prometheus functions do work with gauges, but there are some important exceptions such as increase and rate.