Skip to content

Add e2e to ensure TRLP metrics are exposed through Limitador #1515

@Patryk-Stefanski

Description

@Patryk-Stefanski

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 and limited_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
No labels

Type

No type

Projects

Status

In Review

Status

Ready For Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions