scaphandre icon indicating copy to clipboard operation
scaphandre copied to clipboard

How to reduce the sampling rate with Kubernetes for Serverless?

Open andersonandrei opened this issue 2 years ago • 2 comments

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!

andersonandrei avatar Jan 16 '23 10:01 andersonandrei

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.

rossf7 avatar Feb 02 '23 09:02 rossf7

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 !

bpetit avatar May 18 '23 16:05 bpetit