3
0
mirror of https://github.com/grafana/grafana.git synced 2025-02-25 18:55:37 -06:00
Commit Graph

91 Commits

Author SHA1 Message Date
Arve Knudsen
ec40e49dcb
Chore: Rewrite some tests to use testify ()
* Chore: Improve tests to use testify

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-10-21 10:09:42 +02:00
Carl Bergquist
89ebb97fca
Instrumentation: Adds environment_info metric ()
Signed-off-by: bergquist <carl.bergquist@gmail.com>

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-10-19 16:58:16 +02:00
Marcus Efraimsson
747513d444
Plugins: Fix loading of backend plugins ()
Ref 
2020-10-01 10:39:42 +02:00
Carl Bergquist
7b891d10ee
Instrumentation: Removes invalid chars from label names () 2020-09-30 20:12:57 +02:00
Arve Knudsen
a5d9196a53
Chore/fix lint issues ()
* Chore: Fix linting issues

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-09-22 16:22:19 +02:00
Dan Cech
53153c82fc
add method to get usage report () 2020-09-15 09:01:15 -04:00
Emil Tullstedt
b68634fbb4
Tests: Batch of GoConvey to Testify conversions () 2020-08-14 14:43:25 +02:00
Arve Knudsen
e6e5cc6e80
Chore: Simplify generic OAuth code ()
* Generic OAuth: Simplify

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Rename test variables for consistency

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-08-04 18:28:53 +02:00
Arve Knudsen
415638cdda
Chore: Use interfaces where possible ()
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-07-23 08:17:20 +02:00
Arve Knudsen
4c56eb3991
Chore: Enable goprintffuncname and nakedret linters ()
* Chore: Enable goprintffuncname linter
* Chore: Enable nakedret linter

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-07-23 08:14:39 +02:00
Arve Knudsen
d4e4cb4c71
Chore: Enable Go linter gocritic ()
* Chore: Enable gocritic linter

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-07-16 14:39:01 +02:00
Arve Knudsen
41d432b5ae
Chore: Enable whitespace linter ()
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-07-06 20:17:28 +02:00
Carl Bergquist
26852ca788
Instrument dashboard versions and annotation count () 2020-07-03 15:47:46 +02:00
Arve Knudsen
5070f7a75b
Chore: Start harmonizing linting with plugin SDK ()
* Chore: Harmonize linting with plugin SDK

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Chore: Fix linting issues

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-29 14:08:32 +02:00
Arve Knudsen
07582a8e85
Chore: Fix various spelling errors in back-end code ()
* Chore: Fix various spelling errors in back-end code
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>>
2020-06-01 17:11:25 +02:00
Dan Cech
66b7398fb6
expose metrics for the number of configured datasources () 2020-05-06 11:36:18 -04:00
Arve Knudsen
96ffcaa134
Plugins: Require signing of external back-end plugins ()
* PluginManager: Require signing of external plugins

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-05-04 10:57:55 +02:00
Mario Trangoni
5116420e9a
Fix misspell issues ()
* Fix misspell issues

See,
$ golangci-lint run --timeout 10m --disable-all -E misspell ./...

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>

* Fix codespell issues

See,
$ codespell -S './.git*' -L 'uint,thru,pres,unknwon,serie,referer,uptodate,durationm'

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>

* ci please?

* non-empty commit - ci?

* Trigger build

Co-authored-by: bergquist <carl.bergquist@gmail.com>
Co-authored-by: Kyle Brandt <kyle@grafana.com>
2020-04-29 21:37:21 +02:00
Alexander Zobnin
fa710a3172
Rendering: Add metrics ()
* Rendering: base metrics

* Rendering: rendering_queue_size metric

* Chore: fix linter error

* Rendering metrics: refactoring

* Apply suggestions from code review

Co-Authored-By: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Rendering metrics: handle DeadlineExceeded errors

* Rendering metrics: don't measure canceled request time

* Rendering metrics: revert deleting summary for canceled requests

* Update pkg/services/rendering/rendering.go

