Giter Club home page Giter Club logo

grafana-redistimeseries's Introduction

license CircleCI GitHub issues Codecov

Deprecation notice

This project has been deprecated, for further information on how to use Redis and Grafana: https://github.com/RedisTimeSeries/grafana-redis-datasource.

RedisTimeSeries-Datasource

Forum Gitter

Grafana Datasource for RedisTimeSeries

QuickStart

You can tryout the Grafana Datasource for RedisTimeSeries with RedisTimeSeries and Grafana in a single docker compose

cd compose
docker-compose up

Grafana can be accessed on port 3000 (admin:admin)

Grafana Datastore API Server

Overview

A HTTP Server to serve metrics to Grafana via the simple-json-datasource

Grafana configuration

  1. install SimpleJson data source: https://grafana.net/plugins/grafana-simple-json-datasource/installation

  2. in Grafana UI, go to Data Sources

  3. Click Add data source 3.1 choose Name 3.2 Type: SimpleJson 3.3 URL: point to the URL for your GrafanaDatastoreServer.py 3.4 Access: direct (unless you are using a proxy)

  4. Query the datasource by a specific key, or * for a wildcard, for example: stats_counts.http.*

Dependencies

To install the needed dependencies just run: pip install -r requirements.txt

GrafanaDatastoreServer.py Usage

usage: GrafanaDatastoreServer.py [-h] [--host HOST] [--port PORT]
                                 [--redis-server REDIS_SERVER]
                                 [--redis-port REDIS_PORT]

optional arguments:
  -h, --help            show this help message and exit
  --host HOST           server address to listen to
  --port PORT           port number to listen to
  --redis-server REDIS_SERVER
                        redis server address
  --redis-port REDIS_PORT
                        redis server port

Note about timezone

Grafana uses UTC timestamps to query its datastores. This datastore will use the same timestamps to query Redis, which means that it assumes all timestamps are UTC based.

grafana-redistimeseries's People

Contributors

danni-m avatar gkorland avatar k-jo avatar streamnsight avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

grafana-redistimeseries's Issues

TypeError: can't subtract offset-naive and offset-aware datetimes

After adding data source, when trying to fetch metric:

TypeError: can't subtract offset-naive and offset-aware datetimes
::ffff:172.31.90.82 - - [2020-01-15 10:46:41] "POST /query HTTP/1.1" 500 443 0.001570
EROR[01-15|10:46:41] Request Completed                        
logger=context userId=1 orgId=1 uname=admin method=POST path=/api/datasources/proxy/2/query status=500 remote_addr=0.0.0.0 time_ms=2 size=290 referer="http://0.0.0.0:3000/dashboard/new?tab=queries&panelId=2&edit&fullscreen"
[2020-01-15 10:47:06,790] ERROR in app: Exception on /query [GET]

@K-Jo @danni-m 

redis time series update generates error in both grafana-redistimeseries and grafana

Hi,
Using macosx as the server for the data source, redis, redis-grafana, and grafana.
the data is a floating point value updating at 1hz.

grafana reports "internal error" in a red triangle at the upper left corner, and this message
in the console:
EROR[09-26|14:14:39] Request Completed logger=context userId=1 orgId=1 uname=admin method=POST path=/api/datasources/proxy/1/query status=500 remote_addr=[::1] time_ms=10 size=291 referer="http://localhost:3000/?orgId=1"

the grafana-redis server exceptions reporting this message:
Traceback (most recent call last)::
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 2311, in wsgi_app
response = self.full_dispatch_request()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 1834, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 1737, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/_compat.py", line 36, in reraise
raise value
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 1832, in full_dispatch_request
rv = self.dispatch_request()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 1818, in dispatch_request
return self.view_functionsrule.endpoint
File "/Users/rps/projects/NextRadar/redis/grafana-redistimeseries-master/GrafanaDatastoreServerBis.py", line 78, in query
targets = process_targets([t['target'] for t in request['targets']], redis_client)
File "/Users/rps/projects/NextRadar/redis/grafana-redistimeseries-master/GrafanaDatastoreServerBis.py", line 78, in
targets = process_targets([t['target'] for t in request['targets']], redis_client)
KeyError: 'target'
::ffff:127.0.0.1 - - [2019-09-26 14:14:39] "POST /query HTTP/1.1" 500 444 0.008736

flask blows up with naive time

I tried this, with the same error, on both macosx and ubuntu.

Problem occurs when I select "timeserie" in the grafana dashboard
Help please. Thank you

[2019-09-12 11:18:11,613] ERROR in app: Exception on /query [POST]
Traceback (most recent call last):
File "/home/rps/.local/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app
response = self.full_dispatch_request()
File "/home/rps/.local/lib/python3.6/site-packages/flask/app.py", line 1951, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/rps/.local/lib/python3.6/site-packages/flask_cors/extension.py", line 161, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/rps/.local/lib/python3.6/site-packages/flask/app.py", line 1820, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/rps/.local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/rps/.local/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "/home/rps/.local/lib/python3.6/site-packages/flask/app.py", line 1935, in dispatch_request
return self.view_functionsrule.endpoint
File "/home/rps/grafana/grafana-redistimeseries-master/GrafanaDatastoreServer.py", line 69, in query
stime = (dateutil.parser.parse(request['range']['from']) - EPOCH) / timedelta(milliseconds=1)
TypeError: can't subtract offset-naive and offset-aware datetimes

help with README.md

Step 3.3 says: URL: point to the URL for your GrafanaDatastoreServer.py

At this point I am completely lost.

I see GrafanaDatastoreServer.py - this is a file in a directory I downloaded.
But I have no clue as to what URL this corresponds to.

Do I need to create a webserver and expose this file?

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.