-
Notifications
You must be signed in to change notification settings - Fork 43
Overhaul and update InfluxDB engine #60
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
Conversation
Remind me on the weekend to take care of this… 👴 |
@pyroscope ping |
|
||
# Push it! | ||
try: | ||
# TODO: Use a session | ||
requests.post(fluxurl, data=fluxjson, timeout=self.influxdb.timeout) | ||
r = requests.post(fluxurl, data=datastr, timeout=self.influxdb.timeout) |
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.
Please use response
or resp
(no single-letter vars outside of comprehensions).
self.config.series_prefix, hostname, pid, view_name) | ||
vstr += ','.join(['='.join([k, str(v)]) for k, v in values.items()]) | ||
datastr += vstr + "\n" | ||
except (error.LoggableError, xmlrpc.ERRORS), exc: |
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.
… as exc: (other places, too)
@@ -97,63 +71,61 @@ def __init__(self, config=None): | |||
def _influxdb_url(self): | |||
""" Return REST API URL to access time series. | |||
""" | |||
url = "{0}/db/{1}/series".format(self.influxdb.url.rstrip('/'), self.config.dbname) | |||
url = "{0}/write?db={1}".format(self.influxdb.url.rstrip('/'), self.config.dbname) | |||
|
|||
if self.influxdb.user and self.influxdb.password: | |||
url += "?u={0}&p={1}".format(self.influxdb.user, self.influxdb.password) |
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.
s/?/&/
I no longer use influxdb, this has been replaced by #77 |
Screwed up the previous PR by force pushing and Github isn't letting me re-open it.