cognitedata / cognite-grafana-datasource Goto Github PK
View Code? Open in Web Editor NEWGrafana datasource plugin for the Cognite Data Platform
License: Apache License 2.0
Grafana datasource plugin for the Cognite Data Platform
License: Apache License 2.0
Set up with tslint
and prettier
for consistent formatting.
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.
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.
Some sort of ability to filter over the actual values of a timeseries would be quite useful.
Something similar to what prometheus has here could be a good starting guide
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.
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.
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 ?
Currently, we get an error saying that the limit for items is 100, which is not very useful to a user as they have little control over this.
We should be able to create additional /dataquery
calls with a max of 100 each
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:
@grafana/ui
InlineSwitch
component directlyThanks again for your contributions and support! ๐
The base url should be configurable so that the data source can be used for projects in greenfield and when running the api locally.
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.
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.
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)
When a user authenticates with Grafana - pass the same users credentials to the data source. This way, we can still apply authentication and authorization to the requests.
There seems to be a unresolved issue with grafana, see thread here;
https://community.grafana.com/t/oauth2-authentication-with-a-custom-datasource-plug-in/880/10
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:
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.
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.
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.
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.
Today we can add dynamic queries to assets in dashboard variables as shown in the screenshot below:
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?
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?
To be able to use events in a more meaningful way, giving the user the relevant information.
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.
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.
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)
Prometheus and other datasources have a concept of instant queries, which allow users to only fetch the latest datapoint. See https://grafana.com/docs/grafana/latest/features/datasources/prometheus/#instant-queries
There is also a desire to query for the latest value regardless of the selected time range (i.e. even if the dashboard is currently showing metrics from last week, I still want this table/singlestat panel to show the current values)
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.
@swc/core
, @swc/helpers
, @swc/jest
, swc-loader
)These updates await pending status checks. To force their creation now, click the checkbox below.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@typescript-eslint/eslint-plugin
, @typescript-eslint/parser
)@grafana/data
, @grafana/e2e-selectors
, @grafana/runtime
, @grafana/schema
, @grafana/ui
)These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.
docker-compose.yaml
.config/Dockerfile
.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
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
.nvmrc
node 20
We would like to add custom labels for metrics
(currently the label for each graph is the full tagId)
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.
Publishing the plugin to the grafana plugin repository would make it available in Grafana Cloud. In this manner our customers could use Grafana as a visualization layer in a low-effort via the Grafana Cloud (grafana as a service) solution.
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.