Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLR-17276 Scrape metrics at fixed rate in prometheus-exporter #2442

Merged
merged 3 commits into from
Aug 3, 2024

Conversation

rafalh
Copy link
Contributor

@rafalh rafalh commented May 6, 2024

https://issues.apache.org/jira/browse/SOLR-17276

Description

Metrics are not scraped by prometheus-exporter at a fixed rate because it uses scheduleWithFixedDelay API to schedule the scraping proces. Duration of scraping influences the actual rate.

Solution

Make sure Solr metrics are scraped at fixed rate by using scheduleAtFixedRate API.
Note: there will be no overlapping executions, because JavaDoc says: "If any execution of this task takes longer than its period, then subsequent executions may start late, but will not concurrently execute.".

Tests

None

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide

Copy link

github-actions bot commented Jul 7, 2024

This PR has had no activity for 60 days and is now labeled as stale. Any new activity or converting it to draft will remove the stale label. To attract more reviewers, please tag people who might be familiar with the code area and/or notify the [email protected] mailing list. Thank you for your contribution!

@github-actions github-actions bot added the stale PR not updated in 60 days label Jul 7, 2024
Copy link
Contributor

@malliaridis malliaridis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not eligable to merge any changes, but it looks good at first sight. I have one request and one question in regards to the change:

  1. Java docs confirm that the execution will not start concurrently. Is it possible to add a test that confirms that (if none are present)?

  2. What happens if the scraping interval is very short and the scraping task takes much longer, and that for a longer period of time? How are the scheduled tasks managed? Would that eventually cause any memory issues over time?

Copy link
Contributor

@dsmiley dsmiley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A one-liner :-D

+1 makes sense to me!

@github-actions github-actions bot removed the stale PR not updated in 60 days label Aug 2, 2024
@dsmiley dsmiley merged commit 759b94f into apache:main Aug 3, 2024
4 checks passed
dsmiley pushed a commit that referenced this pull request Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants