The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
Go to file
Torkel Ödegaard 246f41b88a Bus experiment
2014-11-28 22:16:49 +01:00
_vendor Macaron and sqllite 2014-11-14 17:13:33 +01:00
conf Tried postgres 2014-11-24 10:17:13 +01:00
data/dashboards updated 2014-10-07 13:44:20 -04:00
Godeps Added Godeps and embedded dependencies 2014-11-28 11:56:03 +01:00
grafana@79beefe57c removed old code 2014-11-24 08:20:16 +01:00
pkg Bus experiment 2014-11-28 22:16:49 +01:00
views OAuth remake 2014-10-07 17:56:37 -04:00
.bra.toml refactoring 2014-11-24 17:37:20 +01:00
.gitignore Added missing files 2014-11-26 09:58:36 +01:00
.gitmodules search and save are 'working', barely 2014-08-08 12:35:15 +02:00
Dockerfile Tried postgres 2014-11-24 10:17:13 +01:00
main.go Bus experiment 2014-11-28 22:16:49 +01:00
Makefile moved back to a main.go file in root 2014-11-28 11:51:34 +01:00
README.md Create README.md 2014-11-26 12:57:16 +01:00
start_dependencies.sh Tried postgres 2014-11-24 10:17:13 +01:00
todo.txt rendering 2014-10-01 21:07:58 +02:00

grafana-pro

This is very much a Work in Progess. The architecture and organisation has changed many times and I am not very happy with the current structure and architecture. I started with a lot of unit tests and drove the design though that in the begining, but then having changed the code and structure (and web framework libs, and database) I sort of abandoned them. When the architecture is getting more stable I will write & require more unit & integration tests.

Architecture

I have researched a lot of go projects, found very few with a nice modular & loosly coupled archictecture. Go projects organize code very differently, some treat packages as global singletons (which reads nicely and is nice to work with but seems like a bad practice). I do miss generics for doing strongly typed but loosley coupled command/query style internal buss messaging.

The biggest challange for architecture is making Grafana Pro very modular in a way that all/most components can run inproc or in seperate process (usefull when running Grafana Pro in a large scale SaaS setup). Been investigating using ZeroMQ or NanoMsg to handle module communication (Both ZeroMQ and NanoMsg can handle inproc & tcp which a number of different topologies). Running Grafana Pro in a SaaS setup might warrant that the alerting stuff runs out of proc on other servers feeding of a queue for example, but for simple on prem stuff it would be cool if that could be run in the same process. I am also thinking that some stuff might need swapping out/in depending on the setup (plugin model or just interfaces with different implementations).

Building

  • Just added a simple make file (the main binary package is in pkg/cmd/grafana-pro)
  • Need to change to godep or some go lang dependency management system

Data access

Data access is very strange right now, instead of an interface I tried using public methods in the models package. These method pointers are assigned in when the sqlstore is initialized in pkg/store/sqlstore. This is probably a bad idea. I am thinking about either moving to simple interfaces. But I do not want a giant interface for all data acess. Would much prefe a simple generic command/query interface but golang lacks generics which makes this painful. But a generic command/query interface could still be good as it would make it easier to have some commands or queries handled buy out of proc components (or inproc if we used someting like ZeroMQ for communication). Or it could be overengineering thinking like this.

Grafana frontend

The grafana frontend is added as git submodule in order to easily sync with upstream grafana. There should be a symbolic link from ./grafana/src to ./public . Need to add this to the Makefile.

TODO

  • Add symbolik link between ./grafana/src ./public
  • Hash & Salt password
  • Unit tests for data access
  • I switched recently from rethinkdb to sql (using a simple mini ORM lib called xorm, might need to switch to a more popular ORM lib).