michael-doubez / filestat_exporter

Prometheus exporter gathering metrics about file size, modification time and other stats
Apache License 2.0
50 stars 13 forks source link

it's possible to add a scheduled monitoring feature to activate file monitoring at a specific time. #32

Open ilanni2460 opened 1 year ago

ilanni2460 commented 1 year ago

[NEW Feature] it's possible to add a scheduled monitoring feature to activate file monitoring at a specific time.

michael-doubez commented 1 year ago

No. Prometheus and service discovery are the components that are timing the monitoring

ilanni2460 commented 1 year ago

@michael-doubez Thank you very much for your reply, but I found out whether another exporter that monitors sql statements supports timing to grab data.

This is url : https://github.com/albertodonato/query-exporter

schedule: a schedule for executing queries at specific times. This is expressed as a Cron-like format string (e.g. */5 * * * * to run every five minutes). If a value is specified for schedule, an interval can't be specified. If no value is specified (or specified as null), the query is only executed upon HTTP requests.

I looked at it, and her implementation principle is to capture metrics at a specified time, and the metrics cannot be captured at a non-specified time.

michael-doubez commented 9 months ago

Actually, it makes sense in case of a slow NFS by example.

michael-doubez commented 4 months ago

I've added the tree feature in #42 . I am planinng on adding a url parameter to metrics collection such that different tree (root) can be polled at different speed.

That way, one can poll /slow/ filesystems with an interval of ~4minutes (with a bigger timeout) while polling other more often. This is not really what you asked for but keeping cache of metrics is a snake pit.

It you really need to take snapshots, I could add a feature for exporting metrics to a pushgateway.

ilanni2460 commented 4 months ago

@michael-doubez Very good, I have been paying attention to this feature

michael-doubez commented 1 week ago

Sorry for the delay.

Prometheus client is not friendly with url parameters - it will take time