Commit Graph

60 Commits

Author SHA1 Message Date
Carl Bergquist 88783d6e0a avoid calling os.Exit outside main.go (#12459)
I don't think we should call os.Exit outside main.go. Calling
os.Exit breaks the application control flow.
2018-06-29 22:48:26 -07:00
Torkel Ödegaard 7a7c6f8fab fix: log close/flush was done too early, before server shutdown log message was called, fixes #12438 2018-06-28 04:38:23 -07:00
bergquist dbfafa1cb5 routing: allows routes to be added to existing groups
this enables services to add routing to ex /api
without causing conflicts.
2018-06-25 16:50:27 +02:00
Torkel Ödegaard 80d694d205 Backend image rendering as plugin (#11966)
* rendering: headless chrome progress

* renderer: minor change

* grpc: version hell

* updated grpc libs

* wip: minor progess

* rendering: new image rendering plugin is starting to work

* feat: now phantomjs works as well and updated alerting to use new rendering service

* refactor: renamed renderer package and service to rendering to make renderer name less confusing (rendering is internal service that handles the renderer plugin now)

* rendering: now render key is passed and render auth is working in plugin mode

* removed unneeded lines from gitignore

* rendering: now plugin mode supports waiting for all panels to complete rendering

* fix: LastSeenAt fix for render calls, was not set which causes a lot of updates to Last Seen at during rendering, this should fix sqlite db locked issues in seen in previous releases

* change: changed render tz url parameter to use proper timezone name as chrome does not handle UTC offset TZ values

* fix: another update to tz param generation

* renderer: added http mode to renderer service, new ini setting [rendering] server_url
2018-05-24 15:26:27 +02:00
Torkel Ödegaard d0c17100cb fix: fixed some minor startup logging issues 2018-05-18 11:17:31 +02:00
Torkel Ödegaard 6c0752473a Sqlstore refactor (#11908)
* refactor: tracing service refactoring

* refactor: sqlstore to instance service

* refactor: sqlstore & registory priority

* refactor: sqlstore refactor wip

* sqlstore: progress on getting tests to work again

* sqlstore: progress on refactoring and getting tests working

* sqlstore: connection string fix

* fix: not sure why this test is not working and required changing expires

* fix: updated grafana-cli
2018-05-18 11:10:10 +02:00
Torkel Ödegaard 27e1c67453 refactor: tracing service refactoring (#11907) 2018-05-10 16:51:55 +02:00
bergquist 65352dccc0 only error log when err is not nil 2018-05-08 11:59:27 +02:00
Torkel Ödegaard c40a50829d fix: removed manully added http server from inject graph as it is now a self registered service 2018-05-02 21:30:15 +02:00
Torkel Ödegaard e3ea6c683c fix: comment spell fix 2018-05-02 19:56:15 +02:00
Torkel Ödegaard 23655315b8 fix: fixed race condition between http.Server ListenAndServe & Shutdown, now service crash during startup correctly closes http server every time 2018-05-02 19:56:15 +02:00
Torkel Ödegaard d04ad835e2 refactoring: lots of refactoring around server shutdown flows, making sure process is terminated when background service has crashed 2018-05-02 19:56:15 +02:00
Torkel Ödegaard 053c2039bb refactor: provisioning service refactoring 2018-05-02 19:56:15 +02:00
Torkel Ödegaard 14bb7832af Metrics package now follows new service interface & registration (#11787)
* refactoring: metrics package now follows new service interface & registration

* fix: minor fix, make sure metrics service is imported, by grafana-server
2018-05-02 19:54:07 +02:00
Torkel Ödegaard 2b93cbbf04 --amend 2018-05-01 14:18:10 +02:00
Torkel Ödegaard 13e015fe3f fix: improved handling of http server shutdown 2018-05-01 14:14:11 +02:00
Torkel Ödegaard fa7d7ed5df Initial Baby Step to refactoring settings from global vars to instance (#11777)
* wip: start on refactoring settings

* settings: progress on settings refactor

* refactor: progress on settings refactoring

* fix: fixed failing test

* settings: moved smtp settings from global to instance
2018-04-30 16:21:04 +02:00
Carl Bergquist 2cc855a131 Merge branch 'master' into notification-service-refactor2 2018-04-27 16:59:14 +02:00
Torkel Ödegaard a8eed9d344 Refactoring PluginManager to be a self registering service (#11755)
* refator: refactored PluginManager to be a self registering service, a lot more work needed to fully make plugin manager use instance variables and not so many globals
2018-04-27 15:11:55 +02:00
Torkel Ödegaard df71fe33fd refactor: refactoring notification service to use new service registry hooks 2018-04-27 14:15:17 +02:00
Carl Bergquist 28f7b6dad1 Enable Grafana extensions at build time. (#11752)
* extensions: import and build

* bus: use predefined error

* enterprise: build script for enterprise packages

* poc: auto registering services and dependency injection

(cherry picked from commit b5b1ef875f905473af41e49f8071cb9028edc845)

* poc: backend services registry progress

(cherry picked from commit 97be69725881241bfbf1e7adf0e66801d6b0af3d)

* poc: minor update

(cherry picked from commit 03d7a6888b81403f458b94305792e075568f0794)

* ioc: introduce manuel ioc

* enterprise: adds setting for enterprise

* build: test and build specific ee commit

* cleanup: test testing code

* removes example hello service
2018-04-27 13:41:58 +02:00
bergquist 45d9bfca97 print to stderr since logger might not exist 2018-03-28 22:51:21 +02:00
Julian Kornberger 0a415c50d0 Make golint happier 2018-03-22 22:38:44 +01:00
Julian Kornberger 7aab6a8887 Make golint happier 2018-03-22 12:40:21 +01:00
bergquist 75a54e85dc dont spawn new subprocess while shutting down 2017-12-25 14:12:25 +01:00
bergquist 411e8a16c2 backend plugins: manage plugins lifecycle with context 2017-12-11 15:05:06 +01:00
bergquist 55a39dd2ad implement upstream changes 2017-12-11 11:14:03 +01:00
bergquist a4748d82ab Merge branch 'master' into backend_plugins
* master:
  changelog: adds note about closing #10131
  Explicitly specify default region in CloudWatch datasource (#9440)
  wait for all sub routines to finish
  changelog: adds ntoe about closing #10111
  postgres: change $__timeGroup macro to include "AS time" column alias (#10119)
  fixes broken test
  Solves problem with Github authentication restriction by organization membership when the organization's access policy is set to "Access restricted". "Access restricted" policy should not stop user to authenticate.
2017-12-11 10:43:41 +01:00
bergquist f7ed24475c wait for all sub routines to finish
simple solution for waiting for all go sub routines to
finish before closing Grafana. We would use errGroup
here as well but I dont like spreading context's all
over the place.

closes #10131
2017-12-11 08:53:06 +01:00
bergquist e1d4bf2607 kill plugin processes when grafana shuts down 2017-12-07 16:59:35 +01:00
bergquist a2d47427ba separate plugin impl and proto files 2017-12-07 16:33:36 +01:00
bergquist 3f5daa5e58 add hclog wrapper for grafanas logger in plugins 2017-12-07 16:33:36 +01:00
bergquist 0f6c470e03 add go-plugin deps to vendor 2017-12-07 16:33:36 +01:00
bergquist d69b63cbc0 dashboards as cfg: read first cfg version 2017-12-07 15:27:01 +01:00
bergquist 17bf87fb62 typo 💥 2017-12-01 14:05:47 +01:00
bergquist 7a497fd617 move systemd ready notification to server.go 2017-12-01 14:02:05 +01:00
Johannes Grassler d28ca54129 Use systemd notification where applicable
With this change in place, the grafana service will signal
readiness to serve by writing "READY=1" to the path specified
through the NOTIFY_SOCKET environment variable. If this
environment variable is not present or empty, no notification
will happen. This notification is the standard systemd
mechanism for indicating a service is ready to serve. For
Grafana this may be a couple of seconds from startup due to
database migrations. This change also adjusts the Grafana
systemd service definition to make use of this feature.
2017-12-01 10:31:58 +01:00
bergquist 6267ef1391 datasource as cfg: fixes typos 2017-11-15 14:30:32 +01:00
bergquist ebbfc529e0 datasource as cfg: support globbing 2017-11-15 14:30:32 +01:00
bergquist 665df676a5 datasource as cfg: rename feature to provisioning 2017-11-15 14:30:32 +01:00
bergquist c9bfa781fd datasource as cfg: improve name for this feature 2017-11-15 14:30:32 +01:00
bergquist 930da63173 datasource as cfg: setting for purging datasources not in cfg 2017-11-15 14:30:32 +01:00
bergquist 39b6c04643 datasource as cfg: basic implementation 2017-11-15 14:30:32 +01:00
bergquist dea631bedc tech: remove rabbitmq event publisher
closes #9645
2017-10-24 14:10:23 +02:00
bergquist a234e894bb makes jaeger tracing configurable 2017-09-18 11:08:58 +02:00
bergquist 2e350bbb8e adds basic traces using open traces 2017-09-18 11:08:58 +02:00
bergquist 6b1ae1a8a8 use internal init for settings 2017-09-14 14:26:32 +02:00
bergquist 788f677ed7 remove old internal metrics lib 2017-09-14 14:26:32 +02:00
Torkel Ödegaard 284cacf560 logging: write pid file path and pid during startup 2017-09-04 12:44:54 +02:00
Torkel Ödegaard c3cffeb10c packaging: fixed issue with pid file on systemd systems, fixes #9133 2017-09-04 10:43:04 +02:00