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

Support custom queries #1528

Merged
merged 9 commits into from
May 14, 2018
Merged

Support custom queries #1528

merged 9 commits into from
May 14, 2018

Conversation

ofek
Copy link
Contributor

@ofek ofek commented May 10, 2018

Motivation

Customer requests

@ofek ofek added this to the 6.3 milestone May 10, 2018
Copy link
Contributor

@zippolyte zippolyte left a comment

Choose a reason for hiding this comment

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

Really nice work !

break

# Only submit metrics if there were absolutely no errors - all or nothing.
else:
Copy link
Contributor

Choose a reason for hiding this comment

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

I did not know about the else after a for loop. Pretty cool !

# custom_queries:
# - metric_prefix: oracle.custom_query
# query: | # Use the pipe if you require a multi-line script.
# SELECT colums
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: columns

for custom_query in custom_queries:
metric_prefix = custom_query.get('metric_prefix')
if not metric_prefix:
self.log.error('custom query field `metric_prefix` is required')
Copy link
Contributor

Choose a reason for hiding this comment

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

For all the error messages, can we find a way to identify to which query and/or column they refer to ? This would be easier to debug a config when there are several queries/columns. I'm thinking we could print the index of the query/column. What do you think ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks!

.travis.yml Outdated
@@ -68,7 +68,7 @@ env:
- TRAVIS_FLAVOR=mongo FLAVOR_VERSION=3.4
- TRAVIS_FLAVOR=mongo FLAVOR_VERSION=3.5
- TRAVIS_FLAVOR=openstack
# - TRAVIS_FLAVOR=oracle FLAVOR_VERSION=latest
- TRAVIS_FLAVOR=oracle FLAVOR_VERSION=latest
Copy link
Contributor

Choose a reason for hiding this comment

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

Testing is currently broken for oracle until I'm done with my work on it. No need to reenable the travis flavor.

@@ -3,6 +3,7 @@
# Licensed under Simplified BSD License (see LICENSE)

# stdlib
from contextlib import closing
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@zippolyte zippolyte left a comment

Choose a reason for hiding this comment

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

👌

@ofek ofek merged commit 6366491 into master May 14, 2018
@ofek ofek deleted the ofek/oracle branch May 14, 2018 19:42
@zippolyte zippolyte changed the title [oracle] support custom queries Support custom queries May 23, 2018
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.

2 participants