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

Full LogQL not yet supported? #985

Closed
TomGranot opened this issue Sep 9, 2019 · 19 comments
Closed

Full LogQL not yet supported? #985

TomGranot opened this issue Sep 9, 2019 · 19 comments

Comments

@TomGranot
Copy link

If I'm looking at https://github.com/grafana/loki/blob/master/docs/querying.md#range-vector-aggregation, it seems that there's already an option for queried of the form count_over_time({level="ERROR"}[5m]) to be evaluated properly.

However, I'm running Grafana 6.3.2 and I keep getting this message:

image

If I'm not mistaken, this is because the option for range vector aggregation was only added to master 5 days ago (in #654), and the latest version is 6.3.5 that was release 7 days ago, right?

Or is there capability to do the above query in 6.3.5 already?

@slim-bean
Copy link
Collaborator

The newest loql capabilities are still experimental and are won't be available in Grafana until 6.4

We hope to have logcli updated soon as soon as we finish some API details

Please note, the current API is going to change!

@TomGranot
Copy link
Author

OK, will wait for 6.4. Thanks!

@Horkyze
Copy link
Contributor

Horkyze commented Oct 10, 2019

I am experiencing the same issue on Grafana 6.4.2 and Loki from docker hub

image

What is the current status of this issue? Should it be working?

@cyriltovena
Copy link
Contributor

No this is not available yet in Grafana, @davkal do we have an issue on Grafana side ?

Also I notice the path Grafana is using currently is wrong it should be https://github.com/grafana/loki/blob/master/docs/api.md#get-lokiapiv1query_range

If you still want to use this you can @Horkyze , you can use Loki as a Prometheus datasource, although you won't have label and label value completion it will still works in dashboard and explore.

When adding Loki as a Prometheus datasource use this URL path: http://loki-dns:port/loki

here is some example

Using Explore

image

Using a dashboard

image

Basically Loki is 100% compatible with the Prometheus API for those queries :)

@Horkyze
Copy link
Contributor

Horkyze commented Oct 10, 2019

Thanks for quick reply.

Could you provide you datasource config please?
Because I cant get it to work.. :/

curl https://loki.<oursite>.net/loki/api/v1/query?query=1%2B1&time=1570721681.814
return 404 from our proxy..

@cyriltovena
Copy link
Contributor

I'm guessing you're on Loki 0.3, you need at least this commit 364b5bc which will be in the soon to be released 0.4

@cyriltovena
Copy link
Contributor

@Horkyze
Copy link
Contributor

Horkyze commented Oct 11, 2019

Thanks, it is working now :) However with some small issue (which I resolved) grafana/grafana#19764

@davkal
Copy link
Contributor

davkal commented Oct 11, 2019

The grafana team is working on this for 6.5. Sorry for the delay.

@cwrau
Copy link

cwrau commented Jan 20, 2020

This doesn't seem to work in 6.5, am I correct?

Can we maybe reopen this issue, if that is the case?

@cyriltovena
Copy link
Contributor

It should work.

@cwrau
Copy link

cwrau commented Jan 20, 2020

I'm using Grafana 6.5.3 and Loki 1.2.0.

When I try to query Loki, I get the following error message: legacy endpoints only support streams result type, current type is matrix

image

Maybe I'm doing something wrong?

@cyriltovena
Copy link
Contributor

cyriltovena commented Jan 20, 2020 via email

@cwrau
Copy link

cwrau commented Jan 21, 2020

Explore fails with the the same error:

image

When I add loki as a Prometheus it works, but I think that is suboptimal

@cyriltovena
Copy link
Contributor

@ivanahuckova which Grafana version has native metrics support for Loki ?

@cwrau the thread above explain how to use loki as a prometheus data source in the meantime.

@cwrau
Copy link

cwrau commented Jan 21, 2020

I just tried 6.6.0-beta1 for #20300, and this works as well.

The only thing that's missing is the legend format that's available for Prometheus and alerting 😞

So even in 6.6.0-beta1 I'll need Loki as a Prometheus datasource, at least for alerting

@cyriltovena
Copy link
Contributor

Yeah for alerting it will take time also, we use Loki as prom data source internally and it does the job.

@raffraffraff
Copy link

raffraffraff commented Aug 6, 2020

I've just installed from scratch on a new cluster using Helm. The missing legend format is a major issue and makes it Loki as a dashboard graphing tool useless to me, unless I have one series per panel, turn off legends and tooltips and use a sensible panel name. The default metric names are 300+ characters long, eg:

{app="myappname", container="mycontainer", filename="/var/log/pods/default_myappname-cbbd8fc77-c6df7_852952d6-a6c6-4f24-91ff-dd4e4c76f5e0/myappname/0.log", job="namespace/myappname", namespace="namespace", pod="mypod-cbbd8fc77-c6df7", pod_template_hash="cbbd8fc77", stream="stderr"}

@cyriltovena
Copy link
Contributor

The latest Grafana support this now.

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

No branches or pull requests

7 participants