Commit Graph

30958 Commits

Author SHA1 Message Date
erdnaxe
5f521bd9ae
packaging: systemd unit hardening (#38109) 2021-09-02 07:36:35 -05:00
Zoltán Bedi
7e6cf14c84
Fix: Include Buffer in webpack build (#38819) 2021-09-02 14:18:07 +02:00
malcolmholmes
b22c2543d0
Build: Upgrade grabpl to 2.4.2 (#38820) 2021-09-02 13:03:32 +01:00
Friedrich Mäckle
8c8ccc8b91
Check navigator property exists before accessing it (#38745)
* Check navigator property exists before acecssing it

* fix: pass undefined to Intl.DateTimeFormat if no locale can be determined

* Update packages/grafana-data/src/datetime/formats.ts

replacing ternary by or

Co-authored-by: Ashley Harrison <ashharrison90@gmail.com>

Co-authored-by: Ashley Harrison <ashharrison90@gmail.com>
2021-09-02 11:47:25 +01:00
Dimitris Sotirakis
a5ce61b539
Chore: Update to alpine:3.14.2 (#38813)
* Update apline to 3.14.2

* Remove libcrypto1.1 libssl1.1 version dependencies

* Update grabpl version
2021-09-02 12:57:11 +03:00
blackmetal23
fe65021c14
Update Dockerfile (#38785)
Update alpine 3.14.1 to 3.14.2
CVE : https://github.com/alpinelinux/docker-alpine/issues/199
2021-09-02 11:45:33 +03:00
Kyle Brandt
f524cdb5ee
devenv: update prom random_data for go1.17 (use go install) (#38763)
* devenv: update prom random_data for go1.17 (use go install)
* restore env vars and tags to install cmd
2021-09-02 10:32:09 +02:00
Piotr Jamróz
bd95856ff9
Graphite: Migrate to React (part 6: Remove AngularJS Query Editor) (#37919)
* Add UMLs

* Add rendered diagrams

* Move QueryCtrl to flux

* Remove redundant param in the reducer

* Use named imports for lodash and fix typing for GraphiteTagOperator

* Add missing async/await

* Extract providers to a separate file

* Clean up async await

* Rename controller functions back to main

* Simplify creating actions

* Re-order controller functions

* Separate helpers from actions

* Rename vars

* Simplify helpers

* Move controller methods to state reducers

* Remove docs (they are added in design doc)

* Move actions.ts to state folder

* Add docs

* Add old methods stubs for easier review

* Check how state dependencies will be mapped

* Rename state to store

* Rename state to store

* Rewrite spec tests for Graphite Query Controller

* Update docs

* Update docs

* Add GraphiteTextEditor

* Add play button

* Add AddGraphiteFunction

* Use Segment to simplify AddGraphiteFunction

* Memoize function defs

* Fix useCallback deps

* Update public/app/plugins/datasource/graphite/state/helpers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/helpers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/helpers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Add more type definitions

* Remove submitOnClickAwayOption

This behavior is actually needed to remove parameters in functions

* Load function definitions before parsing the target on initial load

* Add button padding

* Fix loading function definitions

* Change targetChanged to updateQuery to avoid mutating state directly

It's also needed for extra refresh/runQuery execution as handleTargetChanged doesn't handle changing the raw query

* Fix updating query after adding a function

* Simplify updating function params

* Migrate function editor to react

* Simplify setting Segment Select min width

* Remove unnecessary changes to SegmentInput

* Extract view logic to a helper and update types definitions

* Clean up types

* Update FuncDef types and add tests

* Show red border for unknown functions

* Autofocus on new params

* Extract params mapping to a helper

* Split code between params and function editor

* Focus on the first param when a function is added even if it's an optional argument

* Add function editor tests

* Remove todo marker

* Fix adding new functions

* Allow empty value in selects for removing function params

* Add placeholders and fix styling

* Add more docs

* Create basic implementation for metrics and tags

* Post merge fixes

These files are not .ts

* Remove mapping to Angular dropdowns

* Simplify mapping tag names, values and operators

* Simplify mapping metrics

* Fix removing tags and autocomplete

* Simplify debouncing providers

* Ensure options are loaded twice and segment is opened

* Remove focusing new segments logic (not supported by React's segment)

* Clean up

* Move debouncing to components

* Simplify mapping to selectable options

* Add docs

* Group all components

* Remove unused controller methods

* Create Dispatch context

* Group Series and Tags Sections

* Create Functions section

* Create Section component

* use getStyles

* remove redundant async/await

* Remove

* remove redundant async/await

* Remove console.log and silent test console output

* Do not display the name of the selected dropdown option

* Move Section to grafana-ui

* Update storybook

* Simplify SectionLabel

* Fix Influx tests

* Fix API Extractor warnings

* Fix API Extractor warnings

* Do not show hidden functions

* Use block docs for better doc generation

* Handle undefined values provided for autocomplete

* Basic integration

* Move creating state to context.tsx

* Update tests

* Rename test

* Clean up dependencies

panel.targets is not needed for interpolation - it happens in the data source itself. It was used only to show query ref in the the dropdown for the segment.

* Update time range when it changes

* Change action name

* Simplify segments cloning

* Remove redundant variable

* Use styles instead of direct css

* Update docs

* Remove angular wrappers

* Remove redundant tests

* Section -> SegmentSection

* Simplify section styling

* Remove redundant div

* Fix unit tests

* Simplify SegmentSection component

* Use theme.spacing

* Use empty label instead of a single space label

* Remove targetFull

It was used in the past two store the query interpolated with sub-queries inside the model and send both to the backed (interpolated and not interpolated). This has been changed though - the logic has been moved away from model to the data source where interpolation happens and now only interpolated query is passed meaning targetFull is not needed anymore.

* Revert "Remove targetFull"

This reverts commit 499f8b33

* Bring back calculating targetFull

* Clean up

* Add missing dep

* Add missing dep in tests

* Fix time range synchronization

* Fix warning message

* Remove unused type

* Synchronize changes to the query

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-09-02 10:18:14 +02:00
Piotr Jamróz
f941390631
Deprecate browser access mode for the Graphite data source. (#38783)
* Deprecate browser access mode for Graphite

* Update docs

* Update copy
2021-09-02 10:16:17 +02:00
Ryan McKinley
ae702caec6
Transformer: labels to fields should not also merge frames (#38671) 2021-09-01 20:18:50 +02:00
Ashley Harrison
205c672417
Sidemenu: Refactor TopSectionItem and BottomNavLinks into SideMenuItem (#38755)
* Sidemenu: Refactor TopSectionItem and BottomNavLinks into SideMenuItem

* Update failing snapshot

* BottomSection: Convert tests to RTL + add some extra unit tests
2021-09-01 17:16:50 +01:00
Ole Kristian (Zee)
92934af741
Monaco: Add javascript and typescript support (#38703) 2021-09-01 08:55:01 -07:00
Ryan McKinley
e461c722bf
Live: prepend orgId when publishing from HTTP (#38775) 2021-09-01 17:54:34 +02:00
Ryan McKinley
e980f8531a
StateTimeline: merge threshold values (#35073) 2021-09-01 17:43:57 +02:00
Domas
7fe3599ab1
Docs: document editing cortex/loki recording rules, namespaces and groups (#38547)
* document recording rule creation

* namespace/group editing docs

* explain namespaces & groups

* Jita's suggestions
2021-09-01 11:35:33 -04:00
Ryan McKinley
7af2d1a629
Dashboards: support merging in new panels and options (#37905) 2021-09-01 08:03:56 -07:00
Serge Zaitsev
643c7fa0cb
Chore: update all +build statements (#38782) 2021-09-01 17:38:56 +03:00
Alex Khomenko
ea8d9d77f4
Admin: User list tweaks (#38750)
* Setup filter

* Enable filtering users by active in last 30 days

* Add loading state

* Update last active age strings

* Tweak user list

* Use theme spacing

* Improve table's accessibility

* Add more aria-labels
2021-09-01 16:53:58 +03:00
Will Browne
e39410c094
Cloud-Monitoring: Ensure service gets dependencies (#38788)
* ensure cloud-monitoring gets service dependencies

* all one line
2021-09-01 15:29:21 +02:00
Gabriel MABILLE
9f29241a0c
AccessControl: add one-dimensional permissions to datasources (#38070)
* AccessControl: add one-dimensional permissions to datasources in the backend

* AccessControl: add one-dimensional permissions to datasources in the frontend (#38080)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-09-01 15:18:17 +02:00
Uchechukwu Obasi
4e8ab0512c
PlayList: add delete functionality to remove playlist (#38120)
* WIP: add delete functionality to playlist

* fixes deleted item to be removed instantly without manual refresh

* update confirmModal to reference playlist name

* refactor confirmModal message to be clear enough

* WIP: some unit tests for the playlistPage

* added more tests and did some cleanup

* some code refactoring

* adds ability for user roles to control playlist delete

* some abstraction to cleanup code

* modified alert message for delete button to correspond with action

* tried a better approach to modify the alert message

* fixes playlist lookup on each render

* update handlers to not use anonymous function

* exposed getBackendSrv().get api to fetch all playlist

* used better naming convention

* removes unecessary async/await construct

* some code refactoring

* used the correct param structure
2021-09-01 13:23:57 +01:00
Dominik Prokop
326455a9b8
Annotation tooltip: Bring back links styles (#38780) 2021-09-01 13:30:30 +02:00
Hugo Häggmark
55e20bbf04
LibraryPanels: Separates name from panel title (#38707)
* LibraryPanels: Separates name from panel title

* WIP

* Chore: fixes update for duplicate lib panels

* Chore: reverts implementation

* Chore: show library options only for library panels

* Chore: ui fixes after PR comments

* Chore: fixes issue when creating library panels
2021-09-01 13:27:43 +02:00
Joan López de la Franca Beltran
6cfb640a0b
Chore: Refactor securedata to remove global encryption calls from dashboard snapshots (#38714)
* Add encryption service

* Add tests for encryption service

* Inject encryption service into http server

* Replace encryption global function usage in login tests

* Migrate to Wire

* Move Encryption bindings to OSS Wire set

* Chore: Refactor securedata to remove global encryption calls from dashboard snapshots

* Fix dashboard snapshot tests

* Remove no longer user test

* Add dashboard snapshots service tests

* Refactor service initialization

* Set up dashboard snapshots service as a background service

Co-authored-by: Tania B <yalyna.ts@gmail.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2021-09-01 13:05:15 +02:00
Jack Westbrook
a4e253bcf9
Fix: Prevent yarn start exiting early on TS errors (#38777) 2021-09-01 12:31:50 +02:00
Serge Zaitsev
c3ab2fdeb7
Macaron: remove custom Request type (#37874)
* remove macaron.Request, use http.Request instead

* remove com dependency from bindings module

* fix another c.Req.Request
2021-09-01 11:18:30 +02:00
Jack Westbrook
56f61001a8
Chore: Bump Lerna to v4 (#38751) 2021-09-01 11:00:09 +02:00
Dimitris Sotirakis
89716f2806
Remove ci-build-windows folder (#38778) 2021-09-01 10:44:08 +02:00
SaintMalik
316d78f5c3
Fix typos in CHANGELOG.md (#38741) 2021-09-01 11:29:37 +03:00
Alex Khomenko
7f27a2e1af
Add licensing card background images (#38774) 2021-09-01 10:46:03 +03:00
Kai Hayashi
6e0f18b13a
CloudWatch: Update Period auto to take retention into account (#37424)
* now to get it to build

* modified names, added the 455 day case, and added a comment

* removed wireguard override i used for my local

* updated the docs
2021-09-01 09:44:47 +02:00
shuotli
f2c4346cc4
Azure Monitor: Add support for numeric fields in ARG (#38728)
* Fix todouble/toreal not working

* fix test
2021-09-01 09:02:08 +02:00
Hugo Häggmark
38ca27428d
LibraryPanels: Removes library panel icon from the panel header (#38749) 2021-09-01 06:14:21 +02:00
Nathan Rodman
ad610a1916
Alerting: Fix bug for default value in silence matcher (#38735) 2021-08-31 20:51:36 -07:00
Scott Lepper
4f479de88e
Grafana UI: Table - add sticky table footer (#38094)
* table footer to allow showing summary data from the table panel
2021-08-31 12:37:10 -04:00
Dan Cech
681de1ea89
add key/value store service (#36868)
* add key/value store service

* don't export kvStoreSQL, consumers should interact with KVStore & NamespacedKVStore

* add del method, avoid ErrNotFound (#38627)

* switch value column to medium text

Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
2021-08-31 11:05:45 -04:00
achatterjee-grafana
dd24995852
Doc: Add granularity to files and folder permissions. (#38732)
* Added note as suggested by Simon. Also, adjusted content and resized image.

* Minor wording change.
2021-08-31 10:43:13 -04:00
Tania B
6b7b9f5158
Chore: Remove global encryption calls from sqlstore (#38588)
* Add encryption service

* Add tests for encryption service

* Inject encryption service into http server

* Replace encryption global function usage in login tests

* Refactor UpdatePluginSetting

* Refactor EncryptSecureSettings

* Fix wire.go

* Refactor service initialization

Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>
Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2021-08-31 15:01:23 +02:00
Gábor Farkas
aa7a6633b8
old-alert: set interval and max-data-points (#38434)
* alerting: old-alerting: handle interval + maxdatapoints better

* fixed failing test

* refactor: use interval instead of tsdb

* fix typo

* added unit-test

* added comment

* refactor
2021-08-31 14:49:30 +02:00
Jack Westbrook
fec50115b0
Chore: Bump dangerously-set-html-content to 1.0.9 (#38622) 2021-08-31 14:10:56 +02:00
Tania B
bfde29d107
Chore: Remove global encryption calls from authinfoservice (#38591)
* Add encryption service

* Add tests for encryption service

* Inject encryption service into http server

* Replace encryption global function usage in login tests

* Migrate to Wire

* Refactor authinfoservice to use encryption service

Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>
Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2021-08-31 14:00:13 +02:00
Gábor Farkas
a5d11a3bef
Prometheus: monaco-based query-editor-field, first step (#37251)
* prometheus: add monaco-based query-field

for now it is behind a feature-flag

* added new trigger character

* better separate grafana-specifc and prom-specific code

* better styling

* more styling

* more styling

* simpler monaco-import

* better imports

* simplified code

* simplified type imports

* refactor: group completion-provider files together

* renamed type

* simplify type-import

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>

* handle no-metric-name autocompletes

* updated comment

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2021-08-31 13:46:13 +02:00
Jack Westbrook
8d3b31ff23
Build: Upgrade Webpack 5 (#36444)
* build(webpack): bump to v5 and successful yarn start compilation

* build(webpack): update postcss dependencies

* build(webpack): silence warnings about hash renamed to fullhash

* build(webpack): enable persistent cache to store generated webpack modules / chunks

* build(webpack): prefer eslintWebpackPlugin over tschecker so eslint doesn't block typechecking

* chore(yarn): run yarn-deduplicate to clean up dependencies

* chore(yarn): refresh lock file after clean install

* build(webpack): prefer output.clean over CleanWebpackPlugin

* build(webpack): prefer esbuild over babel-loader for dev config

* build(babel): turn off cache compression to improve build performance

* build(webpack): get production builds working

* build(webpack): remove phantomJS (removed from grafana in v7) specific loader

* build(webpack): put back babel for dev builds no performance gain in using esbuild in webpack

* build(webpack): prefer terser and optimise css plugins for prod. slower but smaller bundles

* build(webpack): clean up redundant code. inform postcss about node_modules

* build(webpack): remove deprecation warnings flag

* build(webpack): bump packages, dev performance optimisations, attempt to get hot working

* chore(storybook): use webpack 5 for dev and production builds

* build(storybook): speed up dev build

* chore(yarn): refresh lock file

* chore(webpack): bump webpack and related deps to latest

* refactor(webpack): put back inline-source-map, move start scripts out of grafana toolkit

* feat(webpack): prefer react-refresh over react-hot-loader

* build(webpack): update webpack.hot to use react-refresh

* chore: remove react-hot-loader from codebase

* refactor(queryeditorrow): fix circular dependency causing react-fast-refresh errors

* revert(webpack): remove stats.errorDetails from common config

* build(webpack): bump to v5 and successful yarn start compilation

* build(webpack): update postcss dependencies

* build(webpack): silence warnings about hash renamed to fullhash

* build(webpack): enable persistent cache to store generated webpack modules / chunks

* build(webpack): prefer eslintWebpackPlugin over tschecker so eslint doesn't block typechecking

* chore(yarn): run yarn-deduplicate to clean up dependencies

* chore(yarn): refresh lock file after clean install

* build(webpack): prefer output.clean over CleanWebpackPlugin

* build(webpack): prefer esbuild over babel-loader for dev config

* build(babel): turn off cache compression to improve build performance

* build(webpack): get production builds working

* build(webpack): remove phantomJS (removed from grafana in v7) specific loader

* build(webpack): put back babel for dev builds no performance gain in using esbuild in webpack

* build(webpack): prefer terser and optimise css plugins for prod. slower but smaller bundles

* build(webpack): clean up redundant code. inform postcss about node_modules

* build(webpack): remove deprecation warnings flag

* build(webpack): bump packages, dev performance optimisations, attempt to get hot working

* chore(storybook): use webpack 5 for dev and production builds

* build(storybook): speed up dev build

* chore(yarn): refresh lock file

* chore(webpack): bump webpack and related deps to latest

* refactor(webpack): put back inline-source-map, move start scripts out of grafana toolkit

* feat(webpack): prefer react-refresh over react-hot-loader

* build(webpack): update webpack.hot to use react-refresh

* chore: remove react-hot-loader from codebase

* refactor(queryeditorrow): fix circular dependency causing react-fast-refresh errors

* revert(webpack): remove stats.errorDetails from common config

* revert(webpack): remove include from babel-loader so symlinks (enterprise) work as before

* refactor(webpack): fix deprecation warnings in prod builds

* fix(storybook): fix failing builds due to replacing css-optimise webpack plugin

* fix(storybook): use raw-loader for svg icons

* build(webpack): fix dev script colors error

* chore(webpack): bump css-loader and react-refresh-webpack-plugin to latest versions

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2021-08-31 12:55:05 +02:00
Ashley Harrison
b40d48258d
Sidemenu: Fix logout button (#38747) 2021-08-31 11:33:38 +01:00
Dimitris Sotirakis
3fb5afb9e3
Update Dockerfile (#38744) 2021-08-31 12:53:17 +03:00
Ashley Harrison
7a242afcd6
Sidemenu: Refactor BottomNavLinks to use SideMenuDropDown (#38598)
* Sidemenu: Attempt to refactor BottomNavLinks to use SideMenuDropDown

* BottomNavLinks: Rewrite existing enzyme tests in RTL

* BottomNavLinks: Use object spreading instead of slicing
2021-08-31 10:37:51 +01:00
Selene
e47a60f511
Add filter to search users by active (#38637)
* Add filter to search users by active

* Fix query
2021-08-31 11:35:16 +02:00
shuotli
f1529b83a2
[Azure monitor] Support variables for Azure Resource Group subscription picker (#38620) 2021-08-31 09:15:35 +02:00
Ryan McKinley
f567bef0bf
Geomap: hide legend for markers with single threshold (#38734) 2021-08-30 23:22:19 -07:00
Dimitris Sotirakis
8e2ee0a1c8
Chore: Update to Golang 1.17 (#38608)
* Update to golang 1.17

* Further updates

* Run go mod tidy on go 1.17

* Apply suggestions from code review

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

* Use build-container:1.4.2

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-08-31 09:19:26 +03:00