• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Unleash / unleash / 32375756713
87%
master: 91%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 20 Aug 2026 01:46PM UTC
Jobs 1
Files 1210
Run time 3min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

20 Aug 2026 01:41PM UTC coverage: 87.465% (+0.03%) from 87.433%
32375756713

push

github

web-flow
feat(metrics): instrument the API token caches (v1 + v2)

Before we begin the token cache validation, we **add new metrics** to
make sure changes are on the right direction.

We firstly label `cache = api-token-v1 | api-token-v2 `so the two
versions of tokens are directly comparable.
 
#### What is already measured 
no need to repeat it for API tokens:
the DB_TIME / FUNCTION_TIME - we can use it to check the times of the
lookups

#### What we intend to measure:
- `token_cache_lookup_total `+ `token_cache_lookup_duration_seconds` :
hit ratio and how expensive the scan actually is
- `token_cache_size ` - how many tokens installs really have. Gonna say
a lot of the follow-up design ;)
- `token_cache_refresh_total` - refreshes currently fail into a log line
and nothing else, so a pod that stops refreshing is worth an alert
- `token_cache_alias_hit_total` - we expect/hope to see 0, if so, we
happily drop alias on final phase
- `token_cache_negative_flush_total ` - `/edge/validate` is
unauthenticated and the negative cache clears wholesale at 1000 entries

#### What we have skipped:
- labels per tenants 
- byte counters
- anything for LRU/revalidation - it's not here yet 😇 

Notes:
- moved `this.eventBus` assignment above the constructor's
`fetchActiveTokens() `in v1 - it emits on it now and would've hit
undefined


📩 The most important metric is to validate that every token change
actually writes an event. To add this metric, we need a new index
(already planned to create it in a later phase). So, this part [comes in
another
PR](https://github.com/bricks-software/unleash-enterprise/pull/1544) to
accompany the required changes (and not overdo this one here)

---------

Co-authored-by: irstavr <irstavr@gmail.com>
Co-authored-by: irini.stavrakantonaki <irini.stavrakantonaki@getunleash.io>

3859 of 5019 branches covered (76.89%)

32 of 37 new or added lines in 6 files covered. (86.49%)

3 existing lines in 2 files now uncovered.

15902 of 18181 relevant lines covered (87.46%)

800.99 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
85.83
-2.1% src/lib/features/apitokensv2/api-token-v2-service.ts
1
89.04
-0.27% src/lib/services/api-token-service.ts

Coverage Regressions

Lines Coverage ∆ File
2
89.04
-0.27% src/lib/services/api-token-service.ts
1
85.83
-2.1% src/lib/features/apitokensv2/api-token-v2-service.ts
Jobs
ID Job ID Ran Files Coverage
1 32375756713.1 20 Aug 2026 01:46PM UTC 1210
87.46
GitHub Action Run
Source Files on build 32375756713
  • Tree
  • List 1210
  • Changed 7
  • Source Changed 6
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #32375756713
  • 9b1bcb8a on github
  • Prev Build on main (#32370047287)
  • Next Build on main (#32377185107)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc