-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Kuadrant/testsuite
#773Description
Description
Create end-to-end tests in Kuadrant/testsuite to verify that token usage metrics are exposed via Limitador, with labels provided by the TelemetryPolicy
. These tests confirm that metrics are emitted, accumulate as requests are made, and are separated by user/group labels.
Test Cases
Tests based on: #1460 / https://issues.redhat.com/browse/CONNLINK-484
- Metric existence and accumulation
Send requests as the same user/group on the same route/gateway.
→ Expect:authorized_hits
metric is present with the expected labels (user, group)
→ Expect:authorized_hits
metric increases with requests and remains within the range of total tokens consumed (token values will vary slightly due to timing of Prometheus scrapes, hence why exact matching is not asserted)
Example of authorized_hits
metric output:
authorized_hits{group="free",user="freeuser2",limitador_namespace="llm/llm-sim"} 100
- Separation by user/group
Send requests as both free and paid users/groups.
→ Expect:authorized_hits
,authorized_calls
andlimited_calls
metrics are reported separately for each user/group label
Note: The above are subject to change as development progresses.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
In Review
Status
Ready For Review