Co-Authored-By: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Rendering: return ErrTimeout if context deadline exceeded

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2020-04-27 15:29:46 +03:00
Carl Bergquist
a08cbbcc81
Instrument backend plugin requests () 2020-04-09 14:47:46 +02:00
Carl Bergquist
15bff3114f
Usagestats: Add usage stats about what type of datasource is used in alerting. () 2020-04-02 08:45:04 +02:00
twendt
ff6a082e23
Auth: Azure AD OAuth ()
* Implement Azure AD oauth

* Use go-jose and cleanup

* Update go-jose in go.mod

* cleanup

* Add unit tests

* Fix scopes

* Add documentation page

* Improve documentation

* Convert extract_role into function.

* Do not use upn and replace unique_name with preferred_username

* Configure login button

* Use official microsoft icon and color from branding guideline.

* Add Azure AD config section in sample.ini.
2020-02-13 12:12:25 +03:00
Mark Carey
28230bbf52
Metrics: Adds back missing summary quantiles ()
Adds back missing summary quantiles which was mistakenly
removed in v6.6.0. 

Fixes 
2020-02-05 11:11:14 +01:00
Emil Tullstedt
29687903f8
Admin: Add promotional page for Grafana Enterprise ()
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2020-01-15 14:50:44 +01:00
Marcus Efraimsson
5c711bfb79
Backend Plugins: Collect and expose metrics and plugin process health check ()
Adds support for collecting metrics from backend plugins and 
exposing them thru Grafana's Prometheus metrics endpoint. 
Enables to check health of backend plugin by using the route
`/api/plugins/<plugin id>/health`.
Uses sdk v0.6.0.

Closes 
2020-01-15 13:10:48 +01:00
Dave Henderson
66b70b50b8 Tracing: Support configuring Jaeger client from environment ()
* Tracing: Support configuring Jaeger client from environment
* Tracing: Replace deprecated Jaeger Client call
2019-12-18 20:09:15 +01:00
Arve Knudsen
b1af28122b
Server: Fail when unable to create log directory () 2019-12-02 15:40:32 +01:00
Jon Gyllenswärd
bccc5397f6
Instrumentation: Edition and license info to usage stats ()
* Added edition and licensing info to usage stats
2019-11-22 12:19:00 +01:00
Leonard Gram
992b4b8adf
Licensing service ()
* Licensing: supplies a service to handle licensing information

* Licensing: uses the license service further

Uses the license service instead of settings.isEnterprise:
- external team members
- saml
- usage stats

* Licensing: fixes broken tests due to new Licensing service dependency

* Licensing: fixes linting errors

* Licensing: exposes license expiry information to the frontend
2019-11-01 14:56:12 +01:00
Arve Knudsen
7349a6b96c
pkg/infra: Check errors ()
* pkg/infra: Check errors

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* pkg/infra: Handle errors

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/infra/usagestats/usage_stats.go

Co-Authored-By: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2019-10-10 16:42:11 +02:00
Marcus Efraimsson
80592e3361
Metrics: Adds setting for turning off total stats metrics ()
Don't update total stats metrics if reporting is disabled.
New setting disable_total_stats for turning off update 
of total stats (stat_totals_*) metrics.

Ref 
2019-09-17 09:32:24 +02:00
Kyle Brandt
f689b60426
remotecache: support SSL with redis ()
* update go-redis lib from v2 -> v5
* add ssl option to the redis connection string
fixes 
2019-08-13 06:51:13 -04:00
Dima Kurguzov
a4b0ccc138 Instrumentation: Add failed notifications metric () 2019-07-24 11:43:24 +02:00
Markus Blaschke
31547597d3 remote_cache: Fix redis connstr parsing ()
* Fix redis connstr parsing

* Don’t log the password
2019-07-23 16:45:04 +03:00
Alexander Zobnin
214195441f
SAML: add metrics () 2019-07-19 15:30:31 +03:00
Oleg Gaidarenko
75fa1f0207 Metrics: use consistent naming for exported variables ()
* Metrics: remove unused metrics

Metric `M_Grafana_Version` is not used anywhere, nor the mentioned
`M_Grafana_Build_Version`. Seems to be an artefact?

* Metrics: make the naming consistent

* Metrics: add comments to exported vars

* Metrics: use proper naming

