Commit Graph

13807 Commits

Author SHA1 Message Date
Connor Lindsey
b89f8fdfcb
Explore: Trace view now shows trace start time in selected timezone (#39054) 2021-09-10 07:52:59 -06:00
Dominik Prokop
e68bf87de1
GraphNG: Remove plot context (#38928)
* Remove plot ctx usage: Tooltip plugin

* Remove plot ctx usage: Context menu plugin

* Remove plot ctx usage: Annotations plugin

* Remove plot ctx usage: Exemplars plugin

* Remove plot ctx usage: EventsCanvas plugin

* Remove plot ctx usage: EventsCanvas/XYCanvas plugin

* Remove plot ctx usage: AnnotationEditor plugin

* Remove plot ctx usage: AnnotationMarker

* Remove plot context

* Do not throw react warnings from uPlot performed hooks
2021-09-10 13:50:21 +02:00
Dominik Prokop
92d736665a
TimeSrv: Do not update URL multiple times for same, consecutive range updates (#39083) 2021-09-10 13:05:34 +02:00
Levente Balogh
9173898fd6
Plugins Catalog: show Grafana and plugin dependencies (#39062)
* fix(@grafana/data): add a missing optional field to the plugin types

* refactor(Plugins/ADmin): use the type from @grafana/data for plugin dependencies

* fix(Datasources/Graphite): add missing `state` to useEffect dependencies

* refactor(Plugins/Admin): remove unnecessary comment

* feat(Plugins/Admin): add plugin and grafana dependencies to the CatalogPluginDetails

* feat(Plugins/ADmin): show Grafana dependency under plugin details

* feat(Plugins/Admin): show grafana and plugin dependencies for a plugin

* test(Plugins/Admin): add a smoke test for plugin dependencies

* refactor(Plugins/Admin): remove unused style from the header
2021-09-10 11:32:21 +02:00
Ryan McKinley
be2e9d3501
Live: remove the 'canPublish' check from the UI (#39016) 2021-09-09 09:52:01 -07:00
Connor Lindsey
5511383070
Explore: Add more error handling to Tempo trace download (#39045) 2021-09-09 09:49:45 -06:00
Dominik Prokop
1a566bef47
Alerting/Annotations: Bring back metrics and alert state to annotations tooltip (#39035)
* Normalize alert state name for UI descriptor retrieval

* Bring back alert state and metric values to annotation tooltip

* Make sure alert state is only shown when present

* Update test

* Handle Error alerting satte
2021-09-09 16:58:27 +02:00
Connor Lindsey
e3c11d2682
Explore: Add filter by trace and span ID to trace to logs feature (#38943)
* Add filter by trace and span ID to trace to logs feature

* Update settings screenshot
2021-09-09 07:24:08 -06: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
Hugo Häggmark
419ead99aa
Annotations: Fixes blank panels for queries with unknown data sources (#39017)
* Annotations: Fixes blank panels for queries with unknown data sources

* Chore: fixes strict typescript error
2021-09-09 13:43:05 +02:00
Levente Balogh
1133e56006
Plugins Catalog: migrate state handling to Redux (#38876)
* feat(Plugins/Catalog): start adding necessary apis

* feat(PLugins/Catalog): add extra helpers for merging local & remote plugins

* feat(Plugins/Catalog): add plugin details as an optional field of CatalogPlugin

* feat(PLugins/Catalog): add scaffolding for the new redux model

* feat(PLugins/Catalog): export reducers based on a feature-flag

* refactor(Plugins/Admin): rename api methods

* feat(Plugin/Catalog): add an api method for fetching a single plugin

* feat(Plugins/Admin): try cleaning stuff around plugin fetching

* ffeat(Plugins/Catalog): return the catalog reducer when the feature flag is set

* refactor(Plugins/Admin): fix typings

* feat(Plugins/Admin): use the new reducer for the browse page

* feat(catalog): introduce selectors to search and filter plugins list

* refactor(Plugins/Details): rename page prop type

* refactor(Plugins/Admin): add a const for a state prefix

* refactor(Plugins/Admin): use the state prefix in the actions

* feat(Plugins/Admin): add types for the requests

* refactor(Plugins/Admin): add request info to the reducer

* refactor(Plugins/Admin): add request handling to the hooks & selectors

* refactor(Plugins/Details): start using the data stored in Redux

* refactor(Plugins/Admin): rename selector to start with "select"

* fix(Plugins/Admin): only fetch plugins once

* refactor(Plugins/Admin): make the tab selection work in details

* refactor(catalog): put back loading and error states in plugin list

* refactor(Plugins/Admin): use CatalogPlugin for <PluginDetailsSignature />

* feat(Plugins/Admin): add an api method for fetching plugin details

* refactor(Plugins/Admin): add action for updating the details

* irefactor(Plugins/Admin): show basic plugin details info

* refactor(Plugin Details): migrate the plugin details header

* refactor(Plugins/Admin): make the config and dashboards tabs work

* refactor(Plugins/Admin): add old reducer state to the new one

* feat(catalog): introduce actions, reducers and hooks for install & uninstall

* refactor(catalog): wire up InstallControls component to redux

* refactor(catalog): move parentUrl inside PluginDetailsHeader and uncomment InstallControls

* feat(catalog): introduce code for plugin updates to install action

* refactor(Plugins/Admin): add backward compatible actions

* test(catalog): update PluginDetails and Browse tests to work with catalog store

* refactor(Plugins/Admin): make the dashboards and panels work again

* refactor(Plugins/Admin): fix linter and typescript errors

* fix(Plugins/Admin): put the local-only plugins to the beginning of the list

* fix(Plugins/Admin): fix the mocks in the tests for PluginDetails

* refactor(Plugins/Admin): remove unecessary hook usePluginsByFilter()

* refactor(Plugins/Admin): extract the useTabs() hook to its own file

* refactor(Plugins/Admin): remove unused helpers and types

* fix(Plugins/Admin): show the first tab when uninstalling an app plugin

This can cause the user to find themselves on a dissappeared tab, as the
config and dashboards tabs are removed.

* fix(catalog): correct logic for checking if activeTabIndex is greater than total tabs

* fix(Plugins/Admin): fix race-condition between fetching plugin details and all plugins

* fix(Plugins): fix strict type errors

* chore(catalog): remove todos

* feat(catalog): render an alert in PluginDetails when a plugin cannot be found

* feat(catalog): use the proper store state

* refactor(Plugins/Admin): fetch local and remote plugins in parallell

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

* style(catalog): fix prettier error in api

* fix(catalog): prevent throwing error if InstallControlsButton is unmounted during install

* refactor(Plugins/Admin): add a separate hook for filtering & sorting plugins

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2021-09-09 12:20:35 +02:00
Ashley Harrison
e4ca6f2445
Sidemenu: Refactor Sidemenu to use emotion (#38995)
* Chore(Sidemenu): Refactor Sidemenu scss into emotion

* Fix unit test

* Sidemenu: use cx instead of template strings
2021-09-09 09:56:08 +01:00
Hugo Häggmark
bfb34b9c1a
LibraryPanels: Prevents changing the folder when saving an existing library panel (#38978) 2021-09-09 06:21:31 +02:00
Ryan McKinley
a960aae4e7
Timeseries: add wide-to-long, and fix the multi-frame output (#38670)
Co-authored-by: Douglas Thrift <dthrift@flexera.com>
2021-09-08 23:44:51 +02:00
Erik Sundell
5e38b02f94
Cloudwatch: Migrate queries that use multiple stats to one query per stat (#36925)
* migrate queries that use multiple stats - squash commits

* fix typo
2021-09-08 16:06:43 +02:00
Ashley Harrison
e639b220ce
Sidemenu: Use <a> instead of <Link> when target is present (#38987) 2021-09-08 14:39:49 +01:00
Connor Lindsey
6a39ac7407
Explore: Download traces as JSON in Explore Inspector (#38614)
* Transform dataframe to jaeger format

* Transform dataframe to Zipkin format

* Add endpoint type and shared to Zipkin

* Transform dataframe to OTLP format

* Add data tab tests and note in inspector docs

* Remove comments and logs

* Resolve typescript strict errors

* Update docs/sources/explore/explore-inspector.md

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

* Update docs

* Improve OTLP conversion to include service info and additional tags

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-09-08 07:04:27 -06:00
Marcus Andersson
3bb2ee9de6
Plugins: added the possibility to manage field config state outside of the panel renderer. (#38944) 2021-09-08 15:02:44 +02:00
Ashley Harrison
b82fe083d7
Sidemenu: Refactor SignIn to use SideMenuItem (#38882) 2021-09-08 09:48:30 +01:00
Gábor Farkas
cbdba57924
Prometheus: fix popup positioning in monaco-based query-field (#38964)
* prometheus: monaco: fix popup positioning

* added explanation comment
2021-09-08 10:23:59 +02:00
Gabriel MABILLE
e9631fdf7c
AccessControl: "Add data source" button needs create and write rights to be enabled (#38934) 2021-09-08 09:47:55 +02:00
Ryan McKinley
10ffc9a754
Tables: optionally show field type icon in tables (#38855) 2021-09-08 00:44:41 -07:00
Oscar Kilhed
ecf40f0331
PieChart: Display "No data" when there is no data (#38808)
PieChart: Display "No data" when there is no data
2021-09-08 09:07:09 +02:00
An
b14b267bed
Canvas Panel: icon/image select modal (#38844)
* feature: add icon modal

* fix: make apply send on change

* move to resource folder

* allow empty

* type

* icon modal

* fix: edit styles

* fix: edit styles

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-09-07 19:46:20 +02:00
Ivana Huckova
19d4213df6
Prometheus: Fix validate selector in metrics browser (#38921)
* Fix match[] param in loki and prometheus

* Update loki series match param
2021-09-07 15:44:45 +02:00
Ashley Harrison
9ce5edfa6b
Docs: Update 'Whitelisted' to 'Allowed' per style guide (#38897)
* Docs: Updated 'Whitelisted' to 'Accepted' to match what's shown in the frontend now.

* Apply suggestions from code review

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* Docs: Update frontend to match docs

* kick drone

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
2021-09-07 13:30:26 +01:00
Hugo Häggmark
8826540c09
Dashboard: Forces panel re-render when exiting panel edit (#38913) 2021-09-07 12:46:21 +02:00
Hugo Häggmark
058ac6becf
Chore: Bumps Immer, Redux Toolkit, Redux and React Redux (#38872)
* Chore: Bumps immer and redux/toolkit

* WIP: transpile errors

* Chore: bumps redux and react redux

* Chore: removes unused dispatch

* make alerting compile with updated redux toolkit

* Test: Fixes broken test

* Chore: fixes strict errors

Co-authored-by: Domas <domasx2@gmail.com>
2021-09-07 10:44:47 +02:00
ying-jeanne
c989f0fbbe
SQL: Migrate to use SDK contracts (#36635)
* convert SQLs to use sdk contracts

* make draft

* postgres

* intermedia

* get datasourceinfo filled at the beginning of the service

* move the interval into package because of cyclict  import and fix all postgres tests

* fix mysql test

* fix mssql

* fix the test for pr https://github.com/grafana/grafana/issues/35839

* fix some issue about intervalv2 package

* update sql test

* wire migration for SQLs

* add sqls to the background process

* make it register instead of register and start

* revert formatting

* fix tests

* fix linter

* remove integration test

* Postgres test fix

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-09-07 09:35:37 +02:00
sam boyer
269c01ea5c
Chore: fix function name spelling (#38901)
Should be appendTransformerAfter().
2021-09-06 21:15:39 -07:00
Maria Alexandra
98dc925175
Dashboard: Fix UIDs are not preserved when importing/creating dashboards thru importing .json file (#38659)
* Dashboard: Fix UID not preserved on import

* Import Dashboard: add e2e test to verify uid is preserved when importing dashboard

* E2e: Use dynamic uid

* Tests: fixes e2e test

* Chore: adds back waits

Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
2021-09-06 15:50:28 +01:00
Gabriel MABILLE
cf7034ee50
AccessControl: add permission to datasource permissions navigation selection (#38758) 2021-09-06 16:18:18 +02:00
Ivana Huckova
d5956ce4b7
Loki: Fix error handling, remove legacy condition (#38633)
* Fix error handling, remove legacy condition

* Fix strict errors in Loki and lower error count

* Update
2021-09-06 15:28:54 +02:00
shuotli
d2f3bb6491
Azure Monitor: Add Azure resource overview dashboard (#38801)
* Add azure resource overview dashboard

* fix width
2021-09-06 09:44:45 +02:00
Hugo Häggmark
3b0910e470
LibraryPanels: Prevents duplicate repeated panels from being created (#38804)
* LibraryPanels: Prevents duplicate repeated panels from being created

* Tests: adds tests

* Chore: updates after PR feedback
2021-09-06 05:57:01 +02:00
nikki-kiga
2a2f10da7e
Transformations: Use fieldMatchers for convertFieldType and add doc (#38769) 2021-09-03 04:18:06 +02:00
Ryan McKinley
9a0040c0ae
Canvas: add alpha canvas panel and initial interfaces (#37279) 2021-09-02 10:01:08 -07:00
Giordano Ricci
7f1327d1ed
Elasticsearch: Prevent pipeline aggregations to show up in terms order by options (#38448)
* Elasticsearch: Prevent pipeline aggregations to show up in terms order by options

* fix optional props

* Refactor & add tests

* Fix & lower strict ts count

* Update public/app/plugins/datasource/elasticsearch/components/QueryEditor/BucketAggregationsEditor/SettingsEditor/TermsSettingsEditor.test.tsx

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

* Update public/app/plugins/datasource/elasticsearch/components/QueryEditor/BucketAggregationsEditor/SettingsEditor/TermsSettingsEditor.test.tsx

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

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2021-09-02 16:00:40 +02:00
Connor Lindsey
fb17f053d3
Explore: Standardize trace query field styling (#38796) 2021-09-02 07:30:11 -06:00
Ashley Harrison
ea65e11c44
Sidemenu: Various accessibility improvements (#38823) 2021-09-02 14:17:57 +01: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
Ryan McKinley
e980f8531a
StateTimeline: merge threshold values (#35073) 2021-09-01 17:43:57 +02:00
Ryan McKinley
7af2d1a629
Dashboards: support merging in new panels and options (#37905) 2021-09-01 08:03:56 -07: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
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