GithubHelp home page GithubHelp logo

danielle9897 / ravendb-grafana-datasource Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ravendb/ravendb-grafana-datasource

0.0 1.0 0.0 1.05 MB

License: MIT License

JavaScript 1.17% TypeScript 98.83%

ravendb-grafana-datasource's Introduction

RavenDB Grafana Data Source Plugin

Build Marketplace Downloads License

This plugin allows you to connect your RavenDB to Grafana as datasource and query its data.

Note: For Monitoring RavenDB instance (not its data) please refer to: https://ravendb.net/docs/article-page/5.2/http/server/administration/monitoring

Screen

Features

  • querying for table data
  • querying for time series
  • dynamic queries
  • support for templating ($__interval, $timeFilter and variables)

Documentation

Note: All queries are based on sample data

Query for collection/index

RQL Query:

from Employees select LastName, FirstName, Title, Address

Syntax reference

Variables

Only first column from result is used. Use query which returns single column, ex:

from "Products" select distinct Name 

Referencing variables in queries

Assuming that Product variable is defined:

from index 'Product/Rating'
where Name = "${Product}"
select Rating

Query from collection/index with time series data

Alias time column with name Time. Grafana will autodetect this as time column. Time series graph will be available.

from "Orders" 
select Freight, OrderedAt as Time

Geospatial Queries

Project columns inside result to Latitude and Longitude columns

from Suppliers 
where Address.Location != null
select 
   Name, 
   Address.Location.Latitude as Latitude, 
   Address.Location.Longitude as Longitude

Geospatial query result

Time series queries with dynamic group by and range filter

Variable Description Example
$timeFilter replaced with date from grafana date range selector "2021-11-17T16:56:28.158Z" and "2022-02-17T09:45:12.697Z"
$__interval grafana suggested interval 5m, 15s, etc
from 'Products'
where id() == 'products/77-A'
select timeseries(
   from 'INC:Views' 
   between $timeFilter 
   group by $__interval 
   select sum()
)

Support for multi-value templates

In order to properly use multi-value query variable format it using doublequote

from Employees 
where FirstName in (${paramName:doublequote})

It will be translated to:

from Employees 
where FirstName in ("Peter", "Anna", "John")

Development

  1. Install dependencies

    yarn install
  2. Build plugin in development mode or run in watch mode

    yarn dev

    or

    yarn watch
  3. Build plugin in production mode

    yarn build

Links

ravendb-grafana-datasource's People

Contributors

ml054 avatar ppekrol avatar

Watchers

James Cloos avatar

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.