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

Add support for timeout offset #647

Merged
merged 5 commits into from Oct 12, 2023

Conversation

mikael-lindstrom
Copy link
Contributor

Allow the MongoDB timeout to be configured relative to the Prometheus scrape timeout. This ensures the Prometheus scrape will get a response even if the exporter cannot connect to MongoDB. Implementation is based on how its done in the blackbox_exporter. This in combination with #624 makes the mongodb_exporter return mongodb_up 0 when it cannot connect to MongoDB.

I have not been able to verify that TestGetEncryptionInfo pass since I cannot get percona/percona-server-mongodb:5.0.13-1 to start on my M1 Mac (regardless if I use docker-compose or start the image directly). All other tests pass.


  • Tests passed.
  • Fix conflicts with target branch.
  • Update jira ticket description if needed.
  • Attach screenshots/console output to confirm new behavior to jira ticket, if applicable.

Once all checks pass and the code is ready for review, please add pmm-review-exporters team as the reviewer. That would assign people from the review team automatically. Report any issues on our Forum or Discord.

Allow the MongoDB timeout to be configured relative to the Prometheus
scrape timeout. This ensures the Prometheus scrape will get a response even
if the exporter cannot connect to MongoDB.
@mikael-lindstrom mikael-lindstrom requested a review from a team as a code owner April 6, 2023 20:06
@mikael-lindstrom mikael-lindstrom requested review from 0leksii and IuriiMr and removed request for a team April 6, 2023 20:06
@it-percona-cla
Copy link

it-percona-cla commented Apr 6, 2023

CLA assistant check
All committers have signed the CLA.

@BupycHuk BupycHuk changed the title Add support for timout offset Add support for timeout offset Oct 10, 2023
@BupycHuk
Copy link
Member

@mikael-lindstrom could you please update your branch?

@mikael-lindstrom
Copy link
Contributor Author

@BupycHuk Updated the branch now 👍

@BupycHuk BupycHuk requested review from ademidoff and JiriCtvrtka and removed request for 0leksii, IuriiMr and ritbl October 10, 2023 09:28
@BupycHuk BupycHuk enabled auto-merge (squash) October 10, 2023 10:07
@JiriCtvrtka
Copy link
Contributor

@mikael-lindstrom Looks good. Could you also add check when TimeoutOffset is 0 or less? And just show error message. Thank you.

auto-merge was automatically disabled October 11, 2023 12:21

Head branch was pushed to by a user without write access

@mikael-lindstrom mikael-lindstrom force-pushed the mongodb-timout-offset branch 2 times, most recently from 854248e to aa7e9f7 Compare October 11, 2023 12:27
@mikael-lindstrom
Copy link
Contributor Author

I resolved the conflicts and added a check for TimeoutOffset being greater than 0. I also changed the name for the flag from mongodb.timeout-offset to web.timeout-offset since it's not directly related to MongoDB and it was a bit confusing with the new mongodb.connect-timeout-ms flag.

I pushed the latest commit 6 hours ago but for some reason this PR shows "Processing updates". Not sure why but the changes are in my branch.

@JiriCtvrtka
Copy link
Contributor

@mikael-lindstrom Could you try to push it once more? Maybe try add just empty commit. Thank you.

@mikael-lindstrom
Copy link
Contributor Author

@JiriCtvrtka Seems to have worked with an empty commit 👍

Copy link
Contributor

@JiriCtvrtka JiriCtvrtka left a comment

Choose a reason for hiding this comment

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

Great job, thank you.

@JiriCtvrtka JiriCtvrtka enabled auto-merge (squash) October 12, 2023 11:25
@JiriCtvrtka JiriCtvrtka merged commit c17b537 into percona:main Oct 12, 2023
6 checks passed
@mikael-lindstrom mikael-lindstrom deleted the mongodb-timout-offset branch October 13, 2023 21:31
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.

None yet

6 participants