Fixes 
2019-07-16 16:58:46 +02:00
Oleg Gaidarenko
09eb9a45ce
Metrics: add LDAP active sync summary metric () 2019-07-15 08:33:48 +03:00
Kyle Brandt
0adbb001db RemoteCache: redis connection string parsing test () 2019-06-24 11:51:38 +02:00
Sofia Papagiannaki
7b70e7db2d
AuthProxy: Optimistic lock pattern for remote cache Set ()
* Implementation of optimistic lock pattern

Try to insert the remote cache key and handle integrity error

* Remove transaction

Integrity error inside a transaction results in deadlock

* Remove check for existing remote cache key

Is no longer needed since integrity constrain violations are handled

* Add check for integrity constrain violation

Do not update the row if the insert statement fails
for other than an integrity constrain violation

* Handle failing inserts because of deadlocks

If the insert statement fails because of a deadlock
try to update the row

* Add utility function for returning SQL error code

Useful for debugging

* Add logging for failing expired cache key deletion

Do not shallow it completely

* Revert "Add utility function for returning SQL error code"

This reverts commit 8e0b82c79633e7d8bc350823cbbab2ac7a58c0a5.

* Better log for failing deletion of expired cache key

* Add some comments

* Remove check for existing cache key

Attempt to insert the key without checking if it's already there
and handle the error situations

* Do not propagate deadlocks created during update

Most probably somebody else is trying to insert/update
the key at the same time so it is safe enough to ignore it
2019-06-13 15:36:09 +02:00
Carl Bergquist
6809d2bb29
codestyle: moves cache to infra () 2019-06-13 10:55:38 +02:00
Kyle Brandt
c09fe3c3b4
remote_cache: Fix redis ()
* wip: fix remote cache for redis
connstr parsing and non-negative expires for 
TODO: finish parse, check zero case, find out why negative duration in the first place

* finish parse.
Still TODO, find out negative value, and decide if would be better to make database specific entries in the .ini file

* update ini files

* remove accidental uncomment in defaults.ini

* auth_proxy: expiration non-negative so expiration is not in the past

* fix test, revert neg in redis

* review: use errutil
2019-06-10 15:27:08 +02:00
Carl Bergquist
1aadb4426a
metrics: expose stats about roles as metrics () 2019-06-06 16:39:35 +02:00
Jonathan Rockway
02975256d1 Tracing: allow propagation with Zipkin headers ()
Closes 
2019-06-05 13:12:05 +02:00
Mario Trangoni
87760d4fde Codestyle: Fix govet issues ()
ref 

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2019-06-04 22:00:05 +02:00
Oleg Gaidarenko
9b7f9dd9be
LDAP: consistently name the LDAP entities () 2019-05-22 15:30:03 +03:00
Carl Bergquist
aed3d0d3ad
Remotecache: Avoid race condition in Set causing error on insert. ()
* remotecache: avoid race condition in set

since set called the database twice without transactions another
operation could insert a value before the first operation completed.
which would raise an error on insert since the data have been inserted
by the other request.

closes 
2019-05-15 11:24:04 +02:00
Carl Bergquist
3df94c6f27
serverlock: run tests async should be more linear time wise () 2019-05-14 15:38:18 +02:00
zhulongcheng
2fff8f77dc move log package to /infra ()
ref 

Signed-off-by: zhulongcheng <zhulongcheng.me@gmail.com>
2019-05-13 08:45:54 +02:00
Oleg Gaidarenko
54c1bf0cc9
Chore: a bit of spring cleaning ()
* Chore: use early return technic everywhere

And enable "indent-error-flow" revive rule

* Chore: remove if-return rule from revive config

* Chore: improve error messages

And enable "error-strings" revive rule

* Chore: enable "error-naming" revive rule

* Chore: make linter happy

* Chore: do not duplicate gofmt execution

* Chore: make linter happy

* Chore: address the pull review comments
2019-04-23 11:24:47 +03:00
Carl Bergquist
3f136e0da9
tech: replace bmizerany/assert with stretchr/testify ()
bmizerany is old and unsupported. so we are replacing it
with stretchr which is an drop in replacement and something
we want to use more in Grafana.
2019-04-17 10:25:58 +02:00