-
Notifications
You must be signed in to change notification settings - Fork 318
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
OpenTSDB datasource targets added #27
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.
Thanks, this is great! A few minor nits & I'll be happy to merge. Please also add a changelog entry.
grafanalib/opentsdb.py
Outdated
|
||
def valid_opentsdb_downsample_fill_policy(instance, attribute, value): | ||
if value not in OTSDB_DOWNSAMPLING_FILL_POLICIES: | ||
raise ValueError("{attr} shuld be one of {choice}".format( |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
grafanalib/opentsdb.py
Outdated
|
||
def valid_opentsdb_filter(instance, attribute, value): | ||
if value not in OTSDB_QUERY_FILTERS: | ||
raise ValueError("{attr} shuld be one of {choice}".format( |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
def to_json_data(self): | ||
return { | ||
'filter': self.value, | ||
'tagk': self.tag, |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
grafanalib/opentsdb.py
Outdated
|
||
@attr.s | ||
class OpenTSDBTarget(object): | ||
"""Generates OpenTSDB target json structure. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
grafanalib/opentsdb.py
Outdated
OTSDB_DOWNSAMPLING_FILL_POLICY_DEFAULT = 'none' | ||
|
||
OTSDB_QUERY_FILTERS = ( | ||
'literal_or', 'ilteral_or', 'not_literal_or', |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
@@ -0,0 +1,156 @@ | |||
import attr |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Fixed misspells |
Opentsdb targets are different from Prometheus, here are classes for Opentsdb datasource.