Commit Graph

3802 Commits

Author SHA1 Message Date
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
Mario Trangoni
f19fd1a9b0 pkg/plugins/dashboards_updater.go: Simplify err check
$ gometalinter --vendor --disable=all --enable=megacheck --deadline=10m ./...
pkg/plugins/dashboards_updater.go:51:2⚠️ 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013) (megacheck)
2018-09-18 23:42:25 +02:00
Mario Trangoni
bb5aaa2dce pkg/services/sqlstore/alert_notification.go: Simplify err check
$ gometalinter --vendor --disable=all --enable=megacheck --deadline=10m ./...
pkg/services/sqlstore/alert_notification.go:242:3⚠️ 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013) (megacheck)
2018-09-18 23:42:20 +02:00
Torkel Ödegaard
d964a6505f
Merge pull request #13305 from bergquist/devenv_cleanup
removes unused files
2018-09-18 12:32:26 +02:00
Nick Triller
f8ca55bb1f Fix setting test 2018-09-17 17:56:52 +02:00
bergquist
8dbba467f1 moves /tests to /pkg/plugins
ref #11433
2018-09-17 17:29:47 +02:00
Torkel Ödegaard
e74ce72410
Merge pull request #13301 from bergquist/devenv_tests
moves files from /tests to more appropriate folders
2018-09-17 15:51:42 +02:00
Carl Bergquist
f2247c160a
Merge pull request #13279 from bergquist/init_some_counter_as_zero
Internal metrics: starts counters at zero
2018-09-17 11:09:19 +02:00
Carl Bergquist
f22f1d46c8
Merge pull request #10163 from grafana/9587_annotation_tags_wih_temp_var
annotations: allows template variables to be used in tag filter
2018-09-17 10:34:38 +02:00
Carl Bergquist
6dff5e6bc7
Merge pull request #13295 from mjtrangoni/fix-some-megacheck-issues
Fix some megacheck issues
2018-09-17 10:13:34 +02:00
bergquist
8e5000fb31 moves files from /tests to more appropriate folders
ref #11433
2018-09-17 10:10:20 +02:00
Marcus Efraimsson
b2833daf32
Merge pull request #13285 from marefr/team_member_ext
Team member labels
2018-09-17 09:14:06 +02:00
Mario Trangoni
e85d0e8d6b pkg/services/sqlstore: Fix sess.Id is deprecated: use ID instead. (megacheck)
See,
$ gometalinter --vendor --disable-all --enable=megacheck --disable=gotype --deadline 6m ./... | grep ID
alert.go:193:15⚠️ sess.Id is deprecated: use ID instead  (SA1019) (megacheck)
alert.go:252:18⚠️ sess.Id is deprecated: use ID instead  (SA1019) (megacheck)
annotation.go:113:12⚠️ sess.Table("annotation").Id is deprecated: use ID instead  (SA1019) (megacheck)
org.go:136:24⚠️ sess.Id is deprecated: use ID instead  (SA1019) (megacheck)
org.go:169:16⚠️ sess.Id is deprecated: use ID instead  (SA1019) (megacheck)
org_users.go:24:21⚠️ sess.Id is deprecated: use ID instead  (SA1019) (megacheck)
org_users.go:88:12⚠️ sess.Id is deprecated: use ID instead  (SA1019) (megacheck)
org_users.go:141:21⚠️ sess.Id is deprecated: use ID instead  (SA1019) (megacheck)
plugin_setting.go:103:12⚠️ sess.Id is deprecated: use ID instead  (SA1019) (megacheck)
preferences.go:97:12⚠️ sess.Id is deprecated: use ID instead  (SA1019) (megacheck)
quota.go:119:17⚠️ sess.Id is deprecated: use ID instead  (SA1019) (megacheck)
quota.go:221:17⚠️ sess.Id is deprecated: use ID instead  (SA1019) (megacheck)
team.go:77:24⚠️ sess.Id is deprecated: use ID instead  (SA1019) (megacheck)
user.go:243:16⚠️ sess.Id is deprecated: use ID instead  (SA1019) (megacheck)
user.go:267:13⚠️ sess.Id is deprecated: use ID instead  (SA1019) (megacheck)
user.go:282:13⚠️ sess.Id is deprecated: use ID instead  (SA1019) (megacheck)
user.go:313:12⚠️ sess.Id is deprecated: use ID instead  (SA1019) (megacheck)
user.go:475:3⚠️ sess.Id is deprecated: use ID instead  (SA1019) (megacheck)
user.go:479:13⚠️ sess.Id is deprecated: use ID instead  (SA1019) (megacheck)
user.go:493:13⚠️ sess.Id is deprecated: use ID instead  (SA1019) (megacheck)
2018-09-16 12:37:08 +02:00
Mario Trangoni
f73236f8f4 pkg/services/sqlstore: Fix x.Sql is deprecated: use SQL instead. (megacheck)
See,
$ gometalinter --vendor --disable-all --enable=megacheck --disable=gotype --deadline 6m ./... | grep SQL
alert.go:43:9⚠️ x.Sql is deprecated: use SQL instead.  (SA1019) (megacheck)
alert_notification.go:122:12⚠️ sess.Sql is deprecated: use SQL instead.  (SA1019) (megacheck)
annotation.go:226:12⚠️ x.Sql is deprecated: use SQL instead.  (SA1019) (megacheck)
dashboard.go:228:9⚠️ x.Sql is deprecated: use SQL instead.  (SA1019) (megacheck)
dashboard.go:302:10⚠️ x.Sql is deprecated: use SQL instead.  (SA1019) (megacheck)
dashboard.go:416:9⚠️ x.Sql is deprecated: use SQL instead.  (SA1019) (megacheck)
dashboard.go:635:12⚠️ x.Sql is deprecated: use SQL instead.  (SA1019) (megacheck)
migrations/user_mig.go:137:9⚠️ sess.Sql is deprecated: use SQL instead.  (SA1019) (megacheck)
plugin_setting.go:29:10⚠️ x.Sql is deprecated: use SQL instead.  (SA1019) (megacheck)
quota.go:41:12⚠️ x.Sql is deprecated: use SQL instead.  (SA1019) (megacheck)
quota.go:84:13⚠️ x.Sql is deprecated: use SQL instead.  (SA1019) (megacheck)
quota.go:143:12⚠️ x.Sql is deprecated: use SQL instead.  (SA1019) (megacheck)
quota.go:186:13⚠️ x.Sql is deprecated: use SQL instead.  (SA1019) (megacheck)
quota.go:234:12⚠️ x.Sql is deprecated: use SQL instead.  (SA1019) (megacheck)
team.go:172:12⚠️ x.Sql is deprecated: use SQL instead.  (SA1019) (megacheck)
team.go:199:17⚠️ x.Sql is deprecated: use SQL instead.  (SA1019) (megacheck)
team.go:223:9⚠️ x.Sql is deprecated: use SQL instead.  (SA1019) (megacheck)
temp_user.go:99:10⚠️ x.Sql is deprecated: use SQL instead.  (SA1019) (megacheck)
temp_user.go:124:10⚠️ x.Sql is deprecated: use SQL instead.  (SA1019) (megacheck)
user.go:375:3⚠️ sess.Sql is deprecated: use SQL instead.  (SA1019) (megacheck)
user.go:377:3⚠️ sess.Sql is deprecated: use SQL instead.  (SA1019) (megacheck)
user.go:379:3⚠️ sess.Sql is deprecated: use SQL instead.  (SA1019) (megacheck)
2018-09-16 12:26:05 +02:00
Marcus Efraimsson
9a6446c2b5
new column for team_member table 2018-09-14 17:27:36 +02:00
Cyril Bonté
0f4ee4ce87 fix hipchat color code used "no data" notifications 2018-09-14 17:22:07 +02:00
Torkel Ödegaard
f2833bfd52
Merge pull request #13252 from grafana/10040_active_directory
docs: include active directory ldap example and restructure
2018-09-14 17:09:44 +02:00
Torkel Ödegaard
5fbe8eff4f ldap: made minor change to group search, and to docs 2018-09-14 11:28:17 +02:00
bergquist
0bf5a6ad71 metrics: starts some counters at zero
without starting the counter as zero Grafana will not send any metrics
to graphite using the bridge.
2018-09-14 10:06:10 +02:00
Carl Bergquist
047fb770c8
Merge pull request #13269 from DanCech/pluginUpgrade
use pluginName consistently when upgrading plugins
2018-09-14 09:35:58 +02:00
Torkel Ödegaard
0e9a6dcedc Use datasource cache for backend tsdb/query endpoint (#13266)
fix: use datasource cache for backend datasources
2018-09-14 09:30:32 +02:00
Dan Cech
124b21a6aa
use pluginName consistently when upgrading plugins 2018-09-13 17:19:51 -04:00
Torkel Ödegaard
06855d2bc3
Merge pull request #13253 from grafana/13240_auth_stats
Fix anonymous usage stats for authentication types
2018-09-13 21:17:16 +02:00
Torkel Ödegaard
4b0eeab2b3
Merge pull request #13259 from bergquist/disable_metrics_endpoint
[metrics]enabled = false should disable the /metrics endpoint.
2018-09-13 21:14:28 +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
Marcus Efraimsson
1d66f9a42c
anonymous usage stats for authentication types 2018-09-13 16:36:23 +02:00
bergquist
bff350166e disabling internal metrics disables /metric endpoint
but we will still keep sending metrics to graphite

closes #10638
2018-09-13 16:09:52 +02:00
bergquist
aed8208d78 renames PartialMatch to MatchAny 2018-09-13 15:15:42 +02:00
bergquist
835a75335c Merge branch 'master' into 9587_annotation_tags_wih_temp_var
* master:
  fix theme parameter not working problem while prefer theme set to light (#13232)
  fix: added type export to fix failing test
  fix: fixed typescript test error
  another circleci fix
  Another circleci fix
  changed gometalinter to use github master
  commented out metalinter as gopkg is having issues
  Fix prometheus label filtering for comparison queries (#13213)
  Upgrade react and enzyme (#13224)
  Teams page replace mobx (#13219)
  upgrade of typescript and tslint and jest (#13223)
  fix nil pointer dereference (#13221)
2018-09-12 09:23:54 +02:00
qhyou11
1786198558 fix theme parameter not working problem while prefer theme set to light (#13232) 2018-09-12 06:52:38 +02:00
bergquist
1638c6bea1 enable partial tag matches for annotations 2018-09-11 15:50:04 +02:00
Mitsuhiro Tanda
28250271cc fix nil pointer dereference (#13221) 2018-09-11 12:53:39 +02:00
Carl Bergquist
5069e4eadd
Merge pull request #11681 from Jonnymcc/sort-dashboard-tags
Sort results from GetDashboardTags
2018-09-11 09:19:30 +02:00
Bob Shannon
f257ff0216 Allow oauth email attribute name to be configurable (#13006)
* Allow oauth email attribute name to be configurable

Signed-off-by: Bob Shannon <bshannon@palantir.com>

* Document e-mail determination steps for generic oauth

* Add reference to email_attribute_name

* Re-add e-mail determination docs to new generic-oauth page

* Inherit default e-mail attribute from defaults.ini
2018-09-10 09:45:07 +02:00
Marcus Efraimsson
fc597260c0
Merge pull request #13167 from holiiveira/teams-image
Alert Teams - Adding Action to view the graph by its public URL.
2018-09-07 11:24:06 +02:00
Marcus Efraimsson
a1d1c4fb9a
fix code formatting 2018-09-07 11:06:19 +02:00
Carl Bergquist
b070784b8a adds usage stats for alert notifiers (#13173) 2018-09-06 21:03:09 +02:00
Carl Bergquist
3c0b1ef581
Merge pull request #13170 from bergquist/alerting_default_setting
make default values for alerting configurable
2018-09-06 13:26:42 +02:00
bergquist
3ce89cad71 make default values for alerting configurable 2018-09-06 11:26:14 +02:00
Henrique Oliveira
e983f8f54b Adding Action to view the graph by its public URL. 2018-09-05 17:35:22 -03:00
Leonard Gram
5d87aa2fa4
Merge pull request #13031 from bergquist/golang_1.11
upgrade to golang 1.11
2018-09-05 15:31:43 +02:00
Leonard Gram
275f613050 Only authenticate logins when password is set (#13147)
* auth: never authenticate passwords shorter than 4 chars.

* auth: refactoring password length check.

* auth: does not authenticate when password is empty.

* auth: removes unneccesary change.
2018-09-05 12:12:46 +02:00
Anthony Woods
5c0fbbf7c8 improve remote image rendering (#13102)
* improve remote image rendering

- determine "domain" during Init() so we are not re-parsing settings
  on every request
- if using http-mode via a rednererUrl, then use the AppUrl for the
  page that the renderer loads.  When in http-mode the renderer is likely
  running on another server so trying to use the localhost or even the
  specific IP:PORT grafana is listening on wont work.
- apply the request timeout via a context rather then directly on the http client.
- use a global http client so we can take advantage of connection re-use
- log and handle errors better.

* ensure imagesDir exists

* allow users to define callback_url for remote rendering

- allow users to define the url that a remote rendering service
  should use for connecting back to the grafana instance.
  By default the "root_url" is used.

* improve remote image rendering

- determine "domain" during Init() so we are not re-parsing settings
  on every request
- if using http-mode via a rednererUrl, then use the AppUrl for the
  page that the renderer loads.  When in http-mode the renderer is likely
  running on another server so trying to use the localhost or even the
  specific IP:PORT grafana is listening on wont work.
- apply the request timeout via a context rather then directly on the http client.
- use a global http client so we can take advantage of connection re-use
- log and handle errors better.

* ensure imagesDir exists

* allow users to define callback_url for remote rendering

- allow users to define the url that a remote rendering service
  should use for connecting back to the grafana instance.
  By default the "root_url" is used.

* rendering: fixed issue with renderKey where userId and orgId was in mixed up, added test for RenderCallbackUrl reading logic
2018-09-04 13:42:55 +02:00
maicon
a6aa219895 Reopen log files after receiving a SIGHUP signal (#13112)
* Reopen log files after receiving a SIGHUP signal

Implements a system signals listener in log.FileLogWriter.

After receiving a SIGHUP signal from the system, the listener will close the current log file and then open it again.

The listener will finishes after receiving a SIGINT, SIGKILL or SIGTERM signal.

Closes grafana/grafana#2497

* Move the SIGHUP handling to the main file
2018-09-04 10:31:41 +02:00
Carl Bergquist
ee1083d9b4 cli: avoid rely on response.ContentLength (#13120)
response.ContentLength might be invalid if the http response
is chunked.

fixes #13079
2018-09-03 20:33:21 +02:00
Marcus Efraimsson
1ceca5d8ec
Merge pull request #12145 from grafana/alerting_reminder
Alerting notification reminder
2018-09-03 14:41:38 +02:00
Jasper Lievisse Adriaanse
d668a922e6 Return correct path for OpenBSD in cli's returnOsDefault (#13089) 2018-08-30 11:56:52 +02:00
bergquist
12c9860882 string formating fixes 2018-08-28 22:33:38 +02:00
bergquist
ff7b0d4f63 go fmt fixes 2018-08-28 22:14:15 +02:00
Marcus Efraimsson
eba147c1a3
change/add tests for alerting notification reminders 2018-08-24 19:09:19 +02:00