Skip to content

Commit

Permalink
Add Prometheus support to ratelimiter
Browse files Browse the repository at this point in the history
  • Loading branch information
sgayangi committed Mar 5, 2024
1 parent 3b11097 commit 100184e
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ spec:
automountServiceAccountToken: false
serviceAccountName: {{ .Values.wso2.apk.auth.serviceAccountName }}
containers:
{{if and .Values.wso2.apk.metrics.enabled .Values.wso2.apk.metrics.statsd.enabled }}
- name: statsd
image: {{ .Values.wso2.apk.metrics.statsd.image.repository }}:{{ .Values.wso2.apk.metrics.statsd.image.tag }}
imagePullPolicy: {{ .Values.wso2.apk.metrics.statsd.imagePullPolicy }}
ports:
- name: statsd-metrics
containerPort: 9102
{{ end }}
- name: ratelimiter
image: {{ .Values.wso2.apk.dp.ratelimiter.deployment.image }}
imagePullPolicy: {{ .Values.wso2.apk.dp.ratelimiter.deployment.imagePullPolicy }}
Expand All @@ -52,7 +60,13 @@ spec:
- name: PORT
value: "8090"
- name: USE_STATSD
value: "false"
value: "{{ and .Values.wso2.apk.metrics.enabled .Values.wso2.apk.metrics.statsd.enabled }}"
{{if and .Values.wso2.apk.metrics.enabled .Values.wso2.apk.metrics.statsd.enabled }}
- name: STATSD_HOST
value: "0.0.0.0"
- name: STATSD_PORT
value: "9125"
{{- end}}
- name: LOG_LEVEL
value: "DEBUG"
- name: LIMIT_RESPONSE_HEADERS_ENABLED
Expand Down
12 changes: 12 additions & 0 deletions helm-charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,18 @@ wso2:
enabled: false
# configDSBalHost: 0.0.0.0
# idpDSBalHost: 0.0.0.0
# statsd:
# enabled: true
# image:
# repository: prom/statsd-exporter
# tag: v0.26.0
# imagePullPolicy: IfNotPresent
# resources:
# limits:
# memory: 128Mi
# requests:
# cpu: 0.1
# memory: 64Mi

idp:
enabled: true
Expand Down
13 changes: 13 additions & 0 deletions helm-charts/values.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,19 @@ wso2:
# configDSBalHost: 0.0.0.0
# -- Configure the host for exposing the idp ds ballerina metrics.
# idpDSBalHost: 0.0.0.0
# -- Statsd is required to expose metrics from ratelimiter
# statsd:
# enabled: true
# image:
# repository: prom/statsd-exporter
# tag: v0.26.0
# imagePullPolicy: IfNotPresent
# resources:
# limits:
# memory: 128Mi
# requests:
# cpu: 0.1
# memory: 64Mi

idp:
# -- Enable Non production identity server
Expand Down

0 comments on commit 100184e

Please sign in to comment.