Giter VIP home page Giter VIP logo

clevercloud-grafana-example's Introduction

How to set up Grafana on Clever Cloud

  1. Fork this repository.
  2. Create a Node.js application. It will download and run Grafana using the root package.json file. The install script build.sh will download grafana and its plugins and the start one run.sh will start the grafana-server binary.
  3. In your application environment variables add GF_SERVER_HTTP_PORT=8080.
  4. Add GRAFANA_VERSION and GRAFANA_SHA_256 environment variables. You can find these values on the Grafana download page.
  5. Check Node.js version used in package.json, for instance Grafana 7.5.5 expects Node.js 14 (see Grafana's package.json).
  6. To install custom Grafana plugin, you can set them directly in GRAFANA_PLUGINS environnement variable split by a ,, for example with the value: plugin,other_one:0.0.2,https://github.com/ovh/ovh-warp10-datasource.git. It will install the latest version of plugin, the version 0.0.2 of second_one using the grafana-cli commands. And for the ovh-warp10-datasource plugin, git clone is used instead, as it's done for any plugin starting by http.
  7. Add GF_PLUGIN_DIR environnement variable with ./data/plugins to use local cloned plugins.
  8. You can now build and start the Clever Cloud application, be aware however that if you restart it your data will not be persisted (see next section to learn how to persist data).
  9. To configure Grafana through environment variables please check grafana configuration page.

Persisting Data on a database

For this example we will use mysql however the procedure shouldn't be too different with any other type of database as PostgreSQL.

  1. Create your database add-on on Clever Cloud and link it to the application, you can check our documentation.
  2. In your application environment variables you should now see the information you need to connect to your database.
  3. Link your add-on to your Grafana application. To do this you need to create a few environment variables (replace what's in '<>' with the actual value):
    • GF_DATABASE_NAME=<MYSQL_ADDON_DB>
    • GF_DATABASE_HOST=<MYSQL_ADDON_HOST>
    • GF_DATABASE_PASSWORD=<MYSQL_ADDON_PASSWORD>
    • GF_DATABASE_URL=<MYSQL_ADDON_URI>
    • GF_DATABASE_USER=<MYSQL_ADDON_USER>
    • GF_DATABASE_TYPE=mysql

clevercloud-grafana-example's People

Contributors

aurrelhebert avatar blackyoup avatar noisegrrrl avatar urcadox avatar

Watchers

 avatar  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.