Commit Graph

6709 Commits

Author SHA1 Message Date
Alexander Emelin
87cdda4106
Live: return pipeline menu, now with feature toggle (#39280) 2021-09-16 08:34:12 -07:00
gotjosh
7db97097c9
Alerting: Support Unified Alerting with Grafana HA (#37920)
* Alerting: Support Unified Alerting in Grafana's HA mode.
2021-09-16 15:33:51 +01:00
Torkel Ödegaard
95fd659bfc
SideMenu: Remove live section from main side menu (#39278) 2021-09-16 10:12:54 +02:00
Santiago
c3cf95f383
Revert "Alerting: add template funcs (#38404)" (#39258)
This reverts commit d6fb0181fb.
2021-09-15 19:47:22 -03:00
Santiago
0d2e68537c
Alerting: Cleanup template, silence and notification files created du… (#39007)
* Alerting: Cleanup template, silence and notification files created during tests

* Create tempdir for testing, delete afterwards and check for errors

* Refactoring error checks

* Update docs/sources/enterprise/access-control/fine-grained-access-control-references.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/administration/configuration.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/fine-grained-access-control-references.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-09-15 18:48:52 -03:00
Santiago
d6fb0181fb
Alerting: add template funcs (#38404)
* Alerting: (wip) add template funcs

* Alerting: (wip) numeric template functions

* Alerting: (wip) template functions

* Test for the "args" function

* Alerting: (wip) Documentation for template functions

* Alerting: template functions - refactor

* code review changes

* disable linter error

* Use Prometheus implementation of TemplateExpander

* Update docs/sources/alerting/unified-alerting/alerting-rules/create-grafana-managed-rule.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-09-15 18:48:29 -03:00
Marcus Efraimsson
e31b8f4d33
Chore: Remove SQL engine cache (#39254)
Fix bug with engine cache not updating after data source updated, introduced in #36635.
Removes the SQL engine cache because since #36635 we already have instance caching in place using the SDK instance manager.
This also adds support for disposing cached SQL/xorm engines before a query happens to a data source that has been updated. Done by letting the SQL engine implementing the InstanceDisposer interface.

Fixes #37299
2021-09-15 23:03:25 +02:00
Atif Shoukat Ali
64ff15c157
Live: default to constant label value for pipeline (#39211) 2021-09-15 13:10:52 -07:00
Dan Cech
f8ae71af5b
Usage Stats Updates (#39235)
* add randomly-generated anonymous id to usage reports
* include uptime in stats
* add last_sent tracking, remove metricsLogger
2021-09-15 11:47:44 -04:00
Erik Sundell
9d3f4f5983
Analytics: Instrument Azure Application Insights (#38553)
* add backend

* read config and pass to backend

* update config docs

* change var name

* use connection string instead of instrumentation key

* add config for endpoint url. update docs

* update default ini

* add spaces

* remove space

* Update docs/sources/administration/configuration.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update conf/defaults.ini

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update conf/defaults.ini

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-09-15 13:00:38 +02:00
Serge Zaitsev
6005e6572d
Chore: fix param names in ctx.ParamsInt64 (#39223) 2021-09-15 12:14:15 +02:00
Dimitris Sotirakis
fdc681788b
InfluxDB: Fix regex to identify / as separator (#39185)
* Fix regex to identify / as separator

* Update regex
2021-09-15 09:37:33 +01:00
Alexander Emelin
15e278e9e1
Live: search for pipeline files in data folder (#39198)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-09-14 22:27:51 +02:00
Serge Zaitsev
063160aae2
Chore: pass url parameters through context.Context (#38826)
* pass url parameters through context.Context

* fix url param names without colon prefix

* change context params to vars

* replace url vars in tests using new api

* rename vars to params

* add some comments

* rename seturlvars to seturlparams
2021-09-14 18:34:56 +02:00
Marcus Efraimsson
fa9857499b
Chore: GetDashboardQuery should be dispatched using DispatchCtx (#36877)
* Chore: GetDashboardQuery should be dispatched using DispatchCtx

* Fix after merge

* Changes after review

* Various fixes

* Use GetDashboardCtx function instead of GetDashboard
2021-09-14 16:08:04 +02:00
gotjosh
2b1d3d27e4
Alerting: Fix bug not creating filepath for silences/nflog if it does not exist (#39174)
We created this filepath just as we're about persist the templates - with the latest change, we now need to create it sooner.
2021-09-14 14:40:59 +01:00
Dimitris Sotirakis
f5ecf5c2d9
Cast fields to int64 (#39179) 2021-09-14 14:57:12 +02:00
gotjosh
a2f4344bf2
Alerting: Refactor & fix unified alerting metrics structure (#39151)
* Alerting: Refactor & fix unified alerting metrics structure

Fixes and refactors the metrics structure we have for the ngalert service. Now, each component has its own metric struct that includes the JUST the metrics it uses. Additionally, I have fixed the configuration metrics and added new metrics to determine if we have discovered and started all the necessary configurations of an instance.

This allows us to alert on `grafana_alerting_discovered_configurations - grafana_alerting_active_configurations != 0` to know whether an alertmanager instance did not start successfully.
2021-09-14 12:55:01 +01:00
Emil Tullstedt
ad971cc9be
LDAP: Search all DNs for users (#38891) 2021-09-14 10:49:37 +02:00
An
45e67630e8
Live: admin config UI (#39103)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Atif Ali <atifshoukatali@yahoo.com>
2021-09-13 21:09:55 -07:00
Marcus Efraimsson
2cc0788187
Chore: Disable backend test for now since it adds 10 minutes extra in CI (#39150)
Ref #38586
2021-09-13 19:37:26 +02:00
Peter Leitzen
4f70113ea0
OAuth: Support role mapping for GitLab OAuth (#30025)
* Support `role_attribute_path` for GitLab OAuth

Allow role mapping for GitLab accounts.

Example:

  [auth.gitlab]
  role_attribute_path = is_admin && 'Admin' || 'Viewer'

* Support `role_attribute_path` for GitLab OAuth

Allow role mapping for GitLab accounts.

Example:

  [auth.gitlab]
  role_attribute_path = is_admin && 'Admin' || 'Viewer'

* docs: add docs for role_attribute_path

* Apply suggestions from code review

Co-authored-by: Peter Leitzen <splattael@users.noreply.github.com>

* docs: update example

example should suggest a full configuration

* Apply suggestions from code review

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Apply suggestions from code review

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>

* docs: add suggestions from tech writers

Co-authored-by: Henry Sachs <Henry.Sachs@deutschebahn.com>
Co-authored-by: Henry Sachs <henrysachs@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>
2021-09-13 12:44:37 -04:00
David Lamb
89878dae1b
OAuth: clarify role & group paths prefer id_token over userinfo api (#39066)
* OAuth: clarify role & group paths prefer id_token over userinfo api (#39066)

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
2021-09-13 18:15:15 +02:00
Will Browne
1a71f0fe13
Chore: Add WARN log if grafana server process is running with elevated privileges (#35205)
* warn on linux

* add warning for grpc plugins

* add windows support

* update go.mod

* reorganize imports

* update naming

* remove Windows logic

* simplify and add check for when UID and EUID don't match

* fix build

* tidy go.mod

* feedback

* cleanup + migrate
2021-09-13 17:46:47 +02:00
Will Browne
40267f5ea0
Plugins: Fix "too many open files" error when verifying signature of plugin with many files (#39100)
* close file at loop end

* less tired approach
2021-09-13 17:46:26 +02:00
Dan Cech
9dfd469afc
add daily active counts to stats (#38842)
* add daily active counts to stats

* standardize on int64, update tests
2021-09-13 10:29:35 -04:00
Serge Zaitsev
e1e385b318
Chore: Remove untyped data map from macaron context (#39077) 2021-09-13 15:41:03 +02:00
Marcus Efraimsson
1c892a2fc4
Postgres/MySQL/MSSQL: Add setting to limit maximum amount of rows processed (#38986)
Adds a new setting dataproxy.row_limit that allows an operator to limit the 
amount of rows being processed/accepted in response to database queries 
originating from SQL data sources.

Closes #38975
Ref #39095

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-09-13 15:27:51 +02:00
Ivana Huckova
f172701043
IntervalV2: Use maxDataPoints to calculate correct interval (#39036)
* Use max data points to calculate interval

* Fix mockCalculator to mach Calculator

* Fix incorrect merge, replace queryModel with query
2021-09-13 14:58:32 +02:00
Serge Zaitsev
abfdfcf405
Plugins: Support multiple HTTP methods in plugin.json routes (#39069)
* Fix: support comma-separated methods in plugin.json

* update docs about multiple methods per route
2021-09-13 13:32:11 +02:00
sam boyer
f8d79d301c
Rename Family to Panel in models.cue (#39111) 2021-09-12 14:34:33 -04:00
Ivana Huckova
4952f6fc58
Prometheus: Add interpolation for built-in-time variables to backend (#39051)
* Add grafana variable interpolation to backend

* Remove newlines
2021-09-10 22:56:15 +02:00
Carl Bergquist
cbf16bebc6
CDN: always look for files in the root folder (#39092)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2021-09-10 16:48:13 +02:00
Ryan McKinley
6bda64cb19
Grafana: include a built-in backend datasource (#38571) 2021-09-10 07:44:47 -07:00
Dimitris Sotirakis
ba9d5540b8
Datasources: Introduce response_limit for datasource responses (#38962)
* Introduce response_limit for datasource responses

* Fix lint

* Fix tests

* Add case where limit <= 0 - added parametrized tests

* Add max_bytes_reader.go

* Use new httpclient.MaxBytesReader instead of net/http one

* Fixes according to reviewer's comments

* Add tests for max_bytes_reader

* Add small piece in configuration.md

* Further fixes according to reviewer's comments

* Fix linting - fix test
2021-09-10 16:51:06 +03:00
Alexander Emelin
5fcc9fe193
temporary switch to alternative jsonpath implementation (#39090)
to work with go1.16 and avoid replace in go.mod
2021-09-10 16:24:31 +03:00
Sofia Papagiannaki
7af329f385
Alerting: Fix API specification (#38753)
* Alerting: Fix API spec

* Add missing status codes
2021-09-10 12:46:02 +03:00
Hugo Häggmark
fc73bc1161
LibraryElements: Enables creating library elements with specific UID (#39019)
* LibraryPanels: Enables create/update library panels with specific UID

* Chore: added check for uid length after PR comments

* Refactor: creates IsShortUIDTooLong function

* Refactor: adds UID to PATCH endpoint

* Refactor: clarifies the patch code

* Refactor: changes  after PR comments
2021-09-10 11:22:13 +02:00
Sergey Kostrukov
06a616e630
Update Azure SDK with bug fixes (#38952) 2021-09-09 17:32:36 +01:00
gotjosh
39a3bb8a1c
Alerting: Persist notification log and silences to the database (#39005)
* Alerting: Persist notification log and silences to the database

This removes the dependency of having persistent disk to run grafana alerting. Instead of regularly flushing the notification log and silences to disk we now flush the binary content of those files to the database encoded as a base64 string.
2021-09-09 17:25:22 +01:00
Alexander Emelin
3ee861f57e
Live: declarative processing pipeline, input -> frames -> output, toggle protected POC (#37644) 2021-09-09 19:19:29 +03:00
Carl Bergquist
d19f33b52f
Annotations: don't log context.Cancelled as an error when cleaning up (#39024)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2021-09-09 18:13:14 +02:00
Sofia Papagiannaki
b56bf83c19
Alerting: Fix notification channel migration (#38983) 2021-09-09 18:53:06 +03:00
jcolladokuri
aa45eebf3d
Azure Monitor: changed ARG API version to 2021-06-01-preview (#38951)
* changed ARG API version to 2021-06-01-preview

* Fixing lint error
2021-09-09 17:00:16 +02:00
Kyle Brandt
fb14769383
Macaron: Continue on invalid slice type to avoid panic (#39004)
Makes the panic go away.
Otherwise I get a reflect: call of reflect.Value.Interface on zero Value
2021-09-09 10:32:18 -04:00
Todd Treece
6e667cacee
Alerting: Skip query cache for alert queries (#39010) 2021-09-09 16:16:05 +02:00
Yuriy Tseretyan
6c2884ac37
Alerting: Fix notifier tests to close the temp file (#38992) 2021-09-09 09:56:42 -04:00
Serge Zaitsev
4c921cf120
remove default return handler from macaron (#38887) 2021-09-09 15:41:34 +02:00
Kevin Minehart
792fa63725
set opts.version after getting version from package.json (#39038) 2021-09-09 15:40:08 +02:00
Giordano Ricci
dc36f15fbb
Prometheus: Revert stepMode functionality (#38982)
* Revert "Prometheus: add functionality to specify desired step interval in dashboards panels (#36422)"

This reverts commit ddf5b65c51.
Co-authored-by: Ivana Huckova <ivana.huckova@gmail.com>

* Revert "Explore: add functionality for supporting different step modes in prometheus (#37829)"

This reverts commit f433cfd8d9.
Co-authored-by: Ivana Huckova <ivana.huckova@gmail.com>

* Revert stepMode BE implementation from #36796
Co-authored-by: "Ivana Huckova" <ivana.huckova@gmail.com>
2021-09-09 14:05:08 +02:00