Files
kumomta/docs/reference/metrics/proxy-server/user_lua_latency.md
T
Wez Furlong 41291a4afb docs: mark generated pages with an @generated marker
The documentation generators now stamp each page they emit with an
@generated comment so that tooling can tell generated pages apart from
hand-written ones. Update the table-of-contents generator to skip YAML
front matter when picking a page title, since the marker is now stored
there.
2026-10-05 13:22:26 +01:00

2.1 KiB

user_lua_latency

Type: Histogram
Labels: label
Buckets: 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1.0, 2.5, 5.0, 10.0

How many seconds something user-defined took to run in your lua policy.

!!! info This metric has labels, which means that the system will track the metric for each combination of the possible labels that are active. Certain labels, especially those that correlate with source or destination addresses or domains, can have high cardinality. High cardinality metrics may require some care and attention when provisioning a downstream metrics server.

This histogram is updated by policy scripts that employ the kumo.time.start_timer function to record a duration in the policy.

The label is whatever you specified as the label(s) to the various kumo.time.start_timer calls in the policy.

Histogram

This metric is a histogram which means that it is exported as three underlying metrics:

  • user_lua_latency_count - a counter tracking how many events have been accumulated into the histogram
  • user_lua_latency_sum - a counter tracking the total value of all of the events have been accumulated into the histogram
  • user_lua_latency_bucket - a counter tracking the number of events that fall within the various buckets shown above. This counter has an additional le label that indicates the bucket threshold. For example, the first bucket for this histogram will generate a label le="0.005" which will keep track of the number of events whose value was less-or-equal (le) that value.

The recommended visualization for a histogram is a heatmap based on user_lua_latency_bucket.

While it is possible to calculate a mean average for user_lua_latency by computing user_lua_latency_sum / user_lua_latency_count, it can be difficult to reason about what that value means if the traffic patterns are not uniform since the launch of the process. We strongly recommend using a heatmap visualization instead of computing an average value.