Commit Graph

93 Commits

Author SHA1 Message Date
Marcus Efraimsson
d093244282
sqlstore: add support for checking if error is constraint validation error 2018-09-27 13:38:22 +02:00
Šimon Podlipský
2e1db2ca93 dep ensure (#13074) 2018-08-30 07:18:09 +02:00
Mitsuhiro Tanda
077cf9a343 dep ensure 2018-07-09 13:11:50 +09:00
Marcus Efraimsson
c0830e9cde
mattn/go-sqlite3 v1.6.0 to v1.7.0 2018-06-07 16:53:39 +02:00
Marcus Efraimsson
5a96863eed
pin versions of xorm to resolve sql tests
Resolves issue with postgres tests.
Also sets timezone of test instance and database to utc to resolve
mysql tests.
Closes #12065
2018-05-28 13:07:41 +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
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
f2755982c3 tech: migrates to none deprecated mail lib
gomail is missing a maintainer so we are
switching to an active fork

ref https://github.com/go-gomail/gomail/issues/108

closes #7189
2018-03-27 21:53:46 +02:00
Daniel Lee
1cef373d16 Merge remote-tracking branch 'upstream/master' into update-xorm 2018-03-20 19:21:58 +01:00
Marcus Efraimsson
b816f18b3d fix: dep ensure. now without gofmt on ventor directory 2018-03-20 09:23:18 +01:00
Marcus Efraimsson
a2eaf3954a test 2018-03-19 14:06:05 +01:00
Daniel Lee
1c20126f87 database: update xorm to v0.6.4 and xorm core to v0.5.7 2018-03-16 00:02:50 +01:00
Marcus Efraimsson
d4beee2bb0 Merge branch 'master' into mssql_datasource 2018-03-13 16:03:02 +01:00
Marcus Efraimsson
5b35c694dc dashboard: generate and include uid in dashboard model. #7883 2018-01-30 23:18:34 +01:00
Leonard Gram
f6fac03958 tech: adds/removes in vendor folder according to dep 0.4.0. 2018-01-24 14:01:45 +01:00
bergquist
6618bff806 mysql: pin the mysql dependency 2018-01-24 11:07:57 +01:00
bergquist
d36e424fe0 tech: ignore /data folder for dep 2018-01-24 10:50:01 +01:00
bergquist
7ed643f302 remove unused code from vendor 2018-01-19 09:54:22 +01:00
bergquist
e023f79c5a migrate from govendor to dep 2018-01-19 09:48:15 +01:00
Daniel Lee
7bc7af6c39 mysql: update mysql driver to latest master
The latest master implements the ColumnType interface.

See https://github.com/go-sql-driver/mysql/issues/495

This removes the custom code in the vendor folder that
did a ColumnType mapping.
2018-01-18 11:50:16 +01:00
bergquist
b6e6935821 plugins: send secureJsonData unencrypted 2018-01-18 11:22:44 +01:00
bergquist
a183ea97bb moves datasource plugin model to grafana/grafana_plugin_model 2018-01-17 13:21:42 +01:00
bergquist
5499f4910c Merge branch 'master' into backend_plugins
* master: (117 commits)
  fix: share snapshot controller was missing ngInject comment, fixes #10511
  Use URLEncoding instead of StdEncoding to be sure state value will be corectly decoded (#10512)
  Optimize metrics and notifications docs
  Optimize cli and provisioning docs
  docs: Guide for IIS reverse proxy
  changelog: adds note about closing #9645
  telegram: Send notifications with an inline image
  telegram: Switch to using multipart form rather than JSON as a body
  telegram: Fix a typo in variable name
  fix: alert list pause/start toggle was not working properly
  fix template variable selector overlap by the panel (#10493)
  dashboard: Close/hide 'Add Panel' before saving a dashboard (#10482)
  fix: removed unused param
  Fix variables values passing when both repeat rows and panels is used (#10488)
  moved angular-mocks out of dependencies
  ux: minor change to alert list page
  ux: minor word change to alert list
  fix: updated snapshot test
  Add eu-west-3 in cloudwatch datasource default's region (#10477)
  fix: Make sure orig files are not added to git again #10289
  ...
2018-01-15 10:27:12 +01:00
Leonard Gram
ff766970dc Updates go-stack to v1.7.0.
Closes #10435
2018-01-08 15:28:47 +01:00
linux chips
dd7ab43d09 added missing cases for DATETIME datatype 2017-12-12 23:41:32 +03:00
bergquist
0f6c470e03 add go-plugin deps to vendor 2017-12-07 16:33:36 +01:00
linux chips
c75f9a1923 MSSQL Data Source 2017-12-02 14:40:12 +03:00
bergquist
39b6c04643 datasource as cfg: basic implementation 2017-11-15 14:30:32 +01:00
Sven Klemm
f8698dc49b update lib/pq (#9788) 2017-11-06 19:51:49 +01:00
bergquist
dea631bedc tech: remove rabbitmq event publisher
closes #9645
2017-10-24 14:10:23 +02:00
stuart nelson
93ac6680ab update log15 (#9622)
* Update log15 and go-isatty

* Update usage in pkg log
2017-10-23 19:57:19 +02:00
Daniel Lee
d1c9760fa8 Postgres Data Source (#9475)
* add postgresql datasource

* add rest of files for postgres datasource

* fix timeseries query, remove unused code

* consistent naming, refactoring

* s/mysql/postgres/

* s/mysql/postgres/

* couple more tests

* tests for more datatypes

* fix macros for postgres

* add __timeSec macro

* add frontend for postgres datasource

* adjust documentation

* fix formatting

* add proper plugin description

* merge editor changes from mysql

* port changes from mysql datasource

* set proper defaultQuery for postgres

* add time_sec to timeseries query
accept int for value for timeseries query

* revert allowing time_sec and handle int or float values as unix
timestamp for "time" column

* fix tslint error

* handle decimal values in timeseries query

* allow setting sslmode for postgres datasource

* use type switch for handling data types

* fix value for timeseries query

* refactor timeseries queries to make them more flexible

* remove debug statement from inner loop in type conversion

* use plain for loop in getTypedRowData

* fix timeseries queries

* adjust postgres datasource to tsdb refactoring

* adjust postgres datasource to frontend changes

* update lib/pq to latest version

* move type conversion to getTypedRowData

* handle address types cidr, inet and macaddr

* adjust response parser and docs for annotations

* convert unknown types to string

* add documentation for postgres datasource

* add another example query with metric column

* set more helpful default query

* update help text in query editor

* handle NULL in value column of timeseries query

* add __timeGroup macro

* add test for __timeGroup macro

* document __timeGroup and set proper default query for annotations

* fix typos in docs

* add postgres to list of datasources

* add postgres to builtInPlugins

* mysql: refactoring as prep for merging postgres

Refactors out the initialization of the xorm engine and the query logic
for an sql data source.

* mysql: rename refactoring + test update

* postgres:refactor to use SqlEngine(same as mysql)

Refactored to use a common base class with the MySql data source.

Other changes from the original PR:
- Changed time column to be time_sec to allow other time units in the
future and to be the same as MySQL
- Changed integration test to test the main Query method rather than
the private transformToTable method
- Changed the __timeSec macro name to __timeEpoch
- Renamed PostgresExecutor to PostgresQueryEndpoint

Fixes #9209 (the original PR)

* postgres: encrypt password on config page

With some other cosmetic changes to the config page:
- placeholder texts
- reset button for the password after it has been encrypted.
- default value for the sslmode field.

* postgres: change back col name to time from time_sec

* postgres mysql: remove annotation title

Title has been removed from annotations

* postgres: fix images for docs page

* postgres mysql: fix specs
2017-10-10 15:19:14 +02:00
bergquist
e84ff24833 adds codahale to vendor 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
d0ab028cfc remove unused deps 2017-09-15 16:11:02 +02:00
Konstantin Chukhlomin
fcdf282090 GCS support via JSON API 2017-09-15 16:11:02 +02:00
Konstantin Chukhlomin
72d7c4d620 Added GCS support #8370 2017-09-15 16:11:02 +02:00
bergquist
d6b8c6a2d2 add graphite bridge that support delta counters 2017-09-14 14:26:32 +02:00
Torkel Ödegaard
4f9fbcc211 dataproxy: added caching of datasources when doing data proxy requests, #9078 2017-08-23 13:31:26 +02:00
Torkel Ödegaard
addeccb4f0 Merge branch 'v4.4.x' 2017-08-08 16:18:08 +02:00
Torkel Ödegaard
a47b31ac62 fix: MySQL/Postgress max_idle_conn default was wrongly set to zero, which does not mean unlimited but zero, which in practice disables connection pooling, not good. now max idle conn is set to golang's default which is 2, fixes #8513 2017-08-08 16:17:52 +02:00
Mitsuhiro Tanda
91a533d948 (cloudwatch) high resolution custom metrics (#8958)
* support 1 second resolution Custom Metrics

* upgrade to aws-sdk-go v1.10.18

* simplify period calculation

* add test

* fix period calculation bug
2017-07-31 21:19:19 +02:00
Torkel Ödegaard
34cda65998 fix: png rendering api & timeout parameter now works as it should AND default render timeout increased from 30 to 60 seconds, fixes #8710 2017-07-31 16:04:04 +02:00
Torkel Ödegaard
f3980504e2 Merge branch 'master' into walmartlabs-master 2017-06-05 13:43:00 +02:00
Eirik Nygaard
1efdd92ae8 Update oauth2 lib (#8524)
* Update to latest oauth2 library using govendor

* Follow API changes
2017-06-05 10:09:27 +02:00
sanchitraizada
e6616cc551 Merge pull request #10 from walmartlabs/version-control
History and Version Control for Dashboard Updates
2017-05-25 14:50:47 -07:00
Ben Tranter
b6e46c9eb8 History and Version Control for Dashboard Updates
A simple version control system for dashboards. Closes #1504.

Goals

1. To create a new dashboard version every time a dashboard is saved.
2. To allow users to view all versions of a given dashboard.
3. To allow users to rollback to a previous version of a dashboard.
4. To allow users to compare two versions of a dashboard.

Usage

Navigate to a dashboard, and click the settings cog. From there, click
the "Changelog" button to be brought to the Changelog view. In this
view, a table containing each version of a dashboard can be seen. Each
entry in the table represents a dashboard version. A selectable
checkbox, the version number, date created, name of the user who created
that version, and commit message is shown in the table, along with a
button that allows a user to restore to a previous version of that
dashboard. If a user wants to restore to a previous version of their
dashboard, they can do so by clicking the previously mentioned button.
If a user wants to compare two different versions of a dashboard, they
can do so by clicking the checkbox of two different dashboard versions,
then clicking the "Compare versions" button located below the dashboard.
From there, the user is brought to a view showing a summary of the
dashboard differences. Each summarized change contains a link that can
be clicked to take the user a JSON diff highlighting the changes line by
line.

Overview of Changes

Backend Changes

- A `dashboard_version` table was created to store each dashboard
  version, along with a dashboard version model and structs to represent
  the queries and commands necessary for the dashboard version API
  methods.
- API endpoints were created to support working with dashboard
  versions.
- Methods were added to create, update, read, and destroy dashboard
  versions in the database.
  - Logic was added to compute the diff between two versions, and
  display it to the user.
  - The dashboard migration logic was updated to save a "Version
  1" of each existing dashboard in the database.

Frontend Changes

- New views
- Methods to pull JSON and HTML from endpoints

New API Endpoints

Each endpoint requires the authorization header to be sent in
the format,

```
Authorization: Bearer <jwt>
```

where `<jwt>` is a JSON web token obtained from the Grafana
admin panel.

`GET "/api/dashboards/db/:dashboardId/versions?orderBy=<string>&limit=<int>&start=<int>"`

Get all dashboard versions for the given dashboard ID. Accepts
three URL parameters:

- `orderBy` String to order the results by. Possible values
  are `version`, `created`, `created_by`, `message`. Default
  is `versions`. Ordering is always in descending order.
- `limit` Maximum number of results to return
- `start` Position in results to start from

`GET "/api/dashboards/db/:dashboardId/versions/:id"`

Get an individual dashboard version by ID, for the given
dashboard ID.

`POST "/api/dashboards/db/:dashboardId/restore"`

Restore to the given dashboard version. Post body is of
content-type `application/json`, and must contain.

```json
{
  "dashboardId": <int>,
  "version": <int>
}
```

`GET "/api/dashboards/db/:dashboardId/compare/:versionA...:versionB"`

Compare two dashboard versions by ID for the given
dashboard ID, returning a JSON delta formatted
representation of the diff. The URL format follows
what GitHub does. For example, visiting
[/api/dashboards/db/18/compare/22...33](http://ec2-54-80-139-44.compute-1.amazonaws.com:3000/api/dashboards/db/18/compare/22...33)
will return the diff between versions 22 and 33 for
the dashboard ID 18.

Dependencies Added

- The Go package [gojsondiff](https://github.com/yudai/gojsondiff)
  was added and vendored.
2017-05-24 19:14:39 -04:00
Torkel Ödegaard
7c50563f0f fix: fixed crash when gzip was enabled 2017-05-22 14:09:54 +02:00
Daniel Lee
b4cfb225cf tech: updates log15 vendor packages
Fixes #8262
2017-05-02 12:47:32 +02:00
Torkel Ödegaard
4720216e5e tech: upgraded macaron & macaron inject, binding, session 2017-04-25 15:16:32 +02:00