Commit Graph

832 Commits

Author SHA1 Message Date
Mario Trangoni
91447dcbf9 pkg/tsdb/stackdriver/stackdriver.go: Fix regular expression does not contain any meta characters.
See,
$ gometalinter --vendor --deadline 10m --disable-all --enable=megacheck ./...
pkg/tsdb/stackdriver/stackdriver.go:171:26⚠️ regular expression does not contain any meta characters (SA6004) (megacheck)
2018-10-23 17:26:47 +02:00
Mario Trangoni
bb12a1bc99 pkg/tsdb/graphite/graphite.go: Fix regular expression does not contain any meta characters.
I found this article benchmarking Replace vs Regexp,
https://medium.com/codezillas/golang-replace-vs-regexp-de4e48482f53

See,
$ gometalinter --vendor --deadline 10m --disable-all --enable=megacheck ./...
pkg/tsdb/graphite/graphite.go:167:28⚠️ regular expression does not contain any meta characters (SA6004) (megacheck)
pkg/tsdb/graphite/graphite.go:172:28⚠️ regular expression does not contain any meta characters (SA6004) (megacheck)
2018-10-23 17:26:46 +02:00
Erik Sundell
6abbf5b3b8 stackdriver: refactoring request builder 2018-10-22 16:12:55 +02:00
Erik Sundell
1756e82d8b stackdriver: remove not used struct 2018-10-22 16:12:55 +02:00
Erik Sundell
5b04a8b6c2 stackdriver: remove not used query file 2018-10-22 16:11:17 +02:00
Erik Sundell
1a329e4e47 stackdriver: remove test datasource query. use ensuredefaultproject instead 2018-10-22 16:11:17 +02:00
Erik Sundell
b02a8127ff stackdriver: remove debug comments 2018-10-22 16:11:17 +02:00
Erik Sundell
b2c6c743ce stackdriver: add debug logging 2018-10-22 16:11:17 +02:00
Erik Sundell
3999578300 stackdriver: fix broken braces 2018-10-22 16:11:17 +02:00
Erik Sundell
3935f9d24c stackdriver: use constant instead of variable 2018-10-22 16:11:17 +02:00
Erik Sundell
8b4fff8b87 stackdriver: use gce variable 2018-10-22 16:11:17 +02:00
Erik Sundell
4a51d05477 stackdriver: add variable for gce authentication type 2018-10-22 16:11:17 +02:00
Erik Sundell
b9cb4649bb stackdriver: get default project from backend. also ensure default project could be retrieved when authentication type is gce 2018-10-22 16:11:17 +02:00
Erik Sundell
cd7b454e25 stackdriver: add default value for authentication type 2018-10-22 16:03:14 +02:00
Erik Sundell
823838a839 stackdriver: wip - remove debug code 2018-10-22 16:03:14 +02:00
Erik Sundell
0b82fda49c stackdriver: only get default token from metadata server when applying route 2018-10-22 16:03:14 +02:00
Erik Sundell
dd9e9ed419 stackdriver: make backend query a pure test datasource function 2018-10-22 16:03:13 +02:00
Erik Sundell
9c7022be86 stackdriver: add status code 2018-10-22 16:03:13 +02:00
Erik Sundell
412a1f6d99 stackdriver: wip - return metric descriptors in the format of tablew 2018-10-22 16:03:13 +02:00
Erik Sundell
ff5f281508 stackdriver: wip - get metric descriptors in the backend 2018-10-22 16:03:13 +02:00
Erik Sundell
60617d0bf7 stackdriver: wip - add logic for retrieving token from gce metadata server in the auth provider 2018-10-22 16:03:13 +02:00
Erik Sundell
102f531c1e stackdriver: break out project name resolving into its own function in the stackdriver.go file 2018-10-22 16:03:12 +02:00
Erik Sundell
df215d9d09 stackdriver: WIP - test retrieving project id from gce metadata 2018-10-22 16:03:12 +02:00
Marcus Efraimsson
77f23018a5
Merge pull request #13684 from mtanda/cw_concurrent_map
fix concurrent map writes
2018-10-18 13:41:39 +02:00
Marcus Efraimsson
1d0dee189c
Merge pull request #13705 from Yukinoshita-Yukino/master
Add socket support for mysql data source
2018-10-18 09:45:50 +02:00
Yuan Liu
f640df7a2c
simplify code 2018-10-18 01:45:14 +08:00
Marcus Efraimsson
62f21a254a
Merge pull request #12337 from mtanda/cw_regions
show all CloudWatch regions (avoid hard coding)
2018-10-17 11:55:43 +02:00
Yuan Liu
36dbc5f51c
Add socket support for mysql data source 2018-10-17 17:45:06 +08:00
Marcus Efraimsson
52f398e7f7
cloudwatch: return a distinct list of regions 2018-10-17 10:58:06 +02:00
Ramiro Morales
49a3bd3097 add encrypt connstr param conditionally on the value chosen via GUI. 2018-10-16 13:14:22 -03:00
Mitsuhiro Tanda
fce50cf1b8 return default region list from backend 2018-10-16 12:20:39 +09:00
Mitsuhiro Tanda
f6cb01d38a show all CloudWatch regions 2018-10-16 12:03:33 +09:00
Mitsuhiro Tanda
2b20402d7d get region list from ec2:DescribeRegions 2018-10-16 12:03:33 +09:00
Mitsuhiro Tanda
48aef0c50e fix concurrent map writes 2018-10-16 11:45:58 +09:00
Ramiro Morales
d859a6aeb8 rename new JSON data attrbute. 2018-10-15 20:34:03 -03:00
Ramiro Morales
37f16ca80a Add 'encrypt' setting to MSSQL data source.
Fixes #13629
2018-10-15 14:47:54 -03:00
Mario Trangoni
18e127db2a pkg/tsdb/*: Fix do not pass a nil Context
See,
$ gometalinter --vendor --deadline 6m --disable-all --enable=megacheck ./...
pkg/tsdb/mssql/mssql_test.go:695:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:772:32⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:704:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
2018-10-11 19:03:54 +02:00
Yuan Liu
18dfdc4f0d
add test for es alert when group by has no limit 2018-10-11 16:04:57 +08:00
Yuan Liu
f8a8b213f9
remove tab 2018-10-11 11:40:23 +08:00
Yuan Liu
567db87c3a
bug fix
bug fix
2018-10-11 11:36:40 +08:00
Yuan Liu
3b9ab6e204
Update time_series_query.go
fix alert no data when elasticsearch group by terms size is set to no limit
2018-10-11 11:21:06 +08:00
Marcus Efraimsson
bc3b7357bd
Merge pull request #13400 from connection-reset/concurrent-sql
Run queries for sql data sources for panels with multiple queries concurrently
Also make max open connections, max idle connections and max connection 
lifetime configurable in the data source settings
2018-10-10 19:12:38 +02:00
Marcus Efraimsson
5f69854e2a
Merge pull request #13571 from mtanda/cw_unit
cloudwatch: automatically set graph yaxis unit 

fixes #13575
2018-10-10 09:52:10 +02:00
Marcus Efraimsson
0612ce9b75
cloudwatch: return early if execute query returns error
This will stop a segfault from happening
2018-10-10 09:38:42 +02:00
Mitsuhiro Tanda
f0fb8123ae add test for automatically unit set 2018-10-10 14:07:08 +09:00
Mitsuhiro Tanda
37e749f6da fix crach bug 2018-10-10 13:56:58 +09:00
Daniel Lee
a1d4675169
Merge pull request #13490 from mtanda/stackdriver_distribution
Stackdriver heatmap support. Fixes #13559
2018-10-09 20:57:21 +02:00
Mitsuhiro Tanda
6ed1cbd5bb set unit for CloudWatch GetMetricStatistics result 2018-10-09 17:02:56 +09:00
Erik Sundell
8d53799bcd stackdriver: always use regex full match for =~ and !=~operator 2018-10-08 15:57:31 +02:00
Erik Sundell
7e6a5c0a74 stackdriver: add tests from regex matching 2018-10-08 15:57:30 +02:00
Erik Sundell
a3122a4b85 stackdriver: test build filter string 2018-10-08 15:57:30 +02:00
Erik Sundell
5f7795aa1f stackdriver: test that no interpolation is done when there are no wildcards 2018-10-08 15:57:30 +02:00
Erik Sundell
2a0d7a8803 stackdriver: remove debug logging 2018-10-08 15:57:30 +02:00
Erik Sundell
035be6cbbe stackdriver: add more tests 2018-10-08 15:57:30 +02:00
Erik Sundell
68332c5951 stackdriver: fix broken substring. also adds tests 2018-10-08 15:57:30 +02:00
Erik Sundell
2e665fba0f stackdriver: remove not necessary helper functions 2018-10-08 15:57:30 +02:00
Erik Sundell
4d8f594d31 stackdriver: interpolate stackdriver filter wildcards when asterix is used in filter 2018-10-08 15:57:30 +02:00
Marcus Efraimsson
9ae6f68500
Merge pull request #13498 from svenklemm/sql-macros2
move timeFrom, timeTo, unixEpochFrom and unixEpochTo macros to sql_engine
2018-10-04 15:21:46 +02:00
Marcus Efraimsson
6407ec4128
mssql: fix tests 2018-10-03 11:26:52 +02:00
Mario Trangoni
afab9085eb pkg/tsdb/postgres/postgres_test.go: pass context.Background() instead of nil
See,
$ gometalinter --vendor --disable-all --enable=megacheck --disable=gotype --deadline 6m ./...
pkg/tsdb/postgres/postgres_test.go:120:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:200:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:257:34⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:282:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:336:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:363:32⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:453:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:475:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:497:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:519:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:541:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:563:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:585:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:607:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:629:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:652:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:677:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:738:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:761:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:787:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:817:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:847:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:877:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:905:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/postgres/postgres_test.go:933:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
2018-10-03 10:32:51 +02:00
Mario Trangoni
3632e9c756 pkg/tsdb/mysql/mysql_test.go: pass context.Background() instead of nil
See,
$ gometalinter --vendor --disable-all --enable=megacheck --disable=gotype --deadline 6m ./...
pkg/tsdb/mysql/mysql_test.go:132:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:220:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:267:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:330:34⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:355:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:381:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:476:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:498:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:520:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:542:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:564:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:586:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:608:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:630:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:652:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:674:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:696:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:719:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:744:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:805:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:828:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:854:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:884:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:914:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:944:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:972:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:1000:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
2018-10-03 10:24:06 +02:00
Mario Trangoni
0f25dec117 pkg/tsdb/mssql/mssql_test.go: pass context.Background() instead of nil
See,
$ gometalinter --vendor --disable-all --enable=megacheck --disable=gotype --deadline 6m ./...
pkg/tsdb/mssql/mssql_test.go:131:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:221:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:268:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:330:34⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:355:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:444:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:466:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:488:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:510:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:532:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:554:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:576:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:598:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:620:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:643:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:666:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:742:34⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:819:34⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:895:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:918:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:944:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:974:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:1004:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:1034:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:1062:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mssql/mssql_test.go:1090:33⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
2018-10-03 10:22:26 +02:00
Sven Klemm
e303468c0c adjust mssql tests 2018-10-03 10:21:16 +02:00
Mario Trangoni
88efb87b0d pkg/tsdb/elasticsearch/client/client_test.go: pass context.Background() instead of nil
See,
$ gometalinter --vendor --disable-all --enable=megacheck --disable=gotype --deadline 6m ./...
pkg/tsdb/elasticsearch/client/client_test.go:28:25⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/elasticsearch/client/client_test.go:39:25⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/elasticsearch/client/client_test.go:51:25⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/elasticsearch/client/client_test.go:63:25⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/elasticsearch/client/client_test.go:76:25⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/elasticsearch/client/client_test.go:89:25⚠️ do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
2018-10-03 09:59:10 +02:00
Sven Klemm
af22213462 remove generic macros from macros_test and add integration test for generic macros 2018-10-03 09:46:17 +02:00
Sven Klemm
744e8617ff add postgres test for global macros 2018-10-03 09:35:42 +02:00
Mitsuhiro Tanda
c2c0cdb49c add test 2018-10-03 16:27:11 +09:00
Mitsuhiro Tanda
6770f2e940 stackdriver heatmap support 2018-10-03 16:27:04 +09:00
Torkel Ödegaard
ed0c2296b6 added slow queries scenario to test data source, added new panel test dashboard with slow queries 2018-10-02 13:00:54 -07:00
Sven Klemm
94d6d51726 move timeFrom, timeTo, unixEpochFrom and unixEpochTo macros to sql_engine 2018-10-02 20:19:34 +02:00
Torkel Ödegaard
9e72588cec wip: began work on support for testdata tables & annotations support 2018-10-02 18:50:30 +02:00
Marcus Efraimsson
3932e4db5a
Merge remote-tracking branch 'origin/master' into concurrent-sql 2018-10-02 17:44:33 +02:00
Axel Pirek
dd09ece8c9 Make max open, max idle connections and connection max life time configurable 2018-10-02 13:42:06 +02:00
Mario Trangoni
6c190ab713 pkg/tsdb/cloudwatch/credentials.go: Remove unnecessary variable assignment
See,
pkg/tsdb/cloudwatch/credentials.go:45:2⚠️ should merge variable declaration with assignment on next line (S1021) (megacheck)
2018-10-01 18:24:00 +02:00
Mario Trangoni
ec4139d56b pkg/tsdb/stackdriver/stackdriver_test.go: return simplified
See,
pkg/tsdb/stackdriver/stackdriver_test.go:356:2⚠️ 'if err != nil { return data, err }; return data, nil' can be simplified to 'return data, err'
2018-10-01 18:24:00 +02:00
Daniel Lee
bf2abc6940 stackdriver: set default view parameter to FULL 2018-09-29 23:45:28 +02:00
Daniel Lee
399e83f91b stackdriver: remove metric.category alias pattern
After discussions with the Stackdriver team, they did not think this was
needed.
2018-09-28 17:16:35 +02:00
Daniel Lee
9b90b835b2 Merge remote-tracking branch 'origin/master' into stackdriver-plugin 2018-09-28 16:20:40 +02:00
Daniel Lee
41060d24d5 stackdriver: change pattern for annotation to metric.value 2018-09-28 16:16:27 +02:00
Erik Sundell
189f89a9e4 stackdriver: add support for bool values 2018-09-28 15:42:02 +02:00
Erik Sundell
220f479ff8 stackdriver: add support for int64 values 2018-09-28 15:27:28 +02:00
Erik Sundell
2aae7e0c87 stackdriver: fix froamt annotation text for value 2018-09-28 13:50:10 +02:00
Erik Sundell
ca50e315fa stackdriver: make it possible to use point values of type string 2018-09-28 13:41:28 +02:00
Steve Kreitzer
55e4db5cfc Adding AWS Isolated Regions 2018-09-27 19:58:07 -04:00
Daniel Lee
a63877bd4f stackdriver: pattern formatting for annotations 2018-09-27 16:18:48 +02:00
Daniel Lee
03b43ab769 stackdriver: wip annotation support 2018-09-27 15:18:10 +02:00
Erik Sundell
c099074d2c stackdriver: remove debug logging 2018-09-27 10:41:51 +02:00
Erik Sundell
0507ff69fb stackdriver: resolve merge conflict 2018-09-27 10:32:30 +02:00
Erik Sundell
481b8653d9 stackdriver: update alignment period rules according to stackdriver 2018-09-27 10:20:01 +02:00
Daniel Lee
6358d3f314 stackdriver: set target to be raw query 2018-09-27 10:14:10 +02:00
Erik Sundell
3c6c456592 stackdriver: use more appropriate test data 2018-09-27 09:19:24 +02:00
Erik Sundell
284d0b7edf Merge branch 'stackdriver-plugin' of https://github.com/grafana/grafana into stackdriver-plugin 2018-09-26 18:04:30 +02:00
Erik Sundell
75a2ea5c71 stackdriver: fix broken test 2018-09-26 18:04:04 +02:00
Daniel Lee
66c95991c1 Merge remote-tracking branch 'origin/master' into stackdriver-plugin 2018-09-26 17:59:56 +02:00
Erik Sundell
ed6d3bf6ed stackdriver: WIP - implement stackdriver style auto alignment period. also return the used alignment period and display it in the query editor 2018-09-26 17:50:08 +02:00
Erik Sundell
af9033f3e0 stackdriver: distinct grafana auto from stackdriver auto in alignment period 2018-09-26 15:44:09 +02:00
Erik Sundell
13c68e6ed8 stackdriver: use correct name for variable 2018-09-26 15:37:29 +02:00
Erik Sundell
49cd31ab78 stackdriver: get value type and metric kind from metric descriptor instead of from latest metric result 2018-09-26 11:17:24 +02:00
Erik Sundell
b6a918ba79 stackdriver: merge commit 2018-09-25 15:13:24 +02:00
Erik Sundell
b700c6b0e4 stackdriver: populate alignment and aggregation dropdowns based on metric type and value type 2018-09-25 09:34:14 +02:00
Daniel Lee
4777689f29 stackdriver: skeleton for more query types on the backend 2018-09-24 16:02:35 +02:00
Axel Pirek
e35f06b938 Run all sql data source queries for one panel concurrently 2018-09-24 14:53:39 +02:00
Daniel Lee
681cd7496e stackdriver: alias patterns WIP
This is using the {{}} syntax for alias patterns. Might
switch to the  syntax instead.
2018-09-23 22:04:24 +02:00
Mario Trangoni
0870464ea5 Fix goconst issues
See,
$ gometalinter --vendor --disable-all --enable=goconst --disable=gotype --deadline=6m ./...
build.go:113:15⚠️ 2 other occurrence(s) of "linux" found in: build.go:119:15 build.go:491:34 (goconst)
build.go:119:15⚠️ 2 other occurrence(s) of "linux" found in: build.go:113:15 build.go:491:34 (goconst)
build.go:491:34⚠️ 2 other occurrence(s) of "linux" found in: build.go:113:15 build.go:119:15 (goconst)
build.go:381:21⚠️ 2 other occurrence(s) of "windows" found in: build.go:423:13 build.go:487:13 (goconst)
build.go:423:13⚠️ 2 other occurrence(s) of "windows" found in: build.go:381:21 build.go:487:13 (goconst)
build.go:487:13⚠️ 2 other occurrence(s) of "windows" found in: build.go:381:21 build.go:423:13 (goconst)
pkg/api/dashboard.go:67:22⚠️ 5 other occurrence(s) of "Anonymous" found in: pkg/api/dashboard.go:67:35 pkg/api/dashboard.go:131:10 pkg/api/dashboard.go:406:13 pkg/api/folder.go:98:22 pkg/api/folder.go:98:35 (goconst)
pkg/api/dashboard.go:67:35⚠️ 5 other occurrence(s) of "Anonymous" found in: pkg/api/dashboard.go:67:22 pkg/api/dashboard.go:131:10 pkg/api/dashboard.go:406:13 pkg/api/folder.go:98:22 pkg/api/folder.go:98:35 (goconst)
pkg/api/dashboard.go:131:10⚠️ 5 other occurrence(s) of "Anonymous" found in: pkg/api/dashboard.go:67:22 pkg/api/dashboard.go:67:35 pkg/api/dashboard.go:406:13 pkg/api/folder.go:98:22 pkg/api/folder.go:98:35 (goconst)
pkg/api/dashboard.go:406:13⚠️ 5 other occurrence(s) of "Anonymous" found in: pkg/api/dashboard.go:67:22 pkg/api/dashboard.go:67:35 pkg/api/dashboard.go:131:10 pkg/api/folder.go:98:22 pkg/api/folder.go:98:35 (goconst)
pkg/api/folder.go:98:22⚠️ 5 other occurrence(s) of "Anonymous" found in: pkg/api/dashboard.go:67:22 pkg/api/dashboard.go:67:35 pkg/api/dashboard.go:131:10 pkg/api/dashboard.go:406:13 pkg/api/folder.go:98:35 (goconst)
pkg/api/folder.go:98:35⚠️ 5 other occurrence(s) of "Anonymous" found in: pkg/api/dashboard.go:67:22 pkg/api/dashboard.go:67:35 pkg/api/dashboard.go:131:10 pkg/api/dashboard.go:406:13 pkg/api/folder.go:98:22 (goconst)
pkg/api/index.go:63:47⚠️ 2 other occurrence(s) of "light" found
in: pkg/api/index.go:91:22 pkg/api/index.go:93:16 (goconst)
pkg/api/index.go:91:22⚠️ 2 other occurrence(s) of "light" found in: pkg/api/index.go:63:47 pkg/api/index.go:93:16 (goconst)
pkg/api/index.go:93:16⚠️ 2 other occurrence(s) of "light" found in: pkg/api/index.go:63:47 pkg/api/index.go:91:22 (goconst)
pkg/components/null/float.go:71:25⚠️ 2 other occurrence(s) of "null" found in: pkg/components/null/float.go:103:10 pkg/components/null/float.go:112:10 (goconst)
pkg/components/null/float.go:103:10⚠️ 2 other occurrence(s) of "null" found in: pkg/components/null/float.go:71:25 pkg/components/null/float.go:112:10 (goconst)
pkg/components/null/float.go:112:10⚠️ 2 other occurrence(s) of "null" found in: pkg/components/null/float.go:71:25 pkg/components/null/float.go:103:10 (goconst)
pkg/services/alerting/notifiers/pagerduty.go:79:16⚠️ 2 other occurrence(s) of "Triggered metrics:\n\n" found in: pkg/services/alerting/notifiers/kafka.go:64:16 pkg/services/alerting/notifiers/opsgenie.go:98:16 (goconst)
pkg/services/alerting/notifiers/kafka.go:64:16⚠️ 2 other occurrence(s) of "Triggered metrics:\n\n" found in: pkg/services/alerting/notifiers/pagerduty.go:79:16 pkg/services/alerting/notifiers/opsgenie.go:98:16 (goconst)
pkg/services/alerting/notifiers/opsgenie.go:98:16⚠️ 2 other occurrence(s) of "Triggered metrics:\n\n" found in: pkg/services/alerting/notifiers/pagerduty.go:79:16 pkg/services/alerting/notifiers/kafka.go:64:16 (goconst)
pkg/social/social.go:85:11⚠️ 2 other occurrence(s) of "grafana_com" found in: pkg/social/social.go:162:14 pkg/social/social.go:197:11 (goconst)
pkg/social/social.go:162:14⚠️ 2 other occurrence(s) of "grafana_com" found in: pkg/social/social.go:85:11 pkg/social/social.go:197:11 (goconst)
pkg/social/social.go:197:11⚠️ 2 other occurrence(s) of "grafana_com" found in: pkg/social/social.go:85:11 pkg/social/social.go:162:14 (goconst)
pkg/tsdb/elasticsearch/time_series_query.go:92:17⚠️ 3 other occurrence(s) of "count" found in: pkg/tsdb/elasticsearch/response_parser.go:152:8 pkg/tsdb/elasticsearch/response_parser.go:167:31 pkg/tsdb/elasticsearch/response_parser.go:315:9 (goconst)
pkg/tsdb/elasticsearch/response_parser.go:152:8⚠️ 3 other occurrence(s) of "count" found in: pkg/tsdb/elasticsearch/time_series_query.go:92:17 pkg/tsdb/elasticsearch/response_parser.go:167:31 pkg/tsdb/elasticsearch/response_parser.go:315:9 (goconst)
pkg/tsdb/elasticsearch/response_parser.go:167:31⚠️ 3 other occurrence(s) of "count" found in: pkg/tsdb/elasticsearch/time_series_query.go:92:17 pkg/tsdb/elasticsearch/response_parser.go:152:8 pkg/tsdb/elasticsearch/response_parser.go:315:9 (goconst)
pkg/tsdb/elasticsearch/response_parser.go:315:9⚠️ 3 other occurrence(s) of "count" found in: pkg/tsdb/elasticsearch/time_series_query.go:92:17 pkg/tsdb/elasticsearch/response_parser.go:152:8 pkg/tsdb/elasticsearch/response_parser.go:167:31 (goconst)
pkg/tsdb/elasticsearch/time_series_query.go:78:9⚠️ 2 other occurrence(s) of "date_histogram" found in: pkg/tsdb/elasticsearch/response_parser.go:84:22 pkg/tsdb/elasticsearch/response_parser.go:369:24 (goconst)
pkg/tsdb/elasticsearch/response_parser.go:84:22⚠️ 2 other occurrence(s) of "date_histogram" found in: pkg/tsdb/elasticsearch/time_series_query.go:78:9 pkg/tsdb/elasticsearch/response_parser.go:369:24 (goconst)
pkg/tsdb/elasticsearch/response_parser.go:369:24⚠️ 2 other occurrence(s) of "date_histogram" found in: pkg/tsdb/elasticsearch/time_series_query.go:78:9 pkg/tsdb/elasticsearch/response_parser.go:84:22 (goconst)
2018-09-23 21:19:21 +02:00
Mario Trangoni
80fa66fcb0 Fix some typos found by codespell
See,
$ codespell -S "./.git*,./vendor*,./public*"
2018-09-21 11:54:52 +02:00
Mario Trangoni
3689bb778c Fix misspell issues
See,
$ gometalinter --disable-all --enable misspell --deadline 10m --vendor ./...
pkg/api/dtos/alerting_test.go:32:13⚠️ "expectes" is a misspelling of "expects" (misspell)
pkg/api/static/static.go:2:18⚠️ "Unknwon" is a misspelling of "Unknown" (misspell)
pkg/components/imguploader/azureblobuploader.go:55:48⚠️ "conatiner" is a misspelling of "container" (misspell)
pkg/login/ldap_settings.go:51:115⚠️ "compatability" is a misspelling of "compatibility" (misspell)
pkg/middleware/auth_proxy_test.go:122:22⚠️ "Destory" is a misspelling of "Destroy" (misspell)
pkg/middleware/logger.go:2:18⚠️ "Unknwon" is a misspelling of "Unknown" (misspell)
pkg/services/notifications/codes.go:9:13⚠️ "Unknwon" is a misspelling of "Unknown" (misspell)
pkg/services/session/mysql.go:170:3⚠️ "Destory" is a misspelling of "Destroy" (misspell)
pkg/services/session/mysql.go:171:24⚠️ "Destory" is a misspelling of "Destroy" (misspell)
pkg/services/session/session.go:95:4⚠️ "Destory" is a misspelling of "Destroy" (misspell)
pkg/services/session/session.go:96:1⚠️ "Destory" is a misspelling of "Destroy" (misspell)
pkg/services/session/session.go:167:25⚠️ "Destory" is a misspelling of "Destroy" (misspell)
pkg/setting/setting.go:1:18⚠️ "Unknwon" is a misspelling of "Unknown" (misspell)
pkg/tsdb/cloudwatch/cloudwatch.go:199:14⚠️ "resolutin" is a misspelling of "resolutions" (misspell)
pkg/tsdb/cloudwatch/cloudwatch.go:270:15⚠️ "resolutin" is a misspelling of "resolutions" (misspell)
pkg/tsdb/elasticsearch/response_parser.go:531:24⚠️ "Unkown" is a misspelling of "Unknown" (misspell)
pkg/tsdb/elasticsearch/client/search_request.go:113:7⚠️ "initaite" is a misspelling of "initiate" (misspell)

Note: Unknwon is a library name, and Destory a mysql typo.
2018-09-21 11:54:36 +02:00
Torkel Ödegaard
040095b5a8 fix: use same User-Agent header as in other places in grafana when making external requests 2018-09-21 11:35:55 +02:00
Torkel Ödegaard
c282f39121 Merge branch 'master' into stackdriver-plugin 2018-09-21 10:17:13 +02:00
Daniel Lee
ddee919edc stackdriver: remove WIP tests 2018-09-20 20:34:16 +02:00
Mario Trangoni
303e70db25 pkg/tsdb/elasticsearch/response_parser.go: simplify redundant code
$ gometalinter --vendor --disable-all --enable=megacheck --disable=gotype --deadline=6m ./...
pkg/tsdb/elasticsearch/response_parser.go:95:41⚠️ should use make(map[string]string) instead (S1019) (megacheck)
pkg/tsdb/elasticsearch/response_parser.go:125:41⚠️ should use make(map[string]string) instead (S1019) (megacheck)
pkg/tsdb/elasticsearch/response_parser.go:317:5⚠️ redundant break statement (S1023) (megacheck)
pkg/tsdb/elasticsearch/response_parser.go:358:5⚠️ redundant break statement (S1023) (megacheck)
2018-09-20 20:07:03 +02:00
Mario Trangoni
b609d81194 pkg/tsdb/elasticsearch/client/search_request.go: simplify loop with
append.

$ gometalinter --vendor --disable-all --enable=megacheck --disable=gotype --deadline=6m ./...
pkg/tsdb/elasticsearch/client/search_request.go:59:4⚠️ should replace loop with sr.Aggs = append(sr.Aggs, aggArray...) (S1011) (megacheck)
pkg/tsdb/elasticsearch/client/search_request.go:303:4⚠️ should replace loop with agg.Aggregation.Aggs = append(agg.Aggregation.Aggs, childAggs...) (S1011) (megacheck)
2018-09-20 20:00:02 +02:00
Daniel Lee
8211f7d0ea stackdriver: add templating support for metric, filter and group by
Still have to figure out if we should have templating for aggregation
fields
2018-09-20 11:44:17 +02:00
Daniel Lee
8d1f293676 stackdriver: use group by fields to create default alias 2018-09-20 00:52:14 +02:00
Mario Trangoni
13a1d0a026 pkg/tsdb/elasticsearch/client/client.go: use time.Since instead of time.Now().Sub
$ gometalinter --vendor --disable=all --enable=megacheck --deadline=10m ./...
pkg/tsdb/elasticsearch/client/client.go:147:13⚠️ should use time.Since instead of time.Now().Sub (S1012) (megacheck)
pkg/tsdb/elasticsearch/client/client.go:190:14⚠️ should use time.Since instead of time.Now().Sub (S1012) (megacheck)
pkg/tsdb/elasticsearch/client/client.go:218:13⚠️ should use time.Since instead of time.Now().Sub (S1012) (megacheck)
2018-09-18 23:42:25 +02:00
Daniel Lee
408d4bda95 stackdriver: add custom User-Agent header 2018-09-18 16:07:14 +02:00
Daniel Lee
e05b86375b stackdriver: remove hardcoding of test project name 2018-09-18 16:02:38 +02:00
Erik Sundell
edf38f040d stackdriver: making sure we dont pass too big alignmentPeriods to the stackdriver api 2018-09-17 17:13:06 +02:00
Erik Sundell
f839d12de4 stackdriver: fix broken tests 2018-09-17 16:33:38 +02:00
Erik Sundell
109f00f584 stackdriver: adds default value for alignment period 2018-09-17 16:33:10 +02:00
Erik Sundell
71b1f7f8fd stackdriver: use alignment period that is passed from frontend. if set to auto, use value provided from the panel. also added tests for alignment period 2018-09-17 16:30:06 +02:00
Erik Sundell
73dc7bddd0 stackdriver: use alignment that is passed from frontend in the query 2018-09-17 14:34:18 +02:00
Daniel Lee
669a1029ed stackdriver: type rename 2018-09-14 17:46:42 +02:00
Daniel Lee
8b72853d36 stackdriver: add support for filtering to backend 2018-09-14 16:20:51 +02:00
Daniel Lee
d0a565d853 stackdriver: improve segments for group bys in query editor 2018-09-14 09:39:17 +02:00
Erik Sundell
add23d9716 stackdriver: load time series meta data for group by dropdown 2018-09-14 09:39:17 +02:00
Erik Sundell
5763d3cae2 stackdriver: make sure distinct labels are returned. also added test 2018-09-14 09:39:17 +02:00
Daniel Lee
9c8593e71f stackdriver: wip - group bys 2018-09-14 09:39:16 +02:00
Daniel Lee
df6b430405 stackdriver: reverse points array to be in ascending order 2018-09-14 09:38:16 +02:00
Daniel Lee
f4fe26c659 stackdriver: adds support for primary aggregations
WIP: Hardcoded values for the aligner and alignment period. Need
to set the aligment period to the closest min interval and
research the aligner more.
2018-09-14 09:38:16 +02:00
Daniel Lee
0b5783563e stackdriver: better error handling and show query metadata
If the Stackdriver returns an error, show that error in the query
editor. Also, allow the user to see the raw querystring that was sent
to google (for troubleshooting).
2018-09-14 09:38:16 +02:00
Daniel Lee
2683699ab4 stackdriver: tests for parsing api response 2018-09-14 09:38:16 +02:00
Daniel Lee
54f16d5558 stackdriver: add first test for parsing frontend queries 2018-09-14 09:38:16 +02:00
Erik Sundell
1288860058 Stackdriver: Break out parse response to its own func 2018-09-14 09:38:16 +02:00
Erik Sundell
56e8e50497 Stackdriver: Use ds_auth_provider in stackdriver. This will make sure the token is renewed when it has exporired 2018-09-14 09:38:16 +02:00
Erik Sundell
7f99a14c58 Stackdriver: Parsed url params 2018-09-14 09:38:16 +02:00
Erik Sundell
c8ec3a345c Stackdriver: Parse datapoints correctly 2018-09-14 09:38:16 +02:00
Erik Sundell
1fe70f8290 Stackdriver: Load example metric and start parsing response 2018-09-14 09:38:16 +02:00
Erik Sundell
9ee61b6606 Add stackdriver backend skeleton 2018-09-14 09:33:50 +02:00
Sven Klemm
0254a29e35 Interpolate $__interval in backend for alerting with sql datasources (#13156)
add support for interpolate $__interval and  $__interval_ms in sql datasources
2018-09-13 16:51:00 +02:00
Mitsuhiro Tanda
28250271cc fix nil pointer dereference (#13221) 2018-09-11 12:53:39 +02:00
Marcus Efraimsson
313a8bd033
Merge pull request #12891 from svenklemm/unixepochgroup
add $__unixEpochGroup and $__unixEpochGroupAlias to sql datasources
2018-08-17 14:41:33 +02:00
Marcus Efraimsson
74077be19e
Merge pull request #12680 from svenklemm/timebucket
[postgres] add timescaledb option to postgres datasource
2018-08-14 12:12:43 +02:00
Sven Klemm
837388d13e Use variable in newPostgresMacroEngine 2018-08-14 09:44:58 +02:00
Sven Klemm
3955133f7e Don't pass datasource to newPostgresMacroEngine 2018-08-14 09:15:24 +02:00
Sven Klemm
3552a4cb86 refactor timescaledb handling in MacroEngine 2018-08-14 08:47:33 +02:00
Sven Klemm
8c4d59363e add $__unixEpochGroup to mssql datasource 2018-08-13 12:23:42 +02:00
Sven Klemm
fbc67a1c64 add $__unixEpochGroup to mysql datasource 2018-08-13 12:17:05 +02:00
Sven Klemm
bfe28ee061 Add $__unixEpochGroup macro to postgres datasource 2018-08-13 12:08:14 +02:00
Sven Klemm
d81a23becf Refactor setting fillmode
This adds SetupFillmode to the tsdb package to be used by the sql
datasources.
2018-08-12 10:51:58 +02:00
Sven Klemm
d2984f3b0f fix rebase error 2018-08-09 10:14:14 +02:00
Sven Klemm
c3aad10047 change timescaledb to checkbox instead of select 2018-08-09 10:05:35 +02:00
Sven Klemm
b987aee7cf add timescaledb option to postgres datasource
This adds an option to the postgres datasource config for
timescaledb support. When set to auto it will check for
timescaledb when testing the datasource.

When this option is enabled the $__timeGroup macro will
use the time_bucket function from timescaledb to group
times by an interval.

This also passes the datasource edit control to testDatasource
to allow for setting additional settings, this might be useful
for other datasources aswell which have optional or version
dependant features which can be queried.
2018-08-09 10:05:35 +02:00
Sven Klemm
ee7602ec1f change fillmode from last to previous 2018-08-07 21:01:41 +02:00
Sven Klemm
bfc66a7ed0 add fillmode "last" to sql datasource
This adds a new fill mode last (last observation carried forward) for grafana
to the sql datasources. This fill mode will fill in the last seen value in a
series when a timepoint is missing or NULL if no value for that series has
been seen yet.
2018-08-02 20:35:09 +02:00
Marcus Efraimsson
5cca478656
Merge pull request #12760 from svenklemm/postgres-timegroup
remove alias from postgres $__timeGroup macro

add $__timeGroupAlias macro to all sql datasources
2018-08-02 16:36:01 +02:00
Marcus Efraimsson
4962bf9d44
remove info logging 2018-08-02 15:49:50 +02:00
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