Skip to content

PMM-15160 Feature build for QAN sparkline fix - #4540

Draft
theTibi wants to merge 1 commit into
v3from
PMM-15160-fix-qan-sparklines-divide-by-zero
Draft

PMM-15160 Feature build for QAN sparkline fix#4540
theTibi wants to merge 1 commit into
v3from
PMM-15160-fix-qan-sparklines-divide-by-zero

Conversation

@theTibi

@theTibi theTibi commented Aug 23, 2026

Copy link
Copy Markdown

Feature build for PMM-15160https://perconadev.atlassian.net/browse/PMM-15160

Builds PMM Server and Client from the percona/pmm branch that stops qan-api2 panicking with an integer divide by zero when a QAN report's time range collapses into a single minute.

Component PRs

ci.yml

deps:
  - name: pmm
    branch: PMM-15160-fix-qan-sparklines-divide-by-zero
    url: https://github.com/percona/pmm

Single repo — the change is confined to qan-api2/. No grafana-fork, exporter or pmm-qa branch is involved.

What to check in the built image

Server-side only; no client involvement. Against a PMM with some QAN data:

  1. The panic is gone. Open QAN and drag the smallest possible time selection (start and end inside the same minute), or call the API directly:
    POST /v1/qan/metrics:getReport
    {"period_start_from":"<T>:44:10Z","period_start_to":"<T>:44:50Z","group_by":"queryid","columns":["load"],"order_by":"-load","limit":10}
    
    Expect 200 with a one-point sparkline (time_frame: 60). Before this change it was 500 {"code":13,"message":"Internal server error."} plus a stack in /srv/logs/qan-api2.log:
    docker exec -it pmm-server grep -c "divide by zero" /srv/logs/qan-api2.log   # expect 0
    
  2. The same on the second panic path, which the ticket does not mention — POST /v1/qan:getMetrics with the same range.
  3. No non-finite numbers in the response. With period_start_from == period_start_to, getReport, getMetrics and getFilters must contain no "Infinity" or "NaN" in any float field. getFilters previously returned 24 of each; the generated API clients cannot decode either.
  4. Reversed ranges are rejected consistently. from > to on getReport, getMetrics (including totals: true) and getFilters must return 400 InvalidArgument, not 500 and not a fabricated data point.
  5. Nothing else moved. Normal ranges must be unchanged — verified locally as byte-identical responses across 12 requests (3 RPCs × 1h / 1d / 30d / exactly-2h) between the base and fixed binaries.

Draft, per the FB convention — to be closed once the component PR merges.

Build PMM server and client from the percona/pmm branch that stops
qan-api2 panicking with an integer divide by zero when a QAN report's
time range collapses into a single minute.

Component PR: percona/pmm#5824

Signed-off-by: theTibi <tkorocz@gmail.com>
@JNKPercona

Copy link
Copy Markdown
Collaborator

@JNKPercona

Copy link
Copy Markdown
Collaborator

API tests have succeded: https://pmm.cd.percona.com/job/pmm3-api-tests/7123/

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.

2 participants