Skip to content

Fix Prometheus response time units#1104

Open
evevseev wants to merge 1 commit intoenvoyproxy:mainfrom
evevseev:fix-1101-prometheus-timer-seconds
Open

Fix Prometheus response time units#1104
evevseev wants to merge 1 commit intoenvoyproxy:mainfrom
evevseev:fix-1101-prometheus-timer-seconds

Conversation

@evevseev
Copy link
Copy Markdown

@evevseev evevseev commented Apr 9, 2026

Fixes #1101

Summary

  • scale the built-in Prometheus ratelimit_server.*.response_time mapping from milliseconds to seconds so ratelimit_service_response_time_seconds matches its name and Prometheus unit conventions
  • add PROMETHEUS_RESPONSE_TIME_AS_MILLISECONDS=true as a compatibility switch for users who rely on the legacy built-in behavior
  • document the new compatibility flag and add tests for both the default and legacy behavior

Breaking Change / Migration

The built-in Prometheus mapper now exports ratelimit_service_response_time_seconds in seconds instead of milliseconds.
Users who depend on the legacy built-in behavior can preserve it by setting:

PROMETHEUS_RESPONSE_TIME_AS_MILLISECONDS=true

This compatibility flag only affects the built-in default mapper. If PROMETHEUS_MAPPER_YAML is set, that custom mapping remains unchanged.

Scale the built-in Prometheus response time mapping to seconds so ratelimit_service_response_time_seconds matches its name. Add a compatibility flag to preserve the legacy millisecond behavior when needed.

Signed-off-by: Evgeny Evseev <evgeny@evseevs.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prometheus histogram ratelimit_service_response_time_seconds is in fact observing milliseconds

1 participant