Giter VIP home page Giter VIP logo

cognite-grafana-datasource's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cognite-grafana-datasource's Issues

new functionality

will be greate to have next functionality:
1.sort timeseries by aggregated values over time range and have ability to select just top N sorted timeseries for display.
2. create a function to link table panel columns with annotation columns, for example:
when I try to create event log table in Grafana, I can not chose which values display in which table panel column.
image

Move timeseries out of the queryTarget object

We currently store all timeseries rooted at an asset in the QueryTarget object. This was fine as that object was only really visible through the JSON section. However, it really should not be there as that object should just be for properties that remain constant between reloads of the page (ie not for storage)

Grafana 6.0.0 also introduces the explore section, which puts the querytarget object in the url, and this can cause issues if we try to store a lot of timeseries.

Event annotations are not working with variables

When trying to show events for different values of a variable, the events seems to be global for the dashboard, i.e. they are not corresponding to the chosen variable value.
It would increase the possibilities a lot if it was possible to filter these on variables as well.

Implement Retrying

It'd be nice to have a way for the data source to automatically retry some failed requests. Would help to mitigate some issues that arise from rate limiting.
First thoughts are to just implement retrying 5 times with some sort of backoff.

Custom query can not find timeseries outside of the 10000 first

We're doing client-side filtering to satisfy the regexes, and we're doing it optimistically. When there's attached more than the 10000 (the limit specified in our code), those won't get looked after.

A quick solution is to paginate all timeseries for the given asset instead of giving up after the first 10000.

Thoughts @hulien22 ?

Replace deprecated Grafana SCSS styles

Hi from the Grafana team ๐Ÿ‘‹

In Grafana 12, we'll be removing Angular support. As part of that, we'll also be removing a lot of legacy CSS classes.
It looks like this plugin relies on one of these classes:

  • gf-form-switch

The CSS class names that Grafana provides can change at any time and should not be relied on as a stable external API. The recommendation would be to either:

  • Use an existing component from the component library at @grafana/ui
    • in this case, you could use the InlineSwitch component directly
  • Use the theme object with emotion to style your components. The theme object is a stable API that is maintained according to SemVer.
  • Apply these styles yourself within this repo. You can find the existing styles here as a reference.

Thanks again for your contributions and support! ๐Ÿ™Œ

Make base url configurable

The base url should be configurable so that the data source can be used for projects in greenfield and when running the api locally.

Add possibility to list assets in table charts

It would be useful to be able to query the assets to retrieve metadata and list them in a table. This would make it possible to use most other chart plugins as well to for example by using parts of the metadata for latitude and longitude to use the various map plugins as well.

Implement the possibility of "summing" timeseries value on a certain time boundary and plot it

For various applications users wants to see the cumulative value of a certain time series values over a determined time boundary.

Eg. " I want to plot how much Oil was pumped on this pipeline on the last 24h. Or from the beginning of the day up til now"

Eg2. " would like to plot the quantity of clorine pumped on each well the last 7 days"

Eg3. "Want to plot the sum of power consumption of this motor on the last month"

And so on.

This would be very much useful if available on our CDP Grafana Plugin capabilites.

Add Format as Table option

We currently only format results as timeseries, however tables have a different format that can allow for more information.
Some other datasources, such as Prometheus, have an option Format as. This allows for better use of the table and world map panels.

