Improve documentation of the metric stage. (#2335)

Specially w/r/t `max_idle_duration`
pull/2341/head
Cyril Tovena 5 years ago committed by GitHub
parent b82d2e89d2
commit ed64054d0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      docs/clients/promtail/stages/metrics.md

@ -33,6 +33,13 @@ type: Counter
# defaulting to the metric's name if not present. # defaulting to the metric's name if not present.
[source: <string>] [source: <string>]
# Label values on metrics are dynamic which can cause exported metrics
# to go stale (for example when a stream stops receiving logs).
# To prevent unbounded growth of the /metrics endpoint any metrics which
# have not been updated within this time will be removed.
# Must be greater than or equal to '1s', if undefined default is '5m'
[max_idle_duration: <string>]
config: config:
# If present and true all log lines will be counted without # If present and true all log lines will be counted without
# attempting to match the source to the extract map. # attempting to match the source to the extract map.
@ -113,6 +120,13 @@ type: Histogram
# defaulting to the metric's name if not present. # defaulting to the metric's name if not present.
[source: <string>] [source: <string>]
# Label values on metrics are dynamic which can cause exported metrics
# to go stale (for example when a stream stops receiving logs).
# To prevent unbounded growth of the /metrics endpoint any metrics which
# have not been updated within this time will be removed.
# Must be greater than or equal to '1s', if undefined default is '5m'
[max_idle_duration: <string>]
config: config:
# Filters down source data and only changes the metric # Filters down source data and only changes the metric
# if the targeted value exactly matches the provided string. # if the targeted value exactly matches the provided string.
@ -141,6 +155,7 @@ config:
type: Counter type: Counter
description: "total number of log lines" description: "total number of log lines"
prefix: my_promtail_custom_ prefix: my_promtail_custom_
max_idle_duration: 1d
config: config:
match_all: true match_all: true
action: inc action: inc
@ -148,6 +163,7 @@ config:
type: Counter type: Counter
description: "total bytes of log lines" description: "total bytes of log lines"
prefix: my_promtail_custom_ prefix: my_promtail_custom_
max_idle_duration: 1d
config: config:
match_all: true match_all: true
count_entry_bytes: true count_entry_bytes: true
@ -160,6 +176,8 @@ by using the `match_all: true` parameter.
It also creates a `log_bytes_total` counter which adds the byte size of every log line received It also creates a `log_bytes_total` counter which adds the byte size of every log line received
to the counter by using the `count_entry_bytes: true` parameter. to the counter by using the `count_entry_bytes: true` parameter.
Those two metrics will disappear after 1d if they don't receive new entries, this is useful to reduce the building up of stage metrics.
The combination of these two metric stages will give you two counters to track the volume of The combination of these two metric stages will give you two counters to track the volume of
every log stream in both number of lines and bytes, which can be useful in identifying sources every log stream in both number of lines and bytes, which can be useful in identifying sources
of very high volume, as well as helping understand why you may have too much cardinality. of very high volume, as well as helping understand why you may have too much cardinality.

Loading…
Cancel
Save