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

[mysql] custom query metrics #1673

Closed
wants to merge 4 commits into from
Closed

Conversation

garnermccloud
Copy link
Contributor

Allow metrics to be generated from custom mysql queries.

Added logging, testing to #1274 and rebased.

# Max of 20 queries allowed
if isinstance(queries, list):
for index, check in enumerate(queries):
if index == self.MAX_CUSTOM_QUERIES:
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of checking this condition everytime, maybe we can just trim the list to at most self.MAX_CUSTOM_QUERIES elems before iterating: for index, check in enumerate(queries[:self.MAX_CUSTOM_QUERIES]) The warning can be logged just based on len(queries)

@talwai
Copy link
Contributor

talwai commented Jul 6, 2015

Maybe there should be some notion of a timeout when executing custom queries. We're currently not putting any guards around how complex a query can be, and are at risk of having the agent block for indefinite periods if the query is long-running. I'd suggest we configure a DEFAULT_TIMEOUT and allow it to be overridden in init_config for the mysql check

@talwai
Copy link
Contributor

talwai commented Jul 13, 2015

@garnermccloud any thoughts on the above suggestion?

@garnermccloud
Copy link
Contributor Author

Thanks for the comments @talwai - I'll update and rebase

@talwai talwai self-assigned this Jul 27, 2015
@yannmh
Copy link
Member

yannmh commented Jul 27, 2015

Can you squash your commits @garnermccloud to clean up the git history please ?

@talwai
Copy link
Contributor

talwai commented Jul 28, 2015

Closing in favor of #1793

@talwai talwai closed this Jul 28, 2015
@garnermccloud garnermccloud deleted the garner/custom-mysql-queries branch April 29, 2016 17: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.

3 participants