Giter Site home page Giter Site logo

mustafamado / grafana-pandas-datasource Goto Github PK

View Code? Open in Web Editor NEW

This project forked from grafana-toolbox/grafana-pandas-datasource

0.0 0.0 0.0 92 KB

Grafana Pandas Datasource - using Python for generating timeseries-, table-data and annotations

License: GNU Affero General Public License v3.0

Python 100.00%

grafana-pandas-datasource's Introduction

Supported Grafana versions

Grafana pandas datasource

About

A HTTP API based on Flask for serving pandas data frames to Grafana, generated by NumPy. The Grafana Simple JSON Datasource is used to interface Grafana with the HTTP API.

This way, a pure Python application can be used to directly supply data to Grafana, both easily and powerfully.

The framework supports feeding both timeseries data as well as annotations through corresponding /query and /annotations endpoints and also provides /search and /panels endpoints.

Screenshots

https://user-images.githubusercontent.com/453543/103137119-78dab480-46c6-11eb-829f-6aa957239804.png

Image: Sinewave data and midnights annotations, both generated using NumPy, see Sinewave/Midnights example.

Setup

Grafana pandas datasource setup outlines how to install all software prerequisites needed to run this project. Please read this section carefully.

pip install grafana-pandas-datasource

Synopsis

Test drive:

# Run Grafana pandas datasource demo.
python examples/sinewave-midnights/demo.py

# Submit a timeseries data request.
echo '{"targets": [{"target": "sine_wave:24"}], "range": {"from": "2022-02-22T15", "to": "2022-02-22T20"}}' | http http://127.0.0.1:3003/query

# Submit an annotation data request.
echo '{"annotation": {"query": "midnights:xx"}, "range": {"from": "2022-02-20", "to": "2022-02-22"}}' | http http://127.0.0.1:3003/annotations

When the environment has been properly configured, both requests above will yield appropriate responses.

Then, configure the Grafana entities. You will need a datasource object and a dashboard object.

Examples

There are different demo programs accompanied with Grafana datasource and dashboard definition files.

After confirming the sandbox environment has been installed successfully, please head over to the Sinewave/Midnights example page in order to learn how to provision Grafana with corresponding resources.

Custom implementations

In order to conceive your own pandas-based data source, please use the Sinewave/Midnights demo.py as a blueprint. If you think it would be a valuable contribution to the community, we will be happy to add it to the repository.

Credits

Kudos to Linar, who conceived the initial version of this software the other day at https://gist.github.com/linar-jether/95ff412f9d19fdf5e51293eb0c09b850.

Other projects

Oz Tiram conceived a similar piece of software with Python. He uses the Bottle web framework.

grafana-pandas-datasource's People

Contributors

amotl avatar linar-jether 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.