Commit Graph

676 Commits

Author SHA1 Message Date
Alban Perillat-Merceroz
f3d400f1a7 Add new Redshift metrics and dimensions for Cloudwatch datasource
AWS/Redshift has new dimensions (`latency`, `service class`, `wmlid`) and metrics (`QueriesCompletedPerSecond`, `QueryRuntimeBreakdown`, `QueryDuration`,  `WLMQueriesCompletedPerSecond`, `WLMQueryDuration`, `WLMQueueLength`) in Cloudwatch: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/rs-metricscollected.html
2018-08-02 14:45:24 +02:00
Sven Klemm
b71d10a7a4 add $__timeGroupAlias to mysql and mssql 2018-08-01 20:58:51 +02:00
Sven Klemm
dc22e24642 add compatibility code to handle pre 5.3 usage 2018-08-01 15:06:18 +02:00
Marcus Efraimsson
951679d50b
Merge pull request #12561 from activeshadow/aws-rds-burst-balance
Added BurstBalance metric to list of AWS RDS metrics.
2018-08-01 12:28:15 +02:00
Sven Klemm
42f1892826 Add $__timeGroupAlias to postgres macros 2018-08-01 09:03:34 +02:00
Sven Klemm
43295f9c18 remove alias from postgres $__timeGroup macro 2018-08-01 08:50:19 +02:00
Marcus Efraimsson
dfda51a9be
Merge pull request #12762 from sohonet/add_cloudwatch_aws_dx
add AWS/DX metrics and dimension to cloudwatch
2018-07-31 17:58:32 +02:00
Marcus Efraimsson
3cecc0b54e
Merge pull request #12301 from franciscocpg/cloudwatch-app-sync
Adding Cloudwatch AWS/AppSync metrics and dimensions
2018-07-31 11:38:31 +02:00
Jason Pereira
88d8072be3 add aws_dx to cloudwatch datasource 2018-07-30 15:51:15 +01:00
Marcus Efraimsson
38a52c2489
mssql: update tests 2018-07-30 13:50:52 +02:00
Marcus Efraimsson
e32cf75c2d
fix usage of metric column types so that you don't need to specify metric alias 2018-07-30 13:50:18 +02:00
Sven Klemm
3aa4790979 add tests for metric column prefix to mssql 2018-07-27 18:13:19 +02:00
Sven Klemm
e487fabcd5 add metric column prefix test for mysql 2018-07-27 17:59:59 +02:00
Sven Klemm
7905c29875 adjust metric prefix code to sql engine refactor 2018-07-27 15:34:04 +02:00
Sven Klemm
f9d6c88a55 add testcase for metric column as prefix 2018-07-27 15:32:54 +02:00
Marcus Efraimsson
02ba467bf1
Merge pull request #12730 from marefr/sql_refactor
SQL datasources - backend refactor
2018-07-27 14:13:19 +02:00
Marcus Efraimsson
e43feb7bfa
use const for rowlimit in sql engine 2018-07-27 13:21:40 +02:00
Marcus Efraimsson
ab8fa0de74
elasticsearch: support reversed index patterns
Now both [index-]pattern and pattern[-index] are supported
2018-07-26 21:39:02 +02:00
Marcus Efraimsson
4f7882cda2
mssql: use new sql engine 2018-07-26 18:11:10 +02:00
Marcus Efraimsson
27db454012
mysql: use new sql engine 2018-07-26 18:10:45 +02:00
Marcus Efraimsson
2f3851b915
postgres: use new sql engine 2018-07-26 18:10:17 +02:00
Marcus Efraimsson
d42cea5d42
refactor sql engine to make it hold all common code for sql datasources 2018-07-26 18:09:42 +02:00
Mitsuhiro Tanda
055d208a32 fix invalid reference 2018-07-25 11:27:43 +09:00
Marcus Efraimsson
e921f3b673
Merge pull request #12698 from mtanda/cw_400_err
CloudWatch backend return 400 if user input error
2018-07-24 16:43:22 +02:00
Marcus Efraimsson
05da21c6d7
Merge pull request #12678 from yogyrahmawan/escape_postgres_parameters
postgres; escape ssl mode parameter
2018-07-24 11:15:21 +02:00
Marcus Efraimsson
93e73919e8
fix code style 2018-07-24 11:03:46 +02:00
Mitsuhiro Tanda
d9bf894383 return 400 if user input error 2018-07-24 17:06:55 +09:00
Daniel Lee
5129ea8f87
Merge pull request #11624 from mtanda/cw_get_metric_data
CloudWatch GetMetricData support
2018-07-22 21:34:07 +02:00
yogyrahmawan
26aa575cb4 escaping ssl mode on postgres param 2018-07-22 08:04:57 +07:00
Torkel Ödegaard
e413f026b9
fix: postgres/mysql engine cache was not being used, fixes #12636 (#12642) 2018-07-18 07:21:32 -07:00
Torkel Ödegaard
c6bcf13d78
Devenv testdata dashboards (#12615)
* devenv: working on dev env setup & dashboards

* devenv: refactored testdata app to a built in datasource instead, and moved dashboards to a devenv provisioned dashboards
2018-07-16 03:12:13 -07:00
Bryan T. Richardson
daf0c374b3 Added BurstBalance metric to list of AWS RDS metrics. 2018-07-10 10:11:39 -06:00
yogy rahmawan
8b32dc5847 move go vet out of scripts and fixing warning (#12552) 2018-07-09 23:25:32 -07:00
Mitsuhiro Tanda
77220456b6 improve error message 2018-07-09 13:11:50 +09:00
Mitsuhiro Tanda
40ed235b3b support GetMetricData 2018-07-09 13:11:50 +09:00
Marcus Efraimsson
d90d4ce55d
Merge pull request #12402 from AustinWinstanley/macros/sql
mysql,mssql: improve $__timeFilter, $__timeFrom, $__timeTo macros

The $__timeFilter macro now uses a BETWEEN with timestamps instead of 
comparing epochs
The $__timeFrom and $__timeTo macros now return strings of format 
YYYY-MM-DDThh:mm:ssZ instead of epoch
2018-07-04 20:01:43 +02:00
Marcus Efraimsson
d2f31a716f
remove unnecessary conversions 2018-07-04 12:16:39 +02:00
Sven Klemm
1601f6d17c [mysql] fix $__timeGroup rounding (#12469)
* fix $__timeGroup rounding for mysql

* revert accidentally commented out line
2018-07-01 06:59:05 -07:00
Sven Klemm
f017c04a65 [mssql] fix $__timeGroup rounding (#12470)
* fix $__timeGroup rounding for mssql

* revert enabling of mssql integration tests
2018-07-01 06:57:02 -07:00
Sven Klemm
c2c22c142b [postgres] fix timeGroup macro rounding (#12468)
* fix timeGroup tests to check for correct grouping

* do explicit floor rounding in $__timeGroup macro

* fix typo in comments
2018-07-01 06:55:46 -07:00
Austin Winstanley
a0e8437f8f Used PostgreSQL TSDB as a model the set up the __timeFilter, __timeFrom, and __timeTo macros for Microsoft SQL and MySQL 2018-06-29 03:48:14 +00:00
Austin Winstanley
105b3d6804 Switched MySQL and MSSQL macros for timeFilter and related to use BETWEEN and calculate UNIX time server side instead of database side. Fixes #11618 #11619 2018-06-25 20:11:58 +00:00
Marcus Efraimsson
c02dd7462a
cloudwatch: handle invalid time range 2018-06-15 15:48:25 +02:00
Francisco Guimarães
acdc2bf100 Adding Cloudwatch AWS/AppSync metrics and dimensions 2018-06-15 10:11:32 -03:00
bergquist
c63533f004 tests: rewrite into table tests 2018-06-14 20:33:36 +02:00
bergquist
bf4ee9bcc6 influxdb: adds mode func to backend
closes #12286
2018-06-14 20:33:22 +02:00
Sławek Piotrowski
9db964bf35 Fix typo: eleasticsearch -> elasticsearch (#12184) 2018-06-06 13:09:16 -07:00
Marcus Efraimsson
38906acda9
elasticsearch: sort bucket keys to fix issue wth response parser tests 2018-06-04 15:15:47 +02:00
Marcus Efraimsson
b8ff3b1e3f
remove dead code 2018-05-31 19:05:32 +02:00
Marcus Efraimsson
dcac63936b
elasticsearch: minor refactor
Handle all replacements if interval template variables in the client.
Fix issue with client and different versions.
Adds better tests of the client
2018-05-31 19:02:20 +02:00
Marcus Efraimsson
28f0acd854
Merge branch 'master' into feature/add_es_alerting 2018-05-31 16:33:07 +02:00
Leonard Gram
50d1519a91 build: mysql integration testing on ci. 2018-05-30 16:27:47 +02:00
Kim Christensen
48fc5edda1 Support InfluxDB count distinct aggregation (#11658)
influxdb: support count distinct aggregation
2018-05-30 09:22:16 +02:00
Marcus Efraimsson
048ac3089b
Merge branch 'master' into feature/add_es_alerting 2018-05-29 14:36:52 +02:00
Christophe Le Guern
3ba3fd9a59 Add new regions to handleGetRegions function (#12082)
As public/app/plugins/datasource/cloudwatch/partials/config.html and this file differ between the AWS regions available, I've updated the latest so they share the same data.
In that way, the regions() method in dashboards returns the same list as the frontend does.
2018-05-29 14:26:33 +02:00
Leonard Gram
e6f2811b21 sql: seconds epochs are now correctly converted to ms.
Closes #12061
2018-05-29 08:44:03 +02:00
Marcus Efraimsson
4752d7884a
elasticsearch: adds some more/better debug logging to client 2018-05-25 10:31:56 +02:00
Marcus Efraimsson
16c3566a87
elasticsearch: handle NaN values 2018-05-23 22:57:46 +02:00
Marcus Efraimsson
688f5b830c
elasticsearch: metric and pipeline agg setting json encoding fix 2018-05-23 22:21:41 +02:00
Marcus Efraimsson
4436b8da12
elasticsearch: query interval override fix 2018-05-23 22:07:52 +02:00
Marcus Efraimsson
8870e3e85b
elasticsearch: default interval fix
5s instead of 15s
2018-05-23 21:44:09 +02:00
Marcus Efraimsson
242689abe2
elasticsearch: pipeline aggregation fix for json encoding 2018-05-23 16:46:26 +02:00
Marcus Efraimsson
dce59ccff2
fix: remove deadcode to make gometalinter happy 2018-05-23 15:28:36 +02:00
Marcus Efraimsson
4840adff00
elasticsearch: refactor query handling and use new es simple client
Removes moment dependency.
Adds response parser tests (based on frontend tests).
Adds time series query tests (based on frontend tests).
Fixes various issues related to response parsing and building search request queries.
Added support for extended stats metrics and geo hash grid aggregations.
2018-05-23 15:09:58 +02:00
Marcus Efraimsson
e171ed8910
elasticsearch: new simple client for communicating with elasticsearch
Handles minor differences of es 2, 5 and 5.6.
Implements index pattern logic.
Exposes builders for building search requests.
2018-05-23 14:59:12 +02:00
Marcus Efraimsson
77400cef08
elasticsearch: refactor and cleanup
Move time series query logic to specific file.
Remove model parser and move to time series query file, adds parser test.
2018-05-23 14:36:41 +02:00
Marcus Efraimsson
99257eb048
Merge branch 'master' of git://github.com/grafana/grafana into WPH95-feature/add_es_alerting 2018-05-03 12:03:04 +02:00
Marcus Efraimsson
de0d409a23
Revert "Opportunities to unindent code (unindent)" 2018-05-02 14:06:46 +02:00
Carl Bergquist
6ed69e3d93
Merge pull request #11775 from knweiss/unindent
Opportunities to unindent code (unindent)
2018-05-01 16:03:06 +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
Karsten Weiss
893a91af3a Use opportunities to unindent code (unindent)
This commit fixes the following unindent findings:
pkg/api/common.go:102:2: "if x { if y" should be "if x && y"
pkg/components/dynmap/dynmap.go:642:2: invert condition and early return
pkg/components/dynmap/dynmap.go:681:2: invert condition and early return
pkg/components/simplejson/simplejson.go:171:2: "if x { if y" should be "if x && y"
pkg/middleware/dashboard_redirect.go:42:3: invert condition and early return
pkg/tsdb/mssql/mssql.go:301:3: invert condition and early break
pkg/tsdb/mysql/mysql.go:312:3: invert condition and early break
pkg/tsdb/postgres/postgres.go:292:3: invert condition and early break
pkg/tsdb/sql_engine.go:144:2: invert condition and early return
2018-04-28 10:53:16 +02:00
Karsten Weiss
de8696d5d3 Outdent code after if block that ends with return (golint)
This commit fixes the following golint warnings:
pkg/bus/bus.go:64:9: if block ends with a return statement, so drop this else and outdent its block
pkg/bus/bus.go:84:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:137:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:177:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:183:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:199:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:208:9: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/components/dynmap/dynmap.go:236:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:242:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:257:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:263:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:278:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:284:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:299:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:331:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:350:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:356:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:366:12: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:390:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:396:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:405:12: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:427:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:433:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:442:12: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:459:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:465:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:474:12: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:491:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:497:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:506:12: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:523:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:529:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:538:12: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:555:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:561:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:570:12: if block ends with a return statement, so drop this else and outdent its block
pkg/login/ldap.go:55:11: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/login/ldap_test.go:372:10: if block ends with a return statement, so drop this else and outdent its block
pkg/middleware/middleware_test.go:213:12: if block ends with a return statement, so drop this else and outdent its block
pkg/plugins/dashboard_importer.go:153:11: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/plugins/dashboards_updater.go:39:9: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/plugins/dashboards_updater.go:121:10: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/plugins/plugins.go:210:9: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/plugins/plugins.go:235:9: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/services/alerting/eval_context.go:111:9: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/services/alerting/notifier.go:92:9: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/services/alerting/notifier.go:98:9: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/services/alerting/notifier.go:122:10: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/services/alerting/rule.go:108:10: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/services/alerting/rule.go:118:10: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/services/alerting/rule.go:121:11: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/services/alerting/notifiers/telegram.go:94:10: if block ends with a return statement, so drop this else and outdent its block
pkg/services/sqlstore/annotation.go:34:11: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/services/sqlstore/annotation.go:99:11: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/services/sqlstore/dashboard_test.go:107:13: if block ends with a return statement, so drop this else and outdent its block
pkg/services/sqlstore/plugin_setting.go:78:10: if block ends with a return statement, so drop this else and outdent its block
pkg/services/sqlstore/preferences.go:91:10: if block ends with a return statement, so drop this else and outdent its block
pkg/services/sqlstore/user.go:50:10: if block ends with a return statement, so drop this else and outdent its block
pkg/services/sqlstore/migrator/migrator.go:106:11: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/services/sqlstore/migrator/postgres_dialect.go:48:10: if block ends with a return statement, so drop this else and outdent its block
pkg/tsdb/time_range.go:59:9: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/tsdb/time_range.go:67:9: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/tsdb/cloudwatch/metric_find_query.go:225:9: if block ends with a return statement, so drop this else and outdent its block
pkg/util/filepath.go:68:11: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
2018-04-27 23:10:43 +02:00
Karsten Weiss
b7adf28501 Remove redundancy in variable declarations (golint)
This commit fixes the following golint warnings:
pkg/api/avatar/avatar.go:229:12: should omit type *http.Client from declaration of var client; it will be inferred from the right-hand side
pkg/login/brute_force_login_protection.go:13:26: should omit type time.Duration from declaration of var loginAttemptsWindow; it will be inferred from the right-hand side
pkg/metrics/graphitebridge/graphite.go:58:26: should omit type []string from declaration of var metricCategoryPrefix; it will be inferred from the right-hand side
pkg/metrics/graphitebridge/graphite.go:69:22: should omit type []string from declaration of var trimMetricPrefix; it will be inferred from the right-hand side
pkg/models/alert.go:37:36: should omit type error from declaration of var ErrCannotChangeStateOnPausedAlert; it will be inferred from the right-hand side
pkg/models/alert.go:38:36: should omit type error from declaration of var ErrRequiresNewState; it will be inferred from the right-hand side
pkg/models/datasource.go:61:28: should omit type map[string]bool from declaration of var knownDatasourcePlugins; it will be inferred from the right-hand side
pkg/plugins/update_checker.go:16:13: should omit type http.Client from declaration of var httpClient; it will be inferred from the right-hand side
pkg/services/alerting/engine.go:103:24: should omit type time.Duration from declaration of var unfinishedWorkTimeout; it will be inferred from the right-hand side
pkg/services/alerting/engine.go:105:19: should omit type time.Duration from declaration of var alertTimeout; it will be inferred from the right-hand side
pkg/services/alerting/engine.go:106:19: should omit type int from declaration of var alertMaxAttempts; it will be inferred from the right-hand side
pkg/services/alerting/notifier.go:143:23: should omit type map[string]*NotifierPlugin from declaration of var notifierFactories; it will be inferred from the right-hand side
pkg/services/alerting/rule.go:136:24: should omit type map[string]ConditionFactory from declaration of var conditionFactories; it will be inferred from the right-hand side
pkg/services/alerting/conditions/evaluator.go:12:15: should omit type []string from declaration of var defaultTypes; it will be inferred from the right-hand side
pkg/services/alerting/conditions/evaluator.go:13:15: should omit type []string from declaration of var rangedTypes; it will be inferred from the right-hand side
pkg/services/alerting/notifiers/opsgenie.go:44:19: should omit type string from declaration of var opsgenieAlertURL; it will be inferred from the right-hand side
pkg/services/alerting/notifiers/pagerduty.go:43:23: should omit type string from declaration of var pagerdutyEventApiUrl; it will be inferred from the right-hand side
pkg/services/alerting/notifiers/telegram.go:21:17: should omit type string from declaration of var telegramApiUrl; it will be inferred from the right-hand side
pkg/services/provisioning/dashboards/config_reader_test.go:11:24: should omit type string from declaration of var simpleDashboardConfig; it will be inferred from the right-hand side
pkg/services/provisioning/dashboards/config_reader_test.go:12:24: should omit type string from declaration of var oldVersion; it will be inferred from the right-hand side
pkg/services/provisioning/dashboards/config_reader_test.go:13:24: should omit type string from declaration of var brokenConfigs; it will be inferred from the right-hand side
pkg/services/provisioning/dashboards/file_reader.go:22:30: should omit type time.Duration from declaration of var checkDiskForChangesInterval; it will be inferred from the right-hand side
pkg/services/provisioning/dashboards/file_reader.go:24:23: should omit type error from declaration of var ErrFolderNameMissing; it will be inferred from the right-hand side
pkg/services/provisioning/datasources/config_reader_test.go:15:34: should omit type string from declaration of var twoDatasourcesConfig; it will be inferred from the right-hand side
pkg/services/provisioning/datasources/config_reader_test.go:16:34: should omit type string from declaration of var twoDatasourcesConfigPurgeOthers; it will be inferred from the right-hand side
pkg/services/provisioning/datasources/config_reader_test.go:17:34: should omit type string from declaration of var doubleDatasourcesConfig; it will be inferred from the right-hand side
pkg/services/provisioning/datasources/config_reader_test.go:18:34: should omit type string from declaration of var allProperties; it will be inferred from the right-hand side
pkg/services/provisioning/datasources/config_reader_test.go:19:34: should omit type string from declaration of var versionZero; it will be inferred from the right-hand side
pkg/services/provisioning/datasources/config_reader_test.go:20:34: should omit type string from declaration of var brokenYaml; it will be inferred from the right-hand side
pkg/services/sqlstore/stats.go:16:25: should omit type time.Duration from declaration of var activeUserTimeLimit; it will be inferred from the right-hand side
pkg/services/sqlstore/migrator/mysql_dialect.go:69:14: should omit type bool from declaration of var hasLen1; it will be inferred from the right-hand side
pkg/services/sqlstore/migrator/mysql_dialect.go:70:14: should omit type bool from declaration of var hasLen2; it will be inferred from the right-hand side
pkg/services/sqlstore/migrator/postgres_dialect.go:95:14: should omit type bool from declaration of var hasLen1; it will be inferred from the right-hand side
pkg/services/sqlstore/migrator/postgres_dialect.go:96:14: should omit type bool from declaration of var hasLen2; it will be inferred from the right-hand side
pkg/setting/setting.go:42:15: should omit type string from declaration of var Env; it will be inferred from the right-hand side
pkg/setting/setting.go:161:18: should omit type bool from declaration of var LdapAllowSignup; it will be inferred from the right-hand side
pkg/setting/setting.go:473:30: should omit type bool from declaration of var skipStaticRootValidation; it will be inferred from the right-hand side
pkg/tsdb/interval.go:14:21: should omit type time.Duration from declaration of var defaultMinInterval; it will be inferred from the right-hand side
pkg/tsdb/interval.go:15:21: should omit type time.Duration from declaration of var year; it will be inferred from the right-hand side
pkg/tsdb/interval.go:16:21: should omit type time.Duration from declaration of var day; it will be inferred from the right-hand side
pkg/tsdb/cloudwatch/credentials.go:26:24: should omit type map[string]cache from declaration of var awsCredentialCache; it will be inferred from the right-hand side
pkg/tsdb/influxdb/query.go:15:27: should omit type *regexp.Regexp from declaration of var regexpOperatorPattern; it will be inferred from the right-hand side
pkg/tsdb/influxdb/query.go:16:27: should omit type *regexp.Regexp from declaration of var regexpMeasurementPattern; it will be inferred from the right-hand side
pkg/tsdb/mssql/mssql_test.go:25:14: should omit type string from declaration of var serverIP; it will be inferred from the right-hand side
2018-04-27 22:14:36 +02:00
Marcus Efraimsson
1452634a2a
mssql: fix value columns conversion to float when using timeseries query 2018-04-24 19:54:08 +02:00
Marcus Efraimsson
cf43007531
postgres: fix value columns conversion to float when using timeseries query 2018-04-24 19:53:36 +02:00
Marcus Efraimsson
346577b664
mysql: fix value columns conversion to float when using timeseries query 2018-04-24 19:53:06 +02:00
Marcus Efraimsson
76bd2aea44
sql datasource: extract common logic for converting value column to float 2018-04-24 19:50:14 +02:00
Mario Trangoni
556219b192 pkg/tsdb: fix ineffassign isues 2018-04-22 20:51:58 +02:00
Carl Bergquist
8367199a2d
Merge pull request #11613 from knweiss/gosimple
Code simplification (gosimple)
2018-04-17 22:40:40 +02:00
Carl Bergquist
ea56288f4a
Merge pull request #11611 from mjtrangoni/fix-unconvert-issues
fix unconvert issues
2018-04-17 09:06:39 +02:00
Sven Klemm
5dc36afe71 calculate datetime for timeFrom and timeTo macro in go 2018-04-16 23:02:24 +02:00
Karsten Weiss
ed46efa081 Use sort.Strings() (gosimple)
This fixes:
pkg/tsdb/cloudwatch/metric_find_query.go:257:2: should use sort.Strings(...) instead of sort.Sort(sort.StringSlice(...)) (S1032)
pkg/tsdb/cloudwatch/metric_find_query.go:286:2: should use sort.Strings(...) instead of sort.Sort(sort.StringSlice(...)) (S1032)
pkg/tsdb/cloudwatch/metric_find_query.go:315:2: should use sort.Strings(...) instead of sort.Sort(sort.StringSlice(...)) (S1032)
2018-04-16 21:04:57 +02:00
Karsten Weiss
25bb0b5569 Remove unused return value assignment (gosimple)
This fixes:
pkg/tsdb/sql_engine.go:54:6: should write version := engineCache.versions[dsInfo.Id] instead of version, _ := engineCache.versions[dsInfo.Id] (S1005)
2018-04-16 21:04:57 +02:00
Karsten Weiss
5d95601720 Merge variable declaration with assignment (gosimple)
This fixes:
pkg/cmd/grafana-cli/commands/upgrade_all_command.go:56:3: should merge variable declaration with assignment on next line (S1021)
pkg/login/ldap.go:406:4: should merge variable declaration with assignment on next line (S1021)
pkg/services/sqlstore/migrator/dialect.go:87:2: should merge variable declaration with assignment on next line (S1021)
pkg/services/sqlstore/migrator/dialect.go:165:2: should merge variable declaration with assignment on next line (S1021)
pkg/tsdb/cloudwatch/metric_find_query_test.go:185:2: should merge variable declaration with assignment on next line (S1021)
2018-04-16 21:04:57 +02:00
Karsten Weiss
f61e69ce75 Simplify comparison to bool constant (gosimple)
This fixes:
build.go:553:6: should omit comparison to bool constant, can be simplified to !strings.Contains(path, ".sha256") (S1002)
pkg/cmd/grafana-cli/commands/ls_command.go:27:5: should omit comparison to bool constant, can be simplified to !pluginDirInfo.IsDir() (S1002)
pkg/components/dynmap/dynmap_test.go:24:5: should omit comparison to bool constant, can be simplified to !value (S1002)
pkg/components/dynmap/dynmap_test.go:122:14: should omit comparison to bool constant, can be simplified to b (S1002)
pkg/components/dynmap/dynmap_test.go:125:14: should omit comparison to bool constant, can be simplified to !b (S1002)
pkg/components/dynmap/dynmap_test.go:128:14: should omit comparison to bool constant, can be simplified to !b (S1002)
pkg/models/org_user.go:51:5: should omit comparison to bool constant, can be simplified to !(*r).IsValid() (S1002)
pkg/plugins/datasource/wrapper/datasource_plugin_wrapper_test.go:77:12: should omit comparison to bool constant, can be simplified to !haveBool (S1002)
pkg/services/alerting/conditions/evaluator.go:23:9: should omit comparison to bool constant, can be simplified to !reducedValue.Valid (S1002)
pkg/services/alerting/conditions/evaluator.go:48:5: should omit comparison to bool constant, can be simplified to !reducedValue.Valid (S1002)
pkg/services/alerting/conditions/evaluator.go:91:5: should omit comparison to bool constant, can be simplified to !reducedValue.Valid (S1002)
pkg/services/alerting/conditions/query.go:56:6: should omit comparison to bool constant, can be simplified to !reducedValue.Valid (S1002)
pkg/services/alerting/extractor.go:107:20: should omit comparison to bool constant, can be simplified to !enabled.MustBool() (S1002)
pkg/services/alerting/notifiers/telegram.go:222:41: should omit comparison to bool constant, can be simplified to this.UploadImage (S1002)
pkg/services/sqlstore/apikey.go:58:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/apikey.go:72:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/dashboard.go:66:33: should omit comparison to bool constant, can be simplified to !cmd.Overwrite (S1002)
pkg/services/sqlstore/dashboard.go:175:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/dashboard.go:311:13: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/dashboard.go:444:12: should omit comparison to bool constant, can be simplified to !exists (S1002)
pkg/services/sqlstore/dashboard.go:472:12: should omit comparison to bool constant, can be simplified to !exists (S1002)
pkg/services/sqlstore/dashboard.go:554:32: should omit comparison to bool constant, can be simplified to !cmd.Overwrite (S1002)
pkg/services/sqlstore/dashboard_snapshot.go:83:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/plugin_setting.go:39:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/quota.go:34:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/quota.go:111:6: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/quota.go:136:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/quota.go:213:6: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/temp_user.go:129:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/user.go:157:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/user.go:182:5: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/user.go:191:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/user.go:212:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/user.go:307:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/social/generic_oauth.go:185:5: should omit comparison to bool constant, can be simplified to !s.extractToken(&data, token) (S1002)
pkg/tsdb/mssql/mssql.go:148:39: should omit comparison to bool constant, can be simplified to ok (S1002)
pkg/tsdb/mssql/mssql.go:212:6: should omit comparison to bool constant, can be simplified to !query.Model.Get("fillNull").MustBool(false) (S1002)
pkg/tsdb/mssql/mssql.go:247:56: should omit comparison to bool constant, can be simplified to ok (S1002)
pkg/tsdb/mssql/mssql.go:274:7: should omit comparison to bool constant, can be simplified to !exist (S1002)
pkg/tsdb/mssql/mssql.go:282:8: should omit comparison to bool constant, can be simplified to !exist (S1002)
pkg/tsdb/mysql/mysql.go:221:6: should omit comparison to bool constant, can be simplified to !query.Model.Get("fillNull").MustBool(false) (S1002)
pkg/tsdb/mysql/mysql.go:256:56: should omit comparison to bool constant, can be simplified to ok (S1002)
pkg/tsdb/mysql/mysql.go:283:7: should omit comparison to bool constant, can be simplified to !exist (S1002)
pkg/tsdb/mysql/mysql.go:291:8: should omit comparison to bool constant, can be simplified to !exist (S1002)
pkg/tsdb/postgres/postgres.go:134:39: should omit comparison to bool constant, can be simplified to ok (S1002)
pkg/tsdb/postgres/postgres.go:201:6: should omit comparison to bool constant, can be simplified to !query.Model.Get("fillNull").MustBool(false) (S1002)
pkg/tsdb/postgres/postgres.go:236:56: should omit comparison to bool constant, can be simplified to ok (S1002)
pkg/tsdb/postgres/postgres.go:263:7: should omit comparison to bool constant, can be simplified to !exist (S1002)
pkg/tsdb/postgres/postgres.go:271:8: should omit comparison to bool constant, can be simplified to !exist (S1002)
2018-04-16 21:04:57 +02:00
Karsten Weiss
be2d635078 Simplify error returns (gosimple)
This fixes:
pkg/api/avatar/avatar.go:261:2: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/log/file.go:102:2: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/metrics/graphitebridge/graphite.go:298:2: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/provisioning/provisioning.go:23:2: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/alert_notification.go:27:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/alert_notification.go:27:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/annotation.go:105:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/annotation.go:105:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/dashboard.go:351:2: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/dashboard.go:435:2: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/dashboard_acl.go:38:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/dashboard_acl.go:38:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/stats.go:22:2: 'if err != nil { return err }; return err' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/team.go:213:2: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/user.go:256:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/user.go:256:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/user.go:274:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/user.go:274:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/user.go:482:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/user.go:482:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
2018-04-16 21:04:57 +02:00
Karsten Weiss
c5a09a3dc1 Remove redundant break statements (gosimple)
This fixes:
pkg/components/dynmap/dynmap.go:588:3: redundant break statement (S1023)
pkg/components/dynmap/dynmap.go:610:3: redundant break statement (S1023)
pkg/components/dynmap/dynmap.go:641:3: redundant break statement (S1023)
pkg/components/dynmap/dynmap.go:690:3: redundant break statement (S1023)
pkg/components/dynmap/dynmap.go:712:3: redundant break statement (S1023)
pkg/components/dynmap/dynmap.go:749:3: redundant break statement (S1023)
pkg/components/dynmap/dynmap.go:785:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/cloudwatch.go:74:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/cloudwatch.go:77:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/cloudwatch.go:82:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/metric_find_query.go:178:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/metric_find_query.go:181:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/metric_find_query.go:184:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/metric_find_query.go:187:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/metric_find_query.go:190:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/metric_find_query.go:193:3: redundant break statement (S1023)
pkg/tsdb/cloudwatch/metric_find_query.go:196:3: redundant break statement (S1023)
2018-04-16 21:04:57 +02:00
Mario Trangoni
ce941a004d fix unconvert issues 2018-04-16 20:04:58 +02:00
Sven Klemm
a2a7d3d436 add GetFromAsTimeUTC and GetToAsTimeUTC and use them in timeFilter macro 2018-04-16 19:38:35 +02:00
Sven Klemm
7ab0a54f4b Merge remote-tracking branch 'upstream/master' into postgres-timefilter-macro 2018-04-16 19:23:08 +02:00
Daniel Lee
9337972a0f sqlds: fix text in comments for tests 2018-04-16 12:55:27 +02:00
Daniel Lee
ee303c03e9
Merge pull request #11550 from grafana/sql_ts_precision
sql tsdb: fix precision and data type support for time columns
2018-04-16 11:04:46 +02:00
Daniel Lee
67daa9b058
Merge pull request #11588 from mjtrangoni/fix-codespell-issues
Fix codespell issues
2018-04-16 09:12:49 +02:00
Sven Klemm
6d3da9a73d remove postgresversion and convert unix timestamp in go 2018-04-15 22:14:13 +02:00
Sven Klemm
9b61ffb48a make timefilter macro aware of pg version 2018-04-15 18:38:20 +02:00
Mario Trangoni
91fb2e07ce pkg: fix codespell issues 2018-04-13 20:31:29 +02:00
Marcus Efraimsson
a86ee304ff
tsdb: remove unnecessary type casts in sql data sources macro engines 2018-04-12 19:08:35 +02:00
Marcus Efraimsson
f5586b1270
tsdb: sql data sources should handle time ranges before epoch start correctly 2018-04-12 18:53:12 +02:00
Marcus Efraimsson
6cb891dca8
mysql: use a datetime column with microsecond precision in test 2018-04-10 16:37:39 +02:00
Marcus Efraimsson
97f67ddcb8
tsdb: improved floating point support when converting sql time column to epoch (ms) 2018-04-10 16:36:00 +02:00
Marcus Efraimsson
9d84e6f31f
mssql: fix precision for time columns in time series query mode 2018-04-10 11:10:56 +02:00
Marcus Efraimsson
0317ecbf0d
postgres: support running multiple postgres integration tests
Makes it possible to run mysql integration tests for both
grafana config db and tsdb at the same time using
GRAFANA_TEST_DB=postgres go test ./pkg/...
2018-04-10 11:08:30 +02:00
Marcus Efraimsson
1783c534fd
postgres: fix precision for time columns in time series query mode 2018-04-10 11:07:01 +02:00
Marcus Efraimsson
af62646624
mysql: fix precision for time columns in time series query mode 2018-04-10 11:01:43 +02:00
Marcus Efraimsson
5c120c2c11
mysql: mysql tests should use a db server with UTC
To get rid of issues involving date/time when testing.
Also, makes it possible to run mysql integration tests for both
grafana config db and tsdb at the same time using
GRAFANA_TEST_DB=mysql go test ./pkg/...
2018-04-10 10:58:45 +02:00
Marcus Efraimsson
a314890f89
tsdb: add support for more data types when converting sql time column to epoch (ms) 2018-04-10 10:33:23 +02:00
ryan
1c9ebd5bd8 fix test 2018-04-09 14:01:09 +02:00
ryan
920a0c4fec skip mssql fix 2018-04-09 13:49:13 +02:00
ryan
7d6c8aa612 add mssql and mysql 2018-04-09 13:34:35 +02:00
ryan
113bfb3d3e don't convert to uint64 2018-04-09 13:28:32 +02:00
Penghan Wang
fbed72c89c
Merge branch 'master' into feature/add_es_alerting 2018-04-09 14:00:28 +08:00
wph95
4050fce220
add response_parser test 2018-03-28 12:35:05 +08:00
wph95
06f7332156
cleanup and add more test 2018-03-28 01:42:25 +08:00
wph95
4042e4b225
fix a terms bug and add test 2018-03-27 02:12:43 +08:00
Penghan Wang
a21afbe9a6
Merge branch 'master' into feature/add_es_alerting 2018-03-26 19:51:03 +08:00
wph95
63a200686e
- pipeline aggs support
- add some test
2018-03-26 19:48:57 +08:00
wph95
d6cdc2497c
Handle Interval Date Format similar to the JS variant
7e14e272fa
2018-03-26 16:13:14 +08:00
wph95
1e275d0cd1
set right series name
Signed-off-by: wph95 <wph657856467@gmail.com>
2018-03-25 02:18:28 +08:00
wph95
bc5b59737c
finished CODING PHASE 1
Signed-off-by: wph95 <wph657856467@gmail.com>
2018-03-24 13:06:21 +08:00
Carl Bergquist
980e078222
Merge pull request #11326 from bergquist/more_traces
dataproxy: adds dashboardid and panelid as tags
2018-03-23 17:13:15 +01:00
wph95
8e7d23cdeb
wip
Signed-off-by: wph95 <wph657856467@gmail.com>
2018-03-23 23:50:16 +08:00
Marcus Efraimsson
f0f41c2a8e mysql: skip tests by default 2018-03-22 16:44:55 +01:00
Marcus Efraimsson
f5654f88e2 mysql: fix precision for the time column in table/annotation query mode
Use the ConvertSqlTimeColumnToEpochMs function to convert any native
datetime data type or epoch time (millisecond precision).
Refactored mysql implementation to make it more similar to postgres
and mssql implementations.
Added $__timeEpoch macro function with same implementation as $__time.
Added possibility to use a time column named time in addition to
the currectly supported time_sec.
Additional tests and update of existing.
Added test dashboard.
2018-03-22 15:40:46 +01:00
Marcus Efraimsson
66c03f84f5 postgres: fix precision for the time column in table/annotation query mode
Use the ConvertSqlTimeColumnToEpochMs function to convert any native
datetime data type or epoch time (millisecond precision).
Additional tests and update of existing due to timezone issues
running postgres on UTC and dev environment on non-utc.
Added test dashboard.
2018-03-22 15:32:33 +01:00
Marcus Efraimsson
b69ebee066 mssql: fix precision for the time column in table/annotation query mode
Use the ConvertSqlTimeColumnToEpochMs function to convert any native
datetime data type or epoch time (millisecond precision).
Additional tests and update of existing due to timezone issues
running MSSQL on UTC and dev environment on non-utc.
Update stored procedures test to handle more parameters.
Update test dashboard.
2018-03-22 15:23:12 +01:00
Marcus Efraimsson
b0076d4f65 mssql: remove UTC conversion in macro functions
Removes the macro function . Macro functions should not do UTC/timezone conversion - they should
work in the same way as postgres and mysql datasource implementations.
Grafana and Microsft SQL Server should be run on servers with UTC timezones.
2018-03-22 14:55:44 +01:00
Marcus Efraimsson
3ccadff800 mssql: fix timeGroup macro so that it properly creates correct groups
Earlier the division of interval was done using whole numbers resulting in that important information
was lost/too many time series merged to the same group. Now using division of floating point and rounding
up to solve the problem
2018-03-22 14:49:40 +01:00
bergquist
519fd8b2ba graphite: adds more traces for alerting 2018-03-21 13:16:59 +01:00
Marcus Efraimsson
3cb0bc3da1 sql datasource: extract common logic for converting time column to epoch time in ms 2018-03-21 11:20:15 +01:00
Daniel Lee
e5e9d3c2f3 mssql: adds test for time should be ms in table mode 2018-03-20 14:42:29 +01:00
Daniel Lee
ae4c6e4648 mssql: fix precision for time column in table mode
ref #11306
2018-03-20 12:59:40 +01:00
Marcus Efraimsson
192e913b7b mssql: add integration test to verify stored procedure usage 2018-03-19 19:56:34 +01:00
Marcus Efraimsson
8f6626e805 mssql: encrypt password in database 2018-03-19 17:32:51 +01:00
Marcus Efraimsson
449a307575 mssql: remove dynamic construction of metric column and other columns
This seems like a niche feature which can be solved by defining multiple queries. In the future
we'll probably add support for defining series name by alias field similar to how other datasources
have solved that, e.g. prometheus.
2018-03-19 17:14:01 +01:00
Marcus Efraimsson
d14946a135 mssql: cleanup and minor refactor 2018-03-19 13:32:04 +01:00
Marcus Efraimsson
24c0f28f41 mssql: allow host without port and fallback to default port 1433 2018-03-19 13:24:31 +01:00
Marcus Efraimsson
e97b03e930 mssql: additional integration tests
Metric query of table having multiple value columns
Annotation query
2018-03-16 14:42:54 +01:00
Marcus Efraimsson
f0f8006d8d mssql: support money, smallmoney and decimal data types 2018-03-16 14:37:16 +01:00
Marcus Efraimsson
9144701fcc mssql: disable mssql integration tests per default 2018-03-15 15:27:31 +01:00
Leonard Gram
3b03dce3c2 mssql: timeGroup fill support added. 2018-03-15 15:06:54 +01:00
Marcus Efraimsson
faf9e3f722 mssql: add timeGroup integration test 2018-03-15 14:26:53 +01:00
Leonard Gram
571556e1d8 mssql: adds fill to timeGroup macro. 2018-03-15 13:11:26 +01:00
Marcus Efraimsson
3d0f97aab9 mssql datasource: wip 2018-03-15 09:51:29 +01:00
Marcus Efraimsson
c87752102a mssql datasource: support for timeGroup macro function 2018-03-13 22:49:49 +01:00
Marcus Efraimsson
57d46a706c mssql datasource: additional data type tests 2018-03-13 19:54:29 +01:00
Marcus Efraimsson
d4beee2bb0 Merge branch 'master' into mssql_datasource 2018-03-13 16:03:02 +01:00
Carl Bergquist
a589f701ad
Merge pull request #10925 from mtanda/cw_high_resolution
(cloudwatch) support high resolution query
2018-03-08 18:06:08 +01:00
Mitsuhiro Tanda
eecbdc89eb fix, set default highResolution setting 2018-03-08 01:18:11 +09:00
bergquist
cb223ee563 removes commented code 2018-03-07 16:40:24 +01:00
Sven Klemm
4904a051cf use net/url to generate postgres connection url 2018-03-05 16:06:04 +01:00
Sven Klemm
4e826ff8f7 remove spaces around arguments of macros 2018-03-02 19:24:15 +01:00
Sven Klemm
f1ba9137c0 remove spaces around arguments before calling macro expansion 2018-03-02 19:20:30 +01:00
Sven Klemm
0f931f9e5e Merge remote-tracking branch 'upstream/master' into macroengine-interpolate 2018-03-01 18:01:54 +01:00
Daniel Lee
f959ba9bcf influxdb: escape backslashes in tag values (for alerting)
Closes #10957. Backslash escaping was already implemented on the
frontend but does not work for queries executed on the backend.
2018-02-19 10:02:14 +01:00
Mitsuhiro Tanda
18c54a9341 support cloudwatch high resolution query 2018-02-15 23:35:01 +09:00
Sven Klemm
ebbc079853 improve error message for invalid/unknown datatypes (#10834) 2018-02-14 15:21:00 +01:00
Mitsuhiro Tanda
60b30d3e9a add AWS/States Rekognition (#10890)
* added AWS/States

* added Rekognition
2018-02-14 15:14:38 +01:00
hannes
43e6ea95e0 Cloudwatch: add support for multi instances (#10570)
* cloudwatch: fix ebs_volume_ids by create a client-session before call ec2:DescribeInstances.

* cloudwatch: add support for multi instanceIds on call ebs_volume_ids.
2018-01-24 15:41:42 +01:00
hannes
d82af23f1c cloudwatch: fix ebs_volume_ids by create a client-session before call ec2:DescribeInstances. (#10566) 2018-01-23 12:57:05 +01:00
Torkel Ödegaard
4f59d229fe fix: cloudwatch corrected error handling so original error is not thrown away 2018-01-19 09:24:44 +01:00
Daniel Lee
6d13645206 mysql: update to use ColumnTypes interface in new version
The custom code in vendor is not needed anymore and most of the
mapping code can be replaced.
2018-01-18 11:50:16 +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
b63c834a4b Adds Table in backend datasource contract. 2018-01-15 09:41:44 +01:00
bergquist
9e942f1a6d Adds Tables types to protobuf 2018-01-11 15:34:07 +01:00
bergquist
ce4beb730d Review tsdb protobuf contract 2018-01-11 15:01:49 +01:00
bergquist
ebd8677607 moves plugin proxy to plugin package 2018-01-10 12:11:57 +01:00
bergquist
e6921a6a01 removes commented code 2018-01-09 15:25:36 +01:00
Oleksandr Kushchenko
5c94daa011 Add AWS/AmazonMQ namespace metrics to CloudWatch tsdb (#10407) 2018-01-03 11:11:31 +01:00
Ali
de22e793d8
Merge branch 'master' into master 2018-01-03 10:33:54 +03:00
bergquist
05362a9666 plugins: restart killed plugins 2017-12-22 15:40:45 +01:00
bergquist
4aeef32073 query result should be a map 2017-12-22 14:40:38 +01:00
bergquist
e234cf5b18 prom: removes limitation of one query per tsdb call 2017-12-22 12:22:42 +01:00
Carl Bergquist
8b37e27dde use int64 for timestamps 2017-12-20 16:03:53 +01:00
Carl Bergquist
8a7c455697 Merge branch 'master' into backend_plugins
* master: (48 commits)
  fix: unit test fixed
  prettier: change to single quoting
  ux: minor name change to search sections
  db: fix postgres regression when comparing boolean columns/values (#10303)
  dashboard: delete row improvements
  fix missing comma in documentation output example
  fix broken link (#10291)
  minor fixes and formatting after review
  dashfolders: use validation service for folder creation and dashboard import. #10197
  dashfolders: support creating new folder when moving dashboards. #10197
  dashfolders: support creating new folder when saving a dashboard. #10197
  dashfolders: support creating new folder in dashboard settings. #10197
  dashfolders: support creating new folder from the folder picker. #10197
  tech: ran prettier on all scss files
  tech: ran pretttier on all typescript files
  search: closes dash search when selecting current dashboard (#10285)
  fix: Original dashboard link from snapshot should be an a-tag, not a button (#10269) (#10283)
  dashboard: fixes #10262
  added new to new dahsboard and folder
  test: Update test with new component signature
  ...
2017-12-20 14:20:33 +01:00
Carl Bergquist
cef3800c33 fixes invalid valud/timestamp order 2017-12-20 14:20:08 +01:00
Scott Ernst
fcf1ff10d2 Kinesis Metric Capitalization
Fixes the capitalization of the AWS/Kinesis ShardId metric, which
was incorrectly specified as "ShardID" instead of "ShardId" as
specified in the AWS documentation:

http://docs.aws.amazon.com/streams/latest/dev/monitoring-with-cloudwatch.html
2017-12-15 12:44:13 -06:00
bergquist
8573f73d72 Merge branch 'master' into backend_plugins
* master: (584 commits)
  prometheus: change default resolution to 1/1
  fix: viewers can edit now works correctly
  fix: fixed minor ux and firefox issues, fixes #10228
  ux: minor fixes
  profile: use name or fallback for profile page
  fix: sidemenu profile main text is now username instead of name
  build: update master version to 5.0.0-pre1
  dashfolder: change to migration text
  ux:s sidemenu icon rules
  teams: add team count when searching for team
  changed background color for infobox and new blues in light theme, light theme now uses blue-dark in panel query (#10211)
  ux: fixed navbar issue when sidemenu closes
  ux: minor position change for layout selector, fixes #10217
  fix: view json from share modal now works, #10217
  ux: used new add data sources icon
  dashfolders: styling of selected filters
  dashfolders: styling of selected filters
  dashfolders: fix moving plugin dashboard to folder
  changelog: adds note about closing #9170
  dashfolders: fix folder selection dropdown in dashboard settings
  ...
2017-12-15 14:34:55 +01:00
bergquist
7c0fc59dfb execute process directly instead of creating sub shell 2017-12-13 17:58:50 +01:00
linux chips
6e7a067857 adding support for sgl native time datatypes 2017-12-12 23:43:24 +03:00
Carl Bergquist
ea2f65b4c3
Merge pull request #10110 from bwhaley/master
Fixes bug in cloudwatch regarding credentials
2017-12-12 10:16:53 +01:00
bergquist
1af4f7a1b4 backend plugins: dont swallow errors 2017-12-11 13:16:16 +01:00
bergquist
026eb9ac36 backend plugins: cleanup protobuf files 2017-12-11 13:09:10 +01:00
bergquist
7f68c2a53d backend plugins: add more datasource params 2017-12-11 12:53:01 +01:00
bergquist
48e7f866f6 code style 2017-12-11 11:26:36 +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
Mikael Olenfalk
8e7166b5c4 Explicitly specify default region in CloudWatch datasource (#9440)
The datasource uses the default region in the query if the region
is "" in the settings. However setting the region to an empty string
is almost impossible and rendered incorrectly.

This commit introduces a special value "default" for region which
is shown in the drop down and is translated to the default region
of the data source when performing queries.
2017-12-11 09:37:27 +01:00
Sven Klemm
cb15d9cbdd add missing value fill code to mysql datasource 2017-12-10 19:50:01 +01:00
Sven Klemm
6cdd901ec6 fix typo 2017-12-10 12:40:09 +01:00
Sven Klemm
c1282e8ea8 implement missing value fill functionality for postgres 2017-12-10 11:42:55 +01:00
Sven Klemm
e2a3590d8b allow optional 3rd argument to timeGroup to control filling missing
values
2017-12-10 09:59:33 +01:00
Sven Klemm
b86a42fffe pass tsdbQuery to transformToTimeSeries and transformToTable to get
access to selected frontend timerange
2017-12-09 20:35:00 +01:00
Sven Klemm
b6df91d56b pass Query to MacroEngine Interpolate 2017-12-08 23:30:33 +01:00
Sven Klemm
ce809de1ed postgres: change $__timeGroup macro to include "AS time" column alias (#10119)
* change $__timeGroup macro to include column alias

* update docs and help text for $__timeGroup macro
2017-12-08 15:14:10 +01:00
Ben Whaley
51854ff4fa Fix go fmt 2017-12-07 16:10:13 +00: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
0bc5bf53ce correct comments 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
a97360ab27 initial version of proto files 2017-12-07 16:32:17 +01:00
Ben Whaley
fe88658bdd Resolves grafana/grafana:#9309 2017-12-07 03:43:32 +00:00
Sven Klemm
c80eadcdf4 handle native postgres datetime types in annotation queries (#9986) 2017-12-06 18:12:24 +01:00
Sven Klemm
373389c920 treat any text column in timeseries query as metric name unless column (#9985)
named metric is present
2017-12-06 18:04:33 +01:00
linux chips
5114b1f792 fixing a few fromattings 2017-12-06 10:32:20 +03:00
bergquist
35232a77e6 removes unused properties
the dsType property caused some confusion about what datasource is
beeing used. I just removed it since it not beeing used.

closes #10072
2017-12-05 08:26:43 +01:00
linux chips
6f3a62d299 add _tests for mssql data source 2017-12-03 21:56:21 +03:00
linux chips
c75f9a1923 MSSQL Data Source 2017-12-02 14:40:12 +03:00
bergquist
9282182805 influxdb: pass tags to alerting from influxdb client
closes #10046
2017-12-01 16:16:49 +01:00
Andrei Kalasok
68d4211c50 grafana-10039: fix query time range ends in the past 2017-11-30 15:50:35 +01:00
Daniel Lee
5dd9582520 mysql: add data source support for Azure MySql
Fixes #9649
2017-11-21 13:21:19 +01:00
Sven Klemm
26ab25b7c0 dont loose subsecond precision when dealing with timestamp or (#9851)
timestamptz
2017-11-15 14:50:32 +01:00
Daniel Lee
b2fbb2691b sql: small fix to error handling 2017-11-15 13:57:33 +01:00
Carl Bergquist
5d6ed6c45f
prom: add support for default step param (#9866)
Alerting for prometheus have been depending on the step parameter from each query.
In https://github.com/grafana/grafana/pull/9226 we changed the behavior for step in the
frontend which caused problems for alerting. This commit fixes that by introducing a default
min interval value so alerting always have something to depend on. 

closes #9777
2017-11-15 11:22:00 +01:00
Sven Klemm
9e6a7dcb90 properly escape components of connection string (#9850) 2017-11-15 10:55:08 +01:00
Sven Klemm
108f582ec4 sync documentation, add remark about to_timestamp and redshift (#9841) 2017-11-14 11:33:55 +01:00
Mitsuhiro Tanda
52e1c4113b fix cloudwatch ec2_instance_attribute (#9718)
* fix cloudwatch ec2_instance_attribute

* add test

* minor fix
2017-11-13 13:07:46 +01:00
Carl Bergquist
c44f6e2ec2
Merge pull request #9854 from drenalin23/drenalin-add-networkelb-cloudwatch
Add AWS/NetworkELB to cloudwatch definitions
2017-11-13 07:50:45 +01:00
Mitsuhiro Tanda
6488ccd113 return empty array for no datapoints 2017-11-12 00:48:54 +09:00
Scott Nelson Windels
343143e95f Add AWS/NetworkELB to cloudwatch definitions 2017-11-10 15:13:09 -08:00
Carl Bergquist
17492c091a
Merge pull request #9752 from mtanda/cw_alias_fix
[bug fix] (cloudwatch) fix default alias format
2017-11-02 07:45:26 +01:00
Carl Bergquist
c783bdac39
Merge pull request #9753 from mtanda/cw_period
(cloudwatch) add period alias
2017-11-01 14:02:41 +01:00
Mitsuhiro Tanda
4a63d696ff fix default alias 2017-11-01 18:48:30 +09:00
Mitsuhiro Tanda
ebcb8be19a add period alias 2017-11-01 18:47:21 +09:00
Torkel Ödegaard
c3bd07f9b4 testdata: added manual entry mode to test data 2017-11-01 09:59:24 +01:00
Sven Klemm
a503c1d39c change default sslmode for postgres to verify-full (#9736) 2017-10-31 13:55:32 +01:00
Sven Klemm
34da0711ab add __timeGroup macro for mysql (#9596)
* add __timeGroup macro for mysql

* put example __timeGroup query in frontend help

* do __timeGroup interval parsing in go similar to mysql

* ignore whitespace around interval
2017-10-27 11:26:25 +02:00
Sven Klemm
b2d880c6de modify $__timeGroup macro so it can be used in select clause (#9527)
* modify $__timeGroup macro so it can be used in select clause

* fix $__interval_ms for postgres datasource

* use $__timeGroup macro in documentation

* fix annotation template query
remove title since its no longer used and add tags instead

* change __timeFilter macro to work on postgresql < 8.1 and redshift
2017-10-18 18:10:01 +02:00
Eric Dahl
888d608090 CloudWatch: Add ALB RequestCountPerTarget metric
This commit adds the new ALB metric `RequestCountPerTarget` which was
released in July 2017.
2017-10-14 21:50:23 -07: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
Mitsuhiro Tanda
8d6513a564 fix cloudwatch alert bug 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda
5e88177f28 add debug log 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda
468e8c13ee move extend statistics handling code to backend 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda
6c375ed2cb fix assume role 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda
f3a2dc7c5f improve cloudwatch tsdb 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda
a21f53cf82 refactor cloudwatch code 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda
59cdd4d8d2 remove obsolete code 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda
fe9fca381c move cloudwatch crendential related code 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda
e1fe15e094 fix annotation query 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda
d98d8a404f fix dimension convertion 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda
c140d7aa06 re-implement annotation query 2017-09-29 13:45:11 +09:00
Mitsuhiro Tanda
8f3b060946 fix parameter format 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda
17445e0c98 fix alert feature 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda
8243ac39c2 fix parameter format 2017-09-29 13:44:01 +09:00
bergquist
fe1d395d79 refactor cloudwatch to support new tsdb interface 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda
1dcc51adce re-implement dimension_values() 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda
ec632bb9ed fix error message 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda
8fba6dcb0d re-implement ec2_instance_attribute() 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda
cf23734d7d re-implement ebs_volume_ids() 2017-09-29 13:44:01 +09:00
Mitsuhiro Tanda
e588b682fb import the change, https://github.com/grafana/grafana/pull/9268 2017-09-29 13:44:01 +09:00