GithubHelp home page GithubHelp logo

grafanapoc's Introduction

GrafanaPoC

Overview

Proof of concept for displaying application performance monitoring information in Grafana Grafana normally reads information from a data source such as a timeseries nosql database like Prometheus. This demonstrates how to use Grafana with the SimpleJson data source.

The data source has to expose the following endpoints:

  • / should return 200 ok. Used for "Test connection" on the datasource config page.
  • /search used by the find metric options on the query tab in panels.
  • /query should return metrics based on input.
  • /annotations should return annotations.

It appears that statsd information can be displayed with InfluxDB or Prometheus

Setup

Setup Node

  • Clone this repo
  • Install node v7.8 or higher via nvm
  • npm install

Grafana Docker Install

  • Install Docker for example Docker for Mac
  • Run the image with plugins: docker run -p 3000:3000 -e "GF_INSTALL_PLUGINS=grafana-piechart-panel,grafana-simple-json-datasource" grafana/grafana'
  • The first time you run the above, it will automatically download the Grafana image from dockerhub

Startup

Setup Data Source

  • npm start starts the service on port 9000
  • Run Grafana as per the above docker run command
  • Navigate to localhost:3000 in a browser
  • login as admin/admin
  • Add data source
    • name: simplejson
    • type: SimpleJson
    • url: http://localhost:9000
    • proxy: direct

Import Dashboard

  • Click top left orange icon
  • Dashboards -> Import
  • Upload JSON file: graphana/home-*.json
  • Select datasource from dropdown: simplejson
  • Click Import button
  • Enjoy!

Reference Info

Feel free to skip this, this information not needed but kept here for reference.

Grafana Local Install

  • brew update; brew install grafana See Grafana Installation instructions for more details.
  • Either run Grafana via launchd and restart at login: brew services start grafana
  • Or run Grafana locally: grafana-server --config=/usr/local/etc/grafana/grafana.ini --homepath /usr/local/share/grafana cfg:default.paths.logs=/usr/local/var/log/grafana cfg:default.paths.data=/usr/local/var/lib/grafana cfg:default.paths.plugins=/usr/local/var/lib/grafana/plugins
  • Documentation on installing plugins: https://github.com/grafana/grafana-docker#installing-plugins-for-grafana-3

Grafana Plugins we use

  • Piechart Plugin: grafana-cli plugins install grafana-piechart-panel
  • SimpleJson panel: grafana-cli plugins install grafana-simple-json-datasource

Other Grafana Plugins of interest

  • Worldmap panel: grafana-cli plugins install grafana-worldmap-panel
  • Google calendar plugin to show calendar events as annotations: grafana-cli plugins install mtanda-google-calendar-datasource
  • Histogram panel: grafana-cli plugins install mtanda-histogram-panel

Dashboard Configuration

This is not needed unless the JSON file is not available for import

  • New dashboard: Home
  • New Graph
    • Title: Error Count by Hour
    • DataSource: SimpleJson
    • Metric type: timeseries
    • Metric name: error-report
    • Display draw mode: bars
    • Time range start: 2017-03-08 17:00:00
    • Time range end: 2017-03-09 17:00:00
  • New Pie Chart:
    • Title: Error count by Device
    • DataSource: SimpleJson
    • Metric name: device-report
    • Legend show legend
    • Legend position: on graph
    • Legend font size: 120%
    • Legend values: on
    • Legend show percentage: on
  • Save dashboard and star it

grafanapoc's People

Contributors

cstrong avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar Jeff Ardilio 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.