Git Product home page Git Product logo

Comments (7)

udoprog avatar udoprog commented on May 28, 2024

Hey,

The command you paster is malformed. -X expects the method as a parameter, like -X POST. In fact, it can be omitted because it's implied with -d.

What happens here is -X -H, and the method effectively becomes -H (I think).

from heroic.

dakoos avatar dakoos commented on May 28, 2024

I tried the following:
curl -X POST -H "Content-Type: application/json" http://localhost:8080/query/metrics
-d '{"range": {"type": "relative", "string": "MONTHS", }, "filter": ["and", ["key", "foo"], ["=", "foo", "bar"], ["+", "role"]], "groupBy": ["site"], "aggregation": []}'

Now the error message is:

{"message":"Unexpected character ('}' (code 125)): was expecting double-quote to start field name\n at [Source: org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream@5fd19f15; line: 1, column: 53]","reason":"Bad Request","status":400,"path":"range","type":"son-error"}

The JSON looks to be valid. Also, the first request is having the same error even I specify '-X POST'.

from heroic.

dakoos avatar dakoos commented on May 28, 2024

Actually, the curl request I sent above was slightly malformed:

curl -X POST -H "Content-Type: application/json" http://localhost:8080/query/metrics \
-d '{"range": {"type": "relative", "string": "MONTHS" }, "filter": ["and", ["key", "foo"], ["=", "foo", "bar"], ["+", "role"]], "groupBy": ["site"], "aggregation": []}'

Now, there are no longer any JSON errors. But I am still receiving a Heroic error:

{"message":"Unrecognized field \"string\" (class com.spotify.heroic.QueryDateRange$Relative), not marked as ignorable","reason":"Bad Request","status":400,"path":"range.string","type":"json-error"}

from heroic.

dakoos avatar dakoos commented on May 28, 2024

Also, I have been trying to play with the query and I have created:

curl -H "Content-Type: application/json" http://localhost:8080/write \
   -d '{"series": {"key": "foo", "tags": {"site": "lon", "host": "www.example.com"}}, "data": {"type": "points", "data": [[1466560275000, 42.0]]}}'
{"errors":[],"times":[9555074]}
curl -H "Content-Type: application/json" http://localhost:8080/query/metrics   -d '{"range": {"type": "relative", "unit": "DAYS", "value":100}, "filter": ["key", "foo"], "groupBy": ["site"], "aggregators": []}'
{"range":{"start":1457922165961,"end":1466562165961},"trace":{"what":{"name":"com.spotify.heroic.CoreQueryManager#query"},"elapsed":75,"children":[{"what":{"name":"com.spotify.heroic.cluster.LocalClusterNode#query"},"elapsed":6,"children":[{"what":{"name":"com.spotify.heroic.metric.LocalMetricManager#query"},"elapsed":79,"children":[]}]}]},"limits":[],"commonTags":{},"result":[],"errors":[]}

In such a situation, the newly inserted record should fall within the query. However, results is being set to empty.

from heroic.

dakoos avatar dakoos commented on May 28, 2024

I was able to resolve the issue by installing ElasticSearch 1.7 (not 2.x which should also be mentioned in the docs) for the above query. However, could you explain what went wrong with the initial set of queries.

Also, the documentation is outdated as far as the API goes in https://spotify.github.io/heroic/#!/docs/api.

For example:

curl -H "Content-Type: application/json" http://localhost:8080/write \
   -d '{"series": {"key": "foo", "tags": {"site": "lon", "host": "www.example.com"}}, "data": {"type": "points", "data": [[1466560275000, 42.0]]}}'
{"errors":[],"times":[15603449,1383935,1389086,1393517,1408274]}

The API doc mentions that the response of "ok": true should be returned back but we are getting back two fields back.

from heroic.

udoprog avatar udoprog commented on May 28, 2024

I've updated some of the comments to make them easier to read.

Supported Elasticsearch versions are mentioned in the README, 2.0 support is tracked by #50.

I'll add a task to look over the API documentation more closely.

from heroic.

hexedpackets avatar hexedpackets commented on May 28, 2024

Closing due to age, feel free to re-open if this is still an issue.

from heroic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.