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

OpenTSDB datasource targets added #27

Merged
merged 1 commit into from
Mar 29, 2017
Merged

OpenTSDB datasource targets added #27

merged 1 commit into from
Mar 29, 2017

Conversation

dmajere
Copy link
Contributor

@dmajere dmajere commented Mar 28, 2017

Opentsdb targets are different from Prometheus, here are classes for Opentsdb datasource.

Copy link
Contributor

@jml jml left a 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.


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.


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.

def to_json_data(self):
return {
'filter': self.value,
'tagk': self.tag,

This comment was marked as abuse.

This comment was marked as abuse.


@attr.s
class OpenTSDBTarget(object):
"""Generates OpenTSDB target json structure.

This comment was marked as abuse.

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.

@@ -0,0 +1,156 @@
import attr

This comment was marked as abuse.

@dmajere
Copy link
Contributor Author

dmajere commented Mar 29, 2017

Fixed misspells

@jml jml merged commit 2212c3b into weaveworks:master Mar 29, 2017
@dmajere dmajere deleted the opentsdb branch April 10, 2017 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants