-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Support custom queries #1528
Conversation
There was a problem hiding this 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: |
There was a problem hiding this comment.
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 !
oracle/conf.yaml.example
Outdated
# custom_queries: | ||
# - metric_prefix: oracle.custom_query | ||
# query: | # Use the pipe if you require a multi-line script. | ||
# SELECT colums |
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
Motivation
Customer requests