Metrics
Metrics are numerical values that record changes over time, such as request times for a web server or active connections for a database. Metrics are recorded as time series, capturing changes over specific intervals of time. Prometheus database is designed to store periodical samples of monitored metrics (e.g. a sample each 15-30sec). It is not meant to store every single change of monitored metric.
METRIC TYPES
Metric Type | Description |
---|---|
Counter | A cumulative metric that represents a single numerical value that only ever goes up. A counter is typically used to count requests served, tasks completed, errors occurred, etc. |
Gauge | A metric that represents a single numerical value that can arbitrarily go up and down. Gauges are typically used to measure values like temperatures or current memory usage. |
Histogram | A metric that samples observations (usually things like request durations or response sizes) and counts them in configurable buckets. It also provides a sum of all observed values. |
Summary | Similar to a histogram, a summary samples observations (e.g., request durations and response sizes). While it also provides a total count of observations and a sum of all observed values, it calculates configurable quantiles over a sliding time window |
MovingAvgGauge | Inherits from the Gauge class and adds functionality to track a moving average of values over a specified window size. It can also calculate the rate of change if configured to do so. This is particularly useful for metrics that benefit from smoothed out volatility or when rate of change is more indicative of system behavior than raw values. This metric is particularly effective in conjunction with the doConnect command, especially when dealing with values that change more rapidly than the Prometheus data sampling rate. |
The Grafana JSON template is located in the following folder:
<installationDirectory>/PromClient_3.20/grafana