Skip to content

fix(prometheus): bump nginx-lua-prometheus-api7 to 0.20260623 to drop duplicate metrics#13602

Merged
AlinsRan merged 1 commit into
apache:masterfrom
AlinsRan:chore/bump-nginx-lua-prometheus-0.20260623
Jun 24, 2026
Merged

fix(prometheus): bump nginx-lua-prometheus-api7 to 0.20260623 to drop duplicate metrics#13602
AlinsRan merged 1 commit into
apache:masterfrom
AlinsRan:chore/bump-nginx-lua-prometheus-0.20260623

Conversation

@AlinsRan

@AlinsRan AlinsRan commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Description

fixes: #11934

Bump nginx-lua-prometheus-api7 from 0.20250302-1 to 0.20260623-1.

0.20260623 fixes duplicate metric emission caused by a KeyIndex desync (api7/nginx-lua-prometheus#14): when a TTL'd metric expires in the shared dict and is re-added at a new slot while a stale slot lingers in another worker's key index, that worker lists the same series twice — the repeated apisix_http_status{...} lines reported in #11934.

rockspec: https://luarocks.org/nginx-lua-prometheus-api7-0.20260623-1.rockspec

Tests

The fix targets a cross-worker race in prometheus_keys and is verified by the library's own unit tests shipped with this release (testListDeduplicatesStaleSlot, testExpiredReAddNoDuplicate). It is not reproducible through an APISIX integration test, so none is added here.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. dependencies Pull requests that update a dependency file size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jun 24, 2026
@AlinsRan AlinsRan force-pushed the chore/bump-nginx-lua-prometheus-0.20260623 branch from b942dba to 12c155b Compare June 24, 2026 01:04
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jun 24, 2026
@AlinsRan AlinsRan changed the title chore: bump nginx-lua-prometheus-api7 to 0.20260623 fix(prometheus): bump nginx-lua-prometheus-api7 to 0.20260623 to drop duplicate metrics Jun 24, 2026
@AlinsRan AlinsRan force-pushed the chore/bump-nginx-lua-prometheus-0.20260623 branch from 12c155b to d8dc08a Compare June 24, 2026 02:49
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jun 24, 2026
… duplicate metrics

nginx-lua-prometheus-api7 0.20260623 fixes duplicate metric emission caused by
a KeyIndex desync (api7/nginx-lua-prometheus#14): when a TTL'd metric expires
in the shared dict and is re-added at a new slot while a stale slot lingers
before another worker's incremental-sync cursor, that worker lists the same
series twice -- the repeated apisix_http_status{...} lines reported in apache#11934.

The fix is verified by the library's own unit tests
(testListDeduplicatesStaleSlot and testExpiredReAddNoDuplicate in
prometheus_test.lua). The duplicate is a cross-worker race that only arises
from a specific shared-dict sync interleaving and is not reproducible by a
single-worker (or even a naive multi-worker) APISIX integration test -- the
shared-dict sync reconciles the stale slot away in any straightforward
sequence -- so no t/ case is added here.

Fixes apache#11934
@AlinsRan AlinsRan force-pushed the chore/bump-nginx-lua-prometheus-0.20260623 branch from d8dc08a to 7c567c4 Compare June 24, 2026 05:15
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jun 24, 2026
@AlinsRan AlinsRan merged commit 0c41c86 into apache:master Jun 24, 2026
23 checks passed
@AlinsRan AlinsRan deleted the chore/bump-nginx-lua-prometheus-0.20260623 branch June 24, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: apisix report duplicate metrics

4 participants