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

Handle dataframes format if the datasource supports it #152

Closed jorgelbg closed 3 months ago

jorgelbg commented 2 years ago

While using the latest version (v0.0.9) in our local Grafana setup (8.4/8.5) we found that the metaqueries plugin was not working with the InfluxDB datasource. I believe that the issue that we found was the same as reported in #149.

The root of the problem seems to be that the InfluxDB datasource plugin has been updated to use the new Grafana Dataframes format which means that internally the result of the queries is no longer available in datapoints but instead is available in fields. The internal format of the data inside fields also changed.

At least until now, Elasticsearch is still using the old format (datapoints).

As a side note I've tested the changes included in this PR in a Grafana v9.0.0 container and it seemed to work fine with both datasources (Elasticsearch & InfluxDB):

image
moziliar commented 2 years ago

Hi, any update on this PR?

Gauravshah commented 2 years ago

@jorgelbg thanks for the contribution. can you please remove unleated changes on package.json. also please make changes on both src & dist.

@ShilpaSivanesan can you please take it forward after the above changes ?

jorgelbg commented 2 years ago

@Gauravshah I reverted the changes to package-lock.json I think these were applied automatically when the lockfileVersion changed.

I also applied the changes to the dist/ directory. For this I relied on the build target: (npm run build) and discarded some changes to the dist/README.md (which seems to be out of sync). I thought that this was going to run as part of the release process so I didn't included in the initial PR.

Gauravshah commented 2 years ago

thanks @jorgelbg @ShilpaSivanesan can you please take it from here ?

ShilpaSivanesan commented 2 years ago

Thanks @jorgelbg Sure @Gauravshah

martinbruntsch commented 1 year ago

anyone out there who can review/approve the PR?

martinbruntsch commented 1 year ago

@Gauravshah , @ShilpaSivanesan any chance to get this into master?