The table should show timestamp, data, as well as metadata. There should also be a way to order and filter out columns (some of this can be done via the panel's settings)

Support string time series for events

Would be useful to have string timeseries be queryable and be able to be shown as events/annotations. For example, having a string timeseries for a valve that has "on" and "off" values.

Some things to consider:

  • Having too many annotation slows down grafana a lot, so this may be a concern here
  • We might only want to show some of the points, ie where the values change
  • Might potentially want this to be applicable to normal time series as well (eg 0,1 timeseries?)

Timeseries from asset + Include relationships

When fetching timeseries-datapoints from assets and including relationships, the start/end timestamps for the relationships are not considered. To be able to fully utilize the relationship functionality the query should only fetch datapoints from timeseries-relationships in the interval where the relationships is active.

Extend First/Last values for Step Interpolation

From @StavisT.
For step interpolation, there is sometimes a desire to extend the first and last datapoints to the end of the window. This can be easily implemented by checking for a stepInterpolation call and then duplicating the first/last endpoints received and setting their times to the beginning/end of the query range.

The only concern is to figure out when this should happen: whether we should do it for every step interpolation call, or if there should be a separate option for this (that would allow it for any type of call). I'm against the first option as it might be confusing to users since this would be the only aggregate type that does this. If we go with the latter, then we need to figure out where to put this option.

Migrate to react

With the release of Grafana 6.0, we can now create plugins via React instead of AngularJS.

We should migrate all of our angular code to react as this will make it easier for any future frontend development.

Filter out zero-values when doing a custom query

When doing calculations in a custom query, the query fails when null-values appear (e.g. if you want to show a time-series as a percentage of max and then for a portion of the time selected, the value is zero).

Similar to what is seemingly possible through Prometheus: grafana/grafana#8309, it would be great to be able to filter out the zero-values of a time-series.

Query Template instances on Dashboard variables

Today we can add dynamic queries to assets in dashboard variables as shown in the screenshot below:
image

With the newly added feature to query data from Templates it would be extremely valuable to add the option to query Template instances in dashboard variables, allowing to add dropdown buttons that could be used to filter the results in the GraphQL queries. Is this something that could be implemented in the Grafana datasource?

Support timeseries "shift" option

I am building an energy dashboard where I have the hourly energy consumption as a time series (aggregated by day in Grafana).
I would like to have a visual that compares the actual daily consumption to, e.g. the one of last month.
I managed to to make this time shift with the query options โ€œtime shiftโ€

My Problem:
I want to have these 2 time series in ONE graph. Any idea how I can do this?

Ability to select Data Types

In order to scale the dashboard across a fleet of vessels, and for use of a automated Use Case/Dashboard, I suggest to add the ability to select from Data Types.

A use case would be for instance to select all time-series data on the fleet's Turbochargers.

Use of variable metadata

When using variables in Grafana, it would be nice to be able to use the variables metadata fields or description to ensure chart names or TS labels makes sense. Sometimes the description of the asset or time series can be more meaningful than the name.

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (local>cognitedata/renovate-config)

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Pending Status Checks

These updates await pending status checks. To force their creation now, click the checkbox below.

  • chore(deps): update dependency @grafana/e2e-selectors to v10.4.4
  • chore(deps): update dependency @types/node to v20.14.8
  • chore(deps): update dependency eslint-plugin-react to v7.34.3
  • chore(deps): update dependency sass to v1.77.6
  • fix(deps): update dependency eslint-plugin-jsdoc to v48.2.13
  • chore(deps): update dependency eslint-plugin-jsx-a11y to v6.9.0
  • chore(deps): update dependency typescript to ~5.5.0
  • chore(deps): update dependency webpack to v5.92.1
  • fix(deps): update dependency graphql to v16.9.0

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

docker-compose
docker-compose.yaml
dockerfile
.config/Dockerfile
github-actions
.github/workflows/buind_n_test.yml
  • actions/checkout v4
  • actions/setup-node v4
.github/workflows/is-compatible.yml
  • actions/checkout v4
  • actions/setup-node v4
.github/workflows/release.yml
  • actions/checkout v4
  • actions/setup-node v4
  • actions/setup-go v5
  • softprops/action-gh-release v1
npm
package.json
  • @emotion/css ^11.1.3
  • @grafana/data ^10.1.2
  • @grafana/runtime ^10.3.1
  • @grafana/schema ^10.1.2
  • @grafana/ui ^10.1.2
  • deepdash ^5.0.0
  • eslint-plugin-jsdoc 48.2.9
  • graphql ^16.6.0
  • graphql-language-service ^5.1.2
  • graphql-tag ^2.12.6
  • jsonlint-mod ^1.7.6
  • lodash ^4.17.21
  • ms ^2.1.2
  • nearley ^2.19
  • query-string ^6.10.1
  • react 18.3.1
  • react-dom 18.3.1
  • @babel/core ^7.16.7
  • @babel/preset-env ^7.11.5
  • @grafana/e2e-selectors 10.4.3
  • @grafana/eslint-config ^6.0.0
  • @grafana/tsconfig ^1.2.0-rc1
  • @swc/core ^1.2.144
  • @swc/helpers ^0.5.0
  • @swc/jest ^0.2.23
  • @testing-library/jest-dom ^6.0.0
  • @testing-library/react ^16.0.0
  • @types/glob ^8.0.0
  • @types/jest ^29.2.2
  • @types/lodash ^4.14.188
  • @types/ms ^0.7.31
  • @types/node ^20.0.0
  • @types/react ^18.0.0
  • @typescript-eslint/eslint-plugin ^4.4.0
  • @typescript-eslint/parser ^4.4.0
  • copy-webpack-plugin ^12.0.0
  • css-loader ^7.0.0
  • eslint ^7.10.0
  • eslint-config-airbnb-typescript ^18.0.0
  • eslint-config-prettier ^9.0.0
  • eslint-plugin-import ^2.22.1
  • eslint-plugin-jsx-a11y ^6.4.1
  • eslint-plugin-prettier ^5.0.0
  • eslint-plugin-react ^7.21.3
  • eslint-plugin-react-hooks ^4.2.0
  • eslint-webpack-plugin ^4.0.0
  • fork-ts-checker-webpack-plugin ^9.0.0
  • glob ^8.0.3
  • identity-obj-proxy 3.0.0
  • jest ^29.3.1
  • jest-environment-jsdom ^29.3.1
  • lint-staged ^15.0.0
  • prettier ^3.0.0
  • replace-in-file-webpack-plugin ^1.0.6
  • sass 1.77.4
  • sass-loader 14.2.1
  • style-loader 3.3.4
  • swc-loader ^0.2.3
  • ts-jest ^29.0.5
  • ts-node ^10.5.0
  • tsconfig-paths ^4.1.0
  • typescript ~5.4.0
  • webpack ^5.69.1
  • webpack-cli ^5.0.2
  • webpack-livereload-plugin ^3.0.2
nvm
.nvmrc
  • node 20

  • Check this box to trigger a request for Renovate to run again on this repository

Feature request from Framo

We would like to add custom labels for metrics
(currently the label for each graph is the full tagId)

Use time range to calculate default granularity instead of options.intervalMs

It seems as though options.intervalMs varies depending on the panel type. We currently use this value to calculate a granularity to set if no granularity is provided. However, this can be confusing to users since if they have the same query in two different panels (e.g. graph and singlestat), then they can get different values.
I propose using the time range to calculate what the interval should be ourselves, that way we do properly give the same results across all panels.

Case sensitive | insensitive regex

Currently, the grafana filter is case sensitive. Unfortunately, many timeseries have mixed cases in their tag/name. For example, a pressure timeseries from one sensor might have the name
VAL_10-TT_81704:Value
While another pressure time series will end with "VALUE".
Applying a filter using the word "VALUE" will filter out some timeseries

Grafana language documentation

Document describing the language used by Grafana for queries and filters.
Examples will also be useful.

Creating Variables is a very powerful functionality, but given the complexity of the assets and amount of timeseries, complex queries and filtering is required to locate the correct timeseries.

Example, I have a template dashboard that will have a variable that groups all the wells in Valhall and the timeseries under these wells. I need to apply filters to find the correct timeseries for each graph. Using the correct filter is very important to display the correct timeseries. I am not familiar with the Grafana language and it has been a steep learning curve. Having documentation and examples to refer to would be a very useful feature.

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.