-
Notifications
You must be signed in to change notification settings - Fork 85
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
Pull request for influxdb #482
Conversation
Tests FAILURE for HEAD 27fda5e
|
Pull-request updated, HEAD is now 0d8f2b7 |
Tests FAILURE for HEAD 0d8f2b7
|
Pull-request updated, HEAD is now 4f5e4d7 |
Tests FAILURE for HEAD 4f5e4d7
|
Pull-request updated, HEAD is now ad617be |
Tests FAILURE for HEAD ad617be
|
Pull-request updated, HEAD is now 790ff33 |
Tests FAILURE for HEAD 790ff33
|
Pull-request updated, HEAD is now 1c6405f |
Tests FAILURE for HEAD 1c6405f
|
Pull-request updated, HEAD is now 31a2b7b |
Tests SUCCESS for HEAD 31a2b7b
|
gnocchi/rest/influxdb.py
Outdated
@staticmethod | ||
@tenacity.retry(retry=tenacity.retry_if_exception_type( | ||
(indexer.NoSuchResource, indexer.NamedMetricAlreadyExists))) | ||
def get_or_create_resource_and_metrics(resource_type, creator, rid, |
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.
Maybe we can share it with the one in Prometheus
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.
Yeah I can try to do that now that Prometheus is merged.
@@ -49,6 +49,20 @@ def setUp(self): | |||
self.index = indexer.get_driver(self.conf) | |||
self.index.upgrade(nocreate=True) | |||
self.addCleanup(self._drop_database) | |||
# NOTE(sileht): remove tables dynamically created by other tests |
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.
That may need to be rebased, mine have been merged.
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.
ack
Pull-request updated, HEAD is now 53989ae |
Tests ERROR for HEAD 53989ae
|
Pull-request updated, HEAD is now 439d1d3 |
1 similar comment
Pull-request updated, HEAD is now 439d1d3 |
Tests SUCCESS for HEAD 439d1d3
|
Pull-request updated, HEAD is now aa33aee |
@@ -2055,6 +2057,7 @@ def __init__(self): | |||
"capabilities": CapabilityController(), | |||
"status": StatusController(), | |||
"aggregates": agg_api.AggregatesController(), | |||
"influxdb": influxdb.InfluxDBController(), |
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.
can we enable this on demand?
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.
Probably, though we don't do that for Prometheus either. So what would be the usecase?
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.
we do, it's only enabled if the right libs are there although we can't do the same here... i just don't want to load it unless explicit.
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.
gnocchi/rest/influxdb.py
Outdated
except pyparsing.ParseException: | ||
api.abort(501, {"cause": "Not implemented error", | ||
"detail": "q", | ||
"reason": "Querying is not implemented"}) |
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.
this error is confusing... i don't see how 'querying is not implemented', this is literally what the endpoint is. is it something 'unsupported' that will throw this?
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.
We don't support InfluxDB query language. I changed to "query not implemented" to be more precise about the fact that this query is not implemented.
The only supported is CREATE DATABASE
that's not what I'd call a query ;)
def _write_get_lines(): | ||
encoding = pecan.request.headers.get('Transfer-Encoding', "").lower() | ||
if encoding == "chunked": | ||
if uwsgi is None: |
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.
how usable is this without chunked? if it isn't, i don't think we should support this especially since we're checking this constantly.
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.
it's completely usable without chunked encoding. That's what the tests do.
But real InfluxDB client sends chunked encoding.
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.
so unchunked is only for tests?
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.
In real life, really likely, until someone starts to talk InfluxDB to Gnocchi in regular encoding (but I don't think InfluxDB does that?)
gnocchi/rest/influxdb.py
Outdated
# If this function raises ResourceAlreadyExists it means | ||
# the resource might already exist as another type, we | ||
# can't continue. | ||
LOG.error("Unable to get resource `%s' for InfluxDB, " |
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/get/create/
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.
fixed
$.creator: admin | ||
|
||
- name: check metric created | ||
GET: /v1/resource/influxdbtest/foobar/metric/mymetric.field@mytag=myvalue |
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.
this should assert something.
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.
it does, it asserts there's no error being returned (i.e. no 404).
it does not check any content since it's not the purpose of this test. It's not testing the format, it's testing the metric creation.
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.
word. didn't realise gabbi would auto fail for these cases. i'd prefer it be explicit and we validate more than just 'it didn't explode' but your call.
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.
yeah it's always a trade-off: asserting 200
for example would break if we ever change the code to be 202
for example, whereas here we don't really care.
Though I agree in this case there's 0% chance we ever change from 200 :)
$.creator: admin | ||
|
||
- name: check metric created different tag resource id | ||
GET: /v1/resource/influxdbtest/myvalue/metric/mymetric.field@host=foobar |
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.
assert something
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.
ditto
GET: /v1/resource/influxdbtest/myvalue/metric/mymetric.field@host=foobar | ||
|
||
- name: check metric created different tag resource id and slash replaced | ||
GET: /v1/resource/influxdbtest/myvalue/metric/cpu.field@path=_foobar |
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.
assert something
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.
ditto
Tests SUCCESS for HEAD aa33aee
|
Pull-request updated, HEAD is now 8b0b52f |
Tests FAILURE for HEAD 8b0b52f
|
Fix test after 'Query' word change |
Tests FAILURE for HEAD 17ff947
|
Using --http enables the HTTP router – which is not used here. That router prevents the chunked tranfer encoding to work.
…lass This is going to be used by other code.
This timeout is going to be used as a more general timeout for operations that the API needs to do and that block for a long time.
This provides a new InfluxDB-compatible endpoint to write data to Gnocchi at `/v1/influxdb'.
Pull-request updated, HEAD is now b4264ae |
Tests SUCCESS for HEAD b4264ae
|
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.
You finally not sharing get_or_create_resource_and_metrics() with prometheus ?
@sileht of course it is shared. did I miss something? |
@jd, no it's OK I have misread |
api: add an InfluxDB API endpoint
api: rename refresh_timeout option to operation_timeout
cli: use --http-socket rather than --http for uwsgi