Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-17276

Use fixed rate instead of fixed delay in prometheus-exporter

    XMLWordPrintableJSON

Details

    Description

      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).

      It's result of using scheduler.scheduleWithFixedDelay 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.

      Attachments

        1. image-2024-05-06-18-10-30-739.png
          76 kB
          Rafał Harabień

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rafalh Rafał Harabień
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h