-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable per limit metrics #113
Conversation
2576c01
to
ed2b271
Compare
Codecov Report
@@ Coverage Diff @@
## main #113 +/- ##
==========================================
- Coverage 68.80% 68.59% -0.21%
==========================================
Files 14 14
Lines 984 987 +3
==========================================
Hits 677 677
- Misses 267 269 +2
- Partials 40 41 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
faf1456
to
859fee3
Compare
ced91de
to
e49127f
Compare
Verification Steps ✔️dev setup
Deploy the limitador CR without k apply -f - <<EOF
---
apiVersion: limitador.kuadrant.io/v1alpha1
kind: Limitador
metadata:
name: limitador-sample
spec:
limits:
- conditions: ["get_toy == 'yes'"]
max_value: 2
namespace: toystore-app
seconds: 30
variables: []
name: "toy_get_route"
EOF Check deployment is correct
Should return
Check command line
should look like this - limitador-server
- /home/limitador/etc/limitador-config.yaml
- memory Let's add the k apply -f - <<EOF
---
apiVersion: limitador.kuadrant.io/v1alpha1
kind: Limitador
metadata:
name: limitador-sample
spec:
telemetry: exhaustive
limits:
- conditions: ["get_toy == 'yes'"]
max_value: 2
namespace: toystore-app
seconds: 30
variables: []
name: "toy_get_route"
EOF Check command line
should look like this - limitador-server
- --limit-name-in-labels
- /home/limitador/etc/limitador-config.yaml
- memory Whether that new command line arg |
@@ -76,6 +76,9 @@ type LimitadorSpec struct { | |||
// +optional | |||
RateLimitHeaders *RateLimitHeadersType `json:"rateLimitHeaders,omitempty"` | |||
|
|||
// +optional | |||
Telemetry *Telemetry `json:"telemetry,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Telemetry
is maybe too generic name, not very meaningful for the very specific task that is doing: "adding limit names as label in the metrics". Or you are planning to add more command line args like --limit-name-in-labels
when the value of the telemtry is exhaustive
??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or you are planning to add more command line args like --limit-name-in-labels when the value of the telemtry is exhaustive??
Yes, or… let's say I did want that to be generic to not tie it to any implementation, as we'll probably iterate over this. Hence the enum as well, so we can add values. e.g. to support better tracing
Code wise it is correct |
e49127f
to
5645e70
Compare
Rebased and ready for merge/releasing |
This builds on the changes in #112 - which lets a
RateLimit
have a name.Add the
telemetry
field to theLimitadorSpec
, which currently has two valid options:basic
(what it's been so far) andexhaustive
, which will result in starting the Limitador server process with the--limit-name-in-labels
option, resulting in the two metrics,limited_calls
&authorized_calls
, to include the limit's name field as label - providing better metrics about whatLimit
is limiting or allow traffic through.