GoshPosh / grafana-meta-queries

Grafana plugin for calculating time period metrics like week over week, month over month and year over year etc.
Apache License 2.0
284 stars 71 forks source link

MetaQuery breaks in latest version of Grafana #82

Closed yuvarajhere closed 4 years ago

yuvarajhere commented 5 years ago

From version 6.4.2, the metaquery plugin breaks and doesn't return any value. The reason might be the Grafana recent version is using a different data format and it breaks the plugin.

I have tested with "Arithemetic" type and not sure about the other types.

Error Message: Screen Shot 2019-10-17 at 10 08 15 AM

codemoos commented 5 years ago

Can confirm that something with metaqueries and grafana is not working as it used to. I use metaqueries to retrieve data from the source, but plotting in grafana returns undefined error.

gailmichi commented 5 years ago

Same problem here. I don't even get an error message. My browser hangs up if i try to use metaqueries. (Grafana 6.4.3 on Ubuntu Server)

tonymadbrain commented 5 years ago

We also have error after upgrade to 6.4. Plugin works great with data from Elasticsearch, but error appears when datasource is Prometheus Screenshot 2019-10-24 at 12 42 28

bhozar commented 5 years ago

Grafana 6.5.0-beta1 is showing similar behavior. I receive an error message when using it with multiple Azure Application Insight data sources which were previously working in 6.4.x

Each query and panel displays:

Metric request error

Gauravshah commented 5 years ago

@tonymadbrain It should generally work with any datasource , can you help with 1 metric and 1 meta query on top of just trying to print the same value ?

Gauravshah commented 5 years ago

@bhozar can you add stack trace and dashboard config ?

bhozar commented 5 years ago

image

^ You mean this bit of the config? Where can I find the stack trace?

bhozar commented 5 years ago

Found it:

error="{\"error\":{\"message\":\"The request had some invalid properties\",\"code\":\"BadArgumentError\",\"details\":[{\"code\":\"BadArgumentError\",\"target\":\"granularity\",\"message\":\"Failed parsing 'PTPTMM' as ISO8601 duration\"}],\"innererror\":{\"code\":\"QueryValidationError\",\"message\":\"Failed parsing the query\"}}}"

Looks like it works if I set the time grain to something else: image

Gauravshah commented 5 years ago

@bhozar thats the error, can you send trace. It should be part of browser console

bhozar commented 5 years ago

Unfortunately I cannot replicate it now. Changing the Time Grain and changing it back seems to have fixed it. If it happens again I'll grab the browser console trace.

siegmund42 commented 5 years ago

For me there isn't even an error. It does not even display any data when selecting metaQueries data source ("No data"). Selecting prometheus data source in the panel works fine for the shown query. Browser console looks clean. grafik

Query inspector returns valid data:

  xhrStatus:"complete"
  request:Object
    method:"GET"
    url:"api/datasources/proxy/1/api/v1/query_range?query=up&start=1574116920&end=1574289720&step=120"
  response:Object
    status:"success"
    data:Object
      resultType:"matrix"
      result:Array[8]

Any idea how to debug this?

Grafana v6.4.4 (commit: 092e514) Promethes version: 2.14.0

tonymadbrain commented 4 years ago

@tonymadbrain It should generally work with any datasource , can you help with 1 metric and 1 meta query on top of just trying to print the same value ?

my metric: Screenshot 2019-12-05 at 13 19 12

when added metaquery with timeshift by default: Screenshot 2019-12-05 at 13 19 55

when changed timeshift to arithmetic, just no data: Screenshot 2019-12-05 at 13 20 58

Gauravshah commented 4 years ago

@tonymadbrain Query -- MIXED -- is incorrect. It should be Query -- Meta Queries --

tonymadbrain commented 4 years ago

@tonymadbrain Query -- MIXED -- is incorrect. It should be Query -- Meta Queries --

If I choose Meta Queries there is no data at all: Screenshot 2019-12-07 at 21 13 51

Also no errors in console

Gauravshah commented 4 years ago

@tonymadbrain I am unsure why prometheus would not work

siegmund42 commented 4 years ago

@Gauravshah Can we somehow support debugging this? Although #84 is now fixed, this still makes MetaQuery unusable for prometheus users. (Problem persists with Grafana 6.5.2)

Gauravshah commented 4 years ago

@tonymadbrain @siegmund42 I can take a look at prometheus after 2 weeks. I do not know Prometheus so if you can add a link that can give prometheus test machine with sample data that would be helpful.

siegmund42 commented 4 years ago

@Gauravshah You might want to use this Prometheus demo server as data source (I've already added a very basic query to the URL): http://demo.robustperception.io:9090/graph?g0.range_input=1h&g0.expr=up&g0.tab=1

siegmund42 commented 4 years ago

Any news on this? I just took a quick look in the javascript console and it gives: TypeError: this.props.panelData is undefined PromLink.tsx:23:19

Anyway, request and response data look good so it's just a matter of presentation I guess.

Gauravshah commented 4 years ago

@siegmund42 moved the conversation here https://github.com/GoshPosh/grafana-meta-queries/issues/94