scaphandre
scaphandre copied to clipboard
How to reduce the sampling rate with Kubernetes for Serverless?
Problem
Hello everyone,
I have worked with Serverless platforms on top of Kubernetes. More specifically, OpenWhisk. There I execute small functions with fast execution - at most 5 minutes, but about 1 minute in general. I want to extract their energy metrics with Scaphandre, and I was able to deploy it correctly (Prometheus, Grafana, and Scaphandre), but it seems that the sampling rate by default is 15s. I want to reduce it to 5s or even 1s. Can you help me, please?
Thank you very much!
Hi @andersonandrei this is a cool use case.
At the moment we set annotations on the scaphandre service so Prometheus will scrape it but I don't believe its possible to change the scrape interval via annotations.
https://github.com/hubblo-org/scaphandre/blob/5c8d63c09c1f2e6a934adef469d0bc7a06e694ea/helm/scaphandre/templates/service.yaml#L7-L10
The change proposed by @mmadoo in https://github.com/hubblo-org/scaphandre/pull/230 to add a Service Monitor would make the scrape interval configurable via the Helm chart and allow you to do this.
Hi !
@andersonandrei #230 has been merged in dev. Would you give a try to the chart currently in dev and tell us if it answers your needs or not ? Thanks !