Commit Graph

40622 Commits

Author SHA1 Message Date
Dominik Prokop
83199c4bf5
Dashboard schema: Review and mature timezone property (#62090)
* Review and mature timezone property of Dashboard kind

* Update timezone type
2023-01-27 07:13:33 -08:00
Eric Leijonmarck
5531e22f46
Auth: Add disable of team sync for JWT Authentication (#62191)
* fix: disable team sync for JWT Authentication

* add: comment to test

* change test to conform to new expected behavior

* fix: spelling

* formatting
2023-01-27 16:05:25 +01:00
Sven Grossmann
df2db3bb23
LogContext: Fix setting wrong height for ElasticSearch (#62330)
fix wrong height for elastic
2023-01-27 15:41:16 +01:00
Andreas Christou
5bdfbd93a5
Bump code coverage version (#62322)
* Bump code coverage version

* Update codeowners to include aws-plugins

* Bump version further
2023-01-27 14:33:48 +00:00
Ezequiel Victorero
a128944471
PublicDashboards: moved tokens service and new repository method (#61806) 2023-01-27 11:20:22 -03:00
Sriram
89ef62f163
Chore: Removed unused grafana-plugin-ci images (#62219)
removed unused grafana-plugin-ci images
2023-01-27 14:19:42 +00:00
Andre Pereira
afd39c18ba
Explore: Refactor trace view and move to core (#61938)
* Move TraceView to core grafana

* Remove unused code

* yarn install

* Remove jaeger-ui-components from CODEOWNERS and other tools

* Type fixes

* yarn install

* Remove mock that we no longer need

* Fix merge conflicts

* Re-add Apache license for trace view components

* Use an exclamation-circle instead of triangle to denote errors

* Remove eslint disables and update betterer results instead
2023-01-27 14:13:17 +00:00
Sven Grossmann
7c02d9bb8a
Logs: Add experimental support to display a datasource custom UI in LogContext (#62189)
* add loki contextfilter component

* add `getLogRowContextUi` support to DataSourceAPI

* add `runContextQuery` to LogRowContextProvider

* pass `getRowContextUi` to `LogRowContext`

* adapt LogRowContext to show datasource ui

* implement LogRowContextUi in Loki

* add `logsContextDatasourceUi` feature flag

* change state to `Alpha`

* disable the feature if `logsContextDatasourceUi` is not set

* don't fetch labels in the constructor

* adjust to right height

* remove unnecessary eslint disable

* add test for LokiContextUi

* move code down in datasource.ts

* rename `refresh` to `runContextQuery`

* update datasource tests

* don't update if `updateFilter` fn changes

* organized imports in datasource.test.ts

* don't trigger on intialization changes

* change tag to `experimental`

* move `getLogRowContextUi` to props
2023-01-27 15:12:01 +01:00
Giuseppe Guerra
af1e2d68da
Plugins: Allow loading panel plugins from a CDN (#59096)
* POC: Plugins CDN reverse proxy

* CDN proxy POC: changed env var names

* Add authorization: false for /public path in frontend plugin loader

* Moved CDN settings to Cfg, add some comments

* Fix error 500 in asset fetch if plugin is not using CDN

* Fix EnterpriseLicensePath declared twice

* Fix linter complaining about whitespaces

* Plugins CDN: Skip signature verification for CDN plugins

* Plugins CDN: Skip manifest and signature check for cdn plugins

* Plugins: use IsValid() and IsInternal() rather than equality checks

* Plugins CDN: remove comment

* Plugins CDN: Fix seeker can't seek when serving plugins from local fs

* Plugins CDN: add back error codes in getLocalPluginAssets

* Plugins CDN: call asset.Close() rather than asset.readSeekCloser.Close()

* Plugins CDN: Fix panic in JsonApiErr when errorMessageCoder wraps a nil error

* Plugins CDN: Add error handling to proxyCDNPluginAsset

* Plugins CDN: replace errorMessageCoder with errutil

* Plugins CDN POC: expose cdn plugin paths to frontend for system.js

* Plugins CDN: Fix cdn plugins showing as unsigned in frontend

* WIP: Add support for formatted URL

* Fix missing cdnPluginsBaseURLs in GrafanaConfig

* Plugins CDN: Remove reverse proxy mode and reverse proxy references

* Plugins CDN: Simplify asset serving logic

* Plugins CDN: sanitize redirect path

* Plugins CDN: Removed unused pluginAsset type

* Plugins CDN: Removed system.js changes

* Plugins CDN: Return different system.js baseURL and module for cdn plugins

* Plugins CDN: Ensure CDN is disabled for non-external plugins

* lint

* Plugins CDN: serve images and screenshots from CDN, refactoring

* Lint

* Plugins CDN: Fix URLs for system.js (baseUrl and module)

* Plugins CDN: Add more tests for RelativeURLForSystemJS

* Plugins CDN: Iterate only on apps when preloading

* Plugins CDN: Refactoring

* Plugins CDN: Add comments to url_constructor.go

* Plugins CDN: Update defaultHGPluginsCDNBaseURL

* Plugins CDN: undo extract meta from system js config

* refactor(plugins): migrate systemjs css plugin to typescript

* feat(plugins): introduce systemjs cdn loader plugin

* feat(plugins): add systemjs load type

* Plugins CDN: Removed RelativeURLForSystemJS

* Plugins CDN: Log backend redirect hits along with plugin info

* Plugins CDN: Add pluginsCDNBasePath to getFrontendSettingsMap

* feat(plugins): introduce cdn loading for angular plugins

* refactor(plugins): move systemjs cache buster into systemjsplugins directory

* Plugins CDN: Rename pluginsCDNBasePath to pluginsCDNBaseURL

* refactor(plugins): introduce pluginsCDNBaseURL to the frontend

* Plugins CDN: Renamed "cdn base path" to "cdn url template" in backend

* Plugins CDN: lint

* merge with main

* Instrumentation: Add prometheus counter for backend hits, log from Info to Warn

* Config: Changed key from plugins_cdn.url to plugins.plugins_cdn_base_url

* CDN: Add backend tests

* Lint: goimports

* Default CDN URL to empty string,

* Do not use CDN in setImages and module if the url template is empty

* CDN: Backend: Add test for frontend settings

* CDN: Do not log missing module.js warn if plugin is being loaded from CDN

* CDN: Add backend test for CDN plugin loader

* Removed 'cdn' signature level, switch to 'valid'

* Fix pfs.TestParseTreeTestdata for cdn plugin testdata dir

* Fix TestLoader_Load

* Fix gocyclo complexity of loadPlugins

* Plugins CDN: Moved prometheus metric to api package, removed asset_path label

* Fix missing  in config

* Changes after review

* Add pluginscdn.Service

* Fix tests

* Refactoring

* Moved all remaining CDN checks inside pluginscdn.Service

* CDN url constructor: Renamed stringURLFor to stringPath

* CDN: Moved asset URL functionality to assetpath service

* CDN: Renamed HasCDN() to IsEnabled()

* CDN: Replace assert with require

* CDN: Changes after review

* Assetpath: Handle url.Parse error

* Fix plugin_resource_test

* CDN: Change fallback redirect from 302 to 307

* goimports

* Fix tests

* Switch to contextmodel.ReqContext in plugins.go

Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2023-01-27 15:08:17 +01:00
Karl Persson
c931b8031e
SearchV2: Set correct batch limit when loading dashboards (#62314)
SearchV2: Set correct limit
2023-01-27 14:40:04 +01:00
Joey Tawadrous
591501ef3f
Traces: Upgraded feature tracking (#62181)
Upgraded feature tracking
2023-01-27 13:33:27 +00:00
Eric Leijonmarck
27f0c9c70f
Auth: Doc change url for getting JWT (#62319)
docs: change url for getting JWT
2023-01-27 14:26:35 +01:00
renovate[bot]
847a5ab195
Update dependency rc-slider to v10.1.0 (#62302)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-27 13:23:31 +00:00
Armand Grillet
f0a88e0609
Add SQLite performance limitation with alerting (#62296) 2023-01-27 14:22:47 +01:00
Gilles De Mey
54ff88463c
Alerting: remove link to Grafana University (#62318) 2023-01-27 08:21:47 -05:00
Yaelle Chaudy
3281eb9223
[Navigation] Add user events for quick actions/dashboard actions (#62220)
Add fe events for quick actions/dashboard actions
2023-01-27 14:11:17 +01:00
Jack Westbrook
2f46317a2a
Packages: Don't error if npm-artifacts directory already exists (#62303)
fix(packages): dont error if npm-artifacts directory already exists
2023-01-27 14:06:43 +01:00
Leon Sorokin
52955d88a7
TimeSeries: Fix log y scale when min/max settings don't land on divisors (#60768) 2023-01-27 05:52:01 -07:00
Oscar Kilhed
6bfd21ef0a
FileDropzone: make a nicer looking error message when file size is exceeded (#62290)
* FileDropzone: make a nicer looking error message when file size is exceeded
2023-01-27 12:42:47 +00:00
George Robinson
b6db1ed524
Revert "Alerting: Add is_paused attr to the POST alert rule group endpoint" (#62310)
Revert "Alerting: Add is_paused attr to the POST alert rule group endpoint (#62253)"

This reverts commit 3ccafe3a5a.
2023-01-27 13:41:36 +01:00
Victor Marin
846acd28ff
StateTimeline: Show correct legend label when value mappings set (#62282)
* StateTimeline: Show correct legend label when value mappings set

* Add test dashboard for thresholds and value mappings

* run stripnulls.sh
2023-01-27 14:30:42 +02:00
Torkel Ödegaard
bfcf936c38
QueryEditorRows: Remove double callback from onDataSourceChange (#62172)
* QueryEditorRows: Remove double callbacked from onDataSourceChange

* A few more updates

* Updated
2023-01-27 13:30:12 +01:00
renovate[bot]
1a28650aab
Update dependency @testing-library/dom to v8.20.0 (#61677)
* Update dependency @testing-library/dom to v8.20.0

* do some lockfile surgery

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2023-01-27 12:28:09 +00:00
Ieva
eb9ef34272
RBAC: Permission check performance improvements for the new search (#60729)
* Add checker and update the resource filter function for new search

* Add tests for checker

* small fixes

* handle location for panels correctly

* clean up checker code and extend the tests for it

* more fixes, but tests don't quite work yet

* a small change to return error

* cleanup

* more simplification

* fix tests

* correct wrong argument ordering & use constant

* Apply suggestions from code review

Co-authored-by: Artur Wierzbicki <artur.wierzbicki@grafana.com>

* import

* check general folder from permission checker function

* handle root folder aka general folder properly

* update tests

* clean up

* lint

* add fix from main

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
Co-authored-by: Artur Wierzbicki <artur.wierzbicki@grafana.com>
2023-01-27 12:12:30 +00:00
Oscar Kilhed
dab3fac01b
Grafana DS: Fix dropzone showing upload file even if there is a file (#62200)
* Grafana DS: Fix dropzone showing upload file even if there is a file
2023-01-27 11:51:10 +00:00
Josh Hunt
960307e938
Search: Remember sorting preference between visits (#62248)
Search: Remember sort option between uses
2023-01-27 11:00:28 +00:00
Torkel Ödegaard
4deb10888e
Revert "Transforms: Add join by fields" (#62278) 2023-01-27 11:58:18 +01:00
renovate[bot]
3d4cf06246
Update dependency rc-drawer to v6.1.2 (#62294)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-27 10:54:45 +00:00
Victor Marin
1464dd4095
Re-add RowHeight option to StatusHistory (#62293) 2023-01-27 12:52:32 +02:00
Josh Hunt
70f109526a
Search: Store only search value in state, not the whole selectable value (#62228)
* Search: Store only search value in state, not the whole selectable value

* type sort to undefined-able
2023-01-27 10:50:48 +00:00
Andres Martinez Gotor
6292a41b24
Azure Monitor: Allow multi-value variables (#62238) 2023-01-27 11:40:49 +01:00
Karl Persson
3447ad2602
AuthN: support priority for post auth and post login hooks (#62208)
* AuthN: store post auth hooks in a priority list and update registration
function to take a priority

* AuthN: store post login hooks in a priority list and update registration function to take a priority

* AuthN: Change priority for sync user
2023-01-27 11:40:12 +01:00
renovate[bot]
14185ba819
Update d3 to v3 (#58315)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-27 11:19:35 +01:00
Joey Tawadrous
02098c1568
Tempo: Update docs and default Tempo metrics query (#62185)
Update docs and default tempo metrics query
2023-01-27 10:03:52 +00:00
Alex Moreno
3ccafe3a5a
Alerting: Add is_paused attr to the POST alert rule group endpoint (#62253)
Add is_paused attr to the POST alert rule group endpoint
2023-01-27 10:50:06 +01:00
Levente Balogh
83ff974b86
Datasources: Add the props for the "add datasource" event (#62227)
chore: pass editLink to the add datasource user event
2023-01-27 10:47:18 +01:00
Jack Baldry
a54d18c1f5
Revert "Add Grafana tutorials originally from tutorials repository" (#62283)
Revert "Add Grafana tutorials originally from tutorials repository (#62124)"

This reverts commit f98ad926ac.
2023-01-27 09:25:57 +00:00
Ben Sully
5ff94e528b
API: don't re-add /api suffix to grafana.com API URL (#62280)
The old GrafanaComURL setting didn't have the /api suffix so needed it
adding on by the proxy director, but the new GrafanaComAPIURL setting is
assumed to already point directly to the API and doesn't need an
additional suffix.

This is the only place in the codebase that GrafanaComAPIURL is used.
2023-01-27 10:20:55 +01:00
Jack Baldry
f98ad926ac
Add Grafana tutorials originally from tutorials repository (#62124)
* Add Grafana tutorials originally from tutorials repository

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Replace tutorials/step shortcode with ordinary headings

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Fix typos reported by codespell

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Fix doc-validator linting and run prettier

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
2023-01-27 09:14:24 +00:00
Yuri Tseretyan
05bf241952
Alerting: Update state manager to return StateTransitions when Delete or Reset (#62264)
* update Delete and Reset methods to return state transitions

this will be used by notifier code to decide whether alert needs to be sent or not.

* update scheduler to provide reason to delete states and use transitions

* update FromAlertsStateToStoppedAlert to accept StateTransition and filter by old state

* fixup

* fix tests
2023-01-27 09:46:21 +01:00
Jack Baldry
6706f08ecd
Replace grafana/docs-squad with more specific group grafana/docs-grafana (#62174) 2023-01-27 08:27:36 +00:00
Leon Sorokin
4c45dea71d
Chore: uPlot 1.6.24 (#62279) 2023-01-27 02:12:19 -06:00
idafurjes
6c5a573772
Chore: Move ReqContext to contexthandler service (#62102)
* Chore: Move ReqContext to contexthandler service

* Rename package to contextmodel

* Generate ngalert files

* Remove unused imports
2023-01-27 08:50:36 +01:00
Matthew Jacobson
8379a29b53
Alerting: Improve comments on alert table migration immutability (#62161)
* Alerting: Improve comments around alert migration immutability

* Reunite alerting config history migrations
2023-01-26 16:13:08 -05:00
Guilherme Caulada
9a25a03e49
Tests: Add boilerplate code to support e2e tests on enterprise (#61959)
* Add e2e boilerplate for enterprise tests

* Remove enterprise symlink file

* Add tsconfig to e2e extensions folder and gitignore

* Update run-suite to use extensions folder

* Remove unnecessary tsconfig file

* Update e2e enterprise paths on gitignore

* Copy symlinked e2e enterprise files on run-suite

* Add cleanup command to run-suite

* Improve cleanup and setup for enterprise e2e tests

* Update e2e path for enterprise tests on gitignore

* Support to run different e2e tests for each license
2023-01-26 18:04:13 -03:00
Brett Buddin
a5a85e0398
InfluxDB: Send retention policy with InfluxQL queries if its been specified. (#62149)
* InfluxDB: Send retention policy with InfluQL queries if it's been specified.

In InfluxDB v2, due to technical limitations of the InfluxDB v1
compatibility layer, retention policies in a query (e.g. "<retention
policy>.<measurement_name>") aren't honored and must be specified in the
URL query parameter `rp` to be applied. Grafana doesn't send this query
parameter which results in all queries resolving to the default
retention policy when querying InfluxDB v2 servers using InfluxQL.

This addresses the issue by sending the `rp` query parameter for queries
that have specified a retention policy in the `target` given to
`runExploreQuery`.

The outcomes are:

1. InfluxQL queries executed against InfluxDB v2 databases will have the
   necessary retention policy information for queries like `SHOW FIELD
   KEYS FROM measurement` to function correctly.
2. InfluxQL queries executed against InfluxDB v1 databases will be
   unaffected, because this `rp` query parameter is unsupported there.

You can read more about the rentention policy mapping behavior of
InfluxDB v2 in our documentation:

- https://docs.influxdata.com/influxdb/v2.6/reference/api/influxdb-1x/dbrp/#when-querying-data
- https://docs.influxdata.com/influxdb/v2.6/reference/api/influxdb-1x/query/#query-a-non-default-retention-policy

* Use the ? operator

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2023-01-26 19:14:02 +01:00
brendamuir
a273c232a1
Alerting: fix default template link (#62251) 2023-01-26 17:45:09 +00:00
Alex Moreno
531b439cf1
Alerting: Add alert pausing feature (#60734)
* Add field in alert_rule model, add state to alert_instance model, and state to eval

* Remove paused state from eval package

* Skip paused alert rules in scheduler

* Add migration to add is_paused field to alert_rule table

* Convert to postable alerts only if not normal, pernding, or paused

* Handle paused eval results in state manager

* Add Paused state to eval package

* Add paused alerts logic in scheduler

* Skip alert on scheduler

* Remove paused status from eval package

* Apply suggestions from code review

Co-authored-by: George Robinson <george.robinson@grafana.com>

* Remove state

* Rethink schedule and manager for paused alerts

* Change return to continue

* Remove unused var

* Rethink alert pausing

* Paused alerts storing annotations

* Only add one state transition

* Revert boolean method renaming refactor

* Revert take image refactor

* Make registry errors public

* Revert method extraction for getting a folder title

* Revert variable renaming refactor

* Undo unnecessary changes

* Revert changes in test

* Remove IsPause check in PatchPartiLAlertRule function

* Use SetNormal to set state

* Fix text by returning to old behaviour on alert rule deletion

* Add test in schedule_unit_test.go to test ticks with paused alerts

* Add coment to clarify usage of context.Background()

* Add comment to clarify resetStateByRuleUID method usage

* Move rule get to a more limited scope

* Update pkg/services/ngalert/schedule/schedule.go

Co-authored-by: George Robinson <george.robinson@grafana.com>

* rum gofmt on pkg/services/ngalert/schedule/schedule.go

* Remove defer cancel for context

* Update pkg/services/ngalert/models/instance_test.go

Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>

* Update pkg/services/ngalert/models/testing.go

Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>

* Update pkg/services/ngalert/schedule/schedule_unit_test.go

Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>

* Update pkg/services/ngalert/schedule/schedule_unit_test.go

Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>

* Update pkg/services/ngalert/models/instance_test.go

Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>

* skip scheduler rule state clean up on paused alert rule

* Update pkg/services/ngalert/schedule/schedule.go

Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>

* Fix mock in test

* Add (hopefully) final suggestions

* Use error channel from recordAnnotationsSync to cancel context

* Run make gen-cue

* Place pause alert check in channel update after version check

* Reduce branching un update channel select

* Add if for error and move code inside if in state manager ResetStateByRuleUID

* Add reason to logs

* Update pkg/services/ngalert/schedule/schedule.go

Co-authored-by: George Robinson <george.robinson@grafana.com>

* Do not delete alert rule routine, just exit on eval if is paused

* Reduce branching and create-close a channel to avoid deadlocks

* Separate state deletion and state reset (includes history saving)

* Add current pause state in rule route in scheduler

* Split clearState and bring errCh closer to RecordStatesAsync call

* Change rule to ruleMeta in RecordStatesAsync

* copy state to be able to modify it

* Add timeout to context creation

* Shorten the timeout

* Use resetState is rule is paused and deleteState if rule is not paused

* Remove Empty state reason

* Save every rule change in historian

* Add tests for DeleteStateByRuleUID and ResetStateByRuleUID

* Remove useless line

* Remove outdated comment

Co-authored-by: George Robinson <george.robinson@grafana.com>
Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>
Co-authored-by: Armand Grillet <2117580+armandgrillet@users.noreply.github.com>
2023-01-26 18:29:10 +01:00
Andrej Ocenas
039b30b1ea
NodeGraph: Schema for panel options (#62121) 2023-01-26 18:02:41 +01:00
renovate[bot]
caaf7be2f2
Update dependency immutable to v4.2.2 (#62202)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-26 16:57:10 +00:00