[ 
https://issues.apache.org/jira/browse/SOLR-17276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17870660#comment-17870660
 ] 

ASF subversion and git services commented on SOLR-17276:
--------------------------------------------------------

Commit 5fc16da9089eafc5e635d1f94de4317a4ad3ae38 in solr's branch 
refs/heads/branch_9x from Rafał Harabień
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=5fc16da9089 ]

SOLR-17276: Prometheus Exporter: scrape metrics at fixed rate (#2442)

(cherry picked from commit 759b94fcae81ef00ed245142c0ef513814930ab4)


> Use fixed rate instead of fixed delay in prometheus-exporter
> ------------------------------------------------------------
>
>                 Key: SOLR-17276
>                 URL: https://issues.apache.org/jira/browse/SOLR-17276
>             Project: Solr
>          Issue Type: Improvement
>          Components: contrib - prometheus-exporter
>            Reporter: Rafał Harabień
>            Priority: Minor
>              Labels: pull-request-available
>         Attachments: image-2024-05-06-18-10-30-739.png
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Prometheus-exporter is supposed to read metrics from Solr servers every 60 
> seconds (scrape interval can be changed using --scrape-interval argument). 
> But the truth is it does it every 60+X seconds where X is the time needed to 
> read metrics from all Solr servers. In my case X is 1-2 s. If Prometheus 
> scrapes the exporter every 60 seconds it can lead to duplicated samples (e.g. 
> metrics will stay the same for 2 minutes).
> !image-2024-05-06-18-10-30-739.png!
> It's result of using 
> [scheduler.scheduleWithFixedDelay|https://github.com/apache/solr/blob/2bb2ada0a372f4d101b78df8d43e0fc44c8edbf3/solr/prometheus-exporter/src/java/org/apache/solr/prometheus/collector/SchedulerMetricsCollector.java#L77]
>  instead of 
> scheduler.scheduleAtFixedRate.
> Note: function scheduled with scheduleAtFixedRate can still be started late 
> if previous execution has not finished. There is no risk of overlapping 
> executions.
> I am going to prepare a PR.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to