Skip to content

Inconsistency in millisecond selectors in query explanations #16247

@roidelapluie

Description

@roidelapluie

What did you do?

When using the "Explain" feature in Prometheus, there's an inconsistency in how millisecond selectors are represented:

  • up[1001ms] is explained as up[1s]
  • up[1002ms] is explained as up[1s2ms]
  • up[1003ms] is explained as up[1s2ms]

Image

What did you expect to see?

Each millisecond selector should consistently and precisely reflect the original query:

  • up[1001ms] => up[1s1ms]
  • up[1002ms] => up[1s2ms]
  • up[1003ms] => up[1s3ms]

What did you see instead? Under which circumstances?

https://prometheus.demo.prometheus.io/query?g0.expr=up%5B1003ms%5D&g0.show_tree=1&g0.tab=explain&g0.range_input=1h&g0.res_type=auto&g0.res_density=medium&g0.display_mode=lines&g0.show_exemplars=0

System information

No response

Prometheus version

prometheus, version 3.2.1 (branch: arythmetics, revision: 63e29dba9a7418d02a4200f60d862e408462380b)
  build user:       reproducible@reproducible
  build date:       19800101-00:00:00
  go version:       go1.24.0
  platform:         linux/amd64
  tags:             netgo,builtinassets,stringlabels

Prometheus configuration file

Alertmanager version


Alertmanager configuration file

Logs


Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions