Commit Graph

6950 Commits

Author SHA1 Message Date
Kevin Yu
7156935d12
Azure Monitor: Include datasource ref when interpolating variables (#49543)
* Azure Monitor: include datasource ref when interpolating variables

* add tests

* fix test
2022-05-31 09:27:25 -07:00
Konrad Lalik
4c28d09d6d
Alerting: Add fgac support to alert list panel (#47934)
* Add fgac support to alert list panel

* Fix typo

* test: fix test suite for UnifiedAlertStatesWorker

* Update worker permission check

* Update alert worker tests

Co-authored-by: gillesdemey <gilles.de.mey@gmail.com>
2022-05-31 14:27:08 +02:00
Andrej Ocenas
72367cf1ad
Prometheus: Cleanup annotation editor (#49615)
* Remove unused code

* Remove test

* Remove Builder mode and simplify the code

* Fix step mapping

* Fix import

* change placeholder
2022-05-31 11:50:23 +02:00
kay delaney
0012d2d81f
UI/Button: Remove deprecated "link" variant (#49843) 2022-05-31 09:40:03 +01:00
Joey Tawadrous
387267b30a
Elasticsearch: Migrate annotation editor to react (#49529)
* Migrate annotation editor to react

* Gio patch

* Update types

* Optional and conform to older design
2022-05-31 09:26:40 +01:00
Joao Silva
056a1fec3d
PanelEditor: Fixes issue with Table view and multi data frames (#49854) 2022-05-30 20:29:51 -07:00
Leon Sorokin
143f9e2dd9
HeatmapNG: ensure non-zero y bucket size (#49454)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-05-30 20:27:41 -07:00
Sergey Kostrukov
2b83cf4618
Prometheus: Predefined scopes for Azure authentication (#49557)
* Predefined scopes for Azure Prometheus

* Allow override of audience
2022-05-30 17:43:32 +02:00
Zoltán Bedi
3d3cf74038
Fix: Timeseries migration regex override (#49629) 2022-05-30 16:27:53 +02:00
Adam Simpson
6554bbd70f
AzureMonitor: migrate Logs+Arg QueryEditor to @grafana/experimental (#48978)
* AzureMonitor: use @grafana/experimental for LogsQueryEditor

ref #48711

* AzureMonitor: migrate ArgQueryEditor to @grafana/experimental.

Change CodeEditor to 100% instead of 1000px to match LogsQueryEditor.

ref #48713
2022-05-30 16:10:34 +02:00
Ashley Harrison
216565aa00
Chore: Upgrade to jest 28 (#49679)
* bump packages to jest 28

* changes needed for jest 28

* map react-colorful as well

* use customResolver and fix last test

* don't need react-colorful installed if we're using a custom resolver

* return correct thing in mock

* remove watchPathIgnorePatterns since we don't have node_modules anymore
2022-05-30 14:14:34 +01:00
Ivana Huckova
5f6b23e45a
AutoSizeInput: Move to @grafana/ui (#48811)
* AutoSizeInput: Move to @grafana/ui

* Update packages/grafana-ui/src/components/AutoSizeInput/AutoSizeInput.mdx

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

* Update packages/grafana-ui/src/components/AutoSizeInput/AutoSizeInput.mdx

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

* Update packages/grafana-ui/src/components/AutoSizeInput/AutoSizeInput.mdx

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

* Fix linter error

* Update packages/grafana-ui/src/components/AutoSizeInput/AutoSizeInput.mdx

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

* Update packages/grafana-ui/src/components/AutoSizeInput/AutoSizeInput.mdx

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

* Move AutoSizeInput to Input folder

* Use iconOptions in storybook

Co-authored-by: JitaC <70489351+achatterjee-grafana@users.noreply.github.com>
2022-05-30 10:46:33 +02:00
Ivana Huckova
745b101d41
Loki: Fix unwrap parsing (#49732) 2022-05-27 14:00:51 +02:00
sam boyer
be06d37a20
schema: Generate Go and Typescript from Thema coremodels (#49193)
* Add go code generator for coremodels

* Just generate the entire coremodel for now

Maybe we'll need more flexibility as more coremodels are added, but for
now this is fine.

* Add note on type comment about stability, grodkit

* Remove local replace directive for thema

* Generate typescript from coremodel

* Update pkg/coremodel/dashboard/addenda.go

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

* Update cuetsy to new release

* Update thema to latest

* Fix enum generation for FieldColorModeId

* Put main generated object at the end of the file

* Tweaks to generated Go output

* Retweak back to var

* Add generated coremodel test

* Remove local replace statement again

* Add Make target and call into cuetsy cmd from gen

* Rename and comment linsrc for readability

* Move key codegen bits into reusable package

* Move body of cuetsifier into codegen pkg

Also genericize the diffing output into reusable WriteDiffer.

* Refactor coremodel generator to use WriteDiffer

* Add gen-cue step to CI

* Whip all the codegen automation into shape

* Add simplistic coremodel canonicality controls

* Remove erroneously committed test

* Bump thema version

* Remove dead code

* Improve wording of non-canonicality comment

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-05-27 03:21:37 +02:00
kay delaney
3d8eda0132
Chore: Remove deprecated surface prop from IconButton (#49715)
* Chore: Remove deprecated `surface` prop from IconButton

* Update component docs
2022-05-27 01:00:57 +01:00
Isabella Siu
b80934617b
CloudWatch: Use scopedVars in expressions (#49178)
* CloudWatch: Use scopedVars in expressions

* fix spec test
2022-05-26 17:03:55 -04:00
Andreas Christou
c8094b33cd
AzureMonitor: Ensure original query properties are included unchanged (#49642)
* Ensure original query properties are included unchanged

* Remove refId from pseudo datasources

* Include testing for interpolateVariablesInQueries

- Add util function to create template variables
- Update mock query with missing props
- Additional tests on each ds for template variables

* Correct typo and add explicit check for datasource
2022-05-26 14:53:12 +01:00
kay delaney
308ceebdd1
Chore: Remove usage of deprecated getColorForTheme function (#49519) 2022-05-26 14:11:44 +01:00
Gábor Farkas
386181cf45
Loki code editor: do not run query on blur in explore mode (#49241)
* loki code editor: do not run query on blur in explore mode

* loki: code editor: better change tracking

* fixed comment

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2022-05-26 15:03:36 +02:00
Gábor Farkas
b54817033a
loki: better unpack handling (#49074) 2022-05-26 11:26:20 +02:00
Gábor Farkas
514d1bbbdd
loki: added two new functions (#49617) 2022-05-26 10:23:28 +02:00
Ryan McKinley
df90393057
Timeseries: fix outside range stale state (#49633)
Co-authored-by: Todd Treece <todd.treece@grafana.com>
2022-05-25 21:19:56 +00:00
Nathan Marrs
2449f62dbe
Canvas: Improve changing element options UX (#49555) 2022-05-25 10:21:51 -07:00
Ashley Harrison
970c395fb1
Cue: Use BarGauge, DashList and Gauge panel cue schemas (#49580)
* user essentials mob! 🔱

* Wip

* user essentials mob! 🔱

lastFile:public/app/plugins/panel/bargauge/module.tsx

* user essentials mob! 🔱

* update betterer results file

Co-authored-by: kay delaney <kay@grafana.com>
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
Co-authored-by: Joao Silva <joao.silva@grafana.com>
2022-05-25 14:18:21 +01:00
Josh Hunt
9092150143
Cue: Update Text, Stat, and Annolist panel cue schemas (#49479)
* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

lastFile:public/app/plugins/panel/stat/types.ts

* user essentials mob! 🔱

* user essentials mob! 🔱

* Use generate defaults, and fix a few remaining issues

* Add annolist to dashboard dist plugins

* minor fixes

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: Joao Silva <joao.silva@grafana.com>
Co-authored-by: Alexandra Vargas <alexa1866@gmail.com>
Co-authored-by: sam boyer <sdboyer@grafana.com>
2022-05-25 12:07:32 +01:00
Dominik Prokop
30880e6e18
Old Graph migration: Preserve null values settings (#49493)
* Graph migration: Preserve null values settings

* Review
2022-05-25 03:22:28 -07:00
Andrej Ocenas
4124294011
Prometheus: Migrate annotation editor to react (#48814)
* Modify the annotation support api

* Migrate annotation editor component

* Update public/app/features/annotations/standardAnnotationSupport.ts

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

* Move the escape hatches out of the public API

* Fix props transforms

* Break import cycle

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-05-24 17:43:58 +02:00
Gilles De Mey
86871807d2
Alerting: Make alertmanager datasource stable (#49485) 2022-05-24 14:44:41 +02:00
Andres Martinez Gotor
b0300d56ac
AzureMonitor: Do not quote variables when a custom All variable option is used (#49428) 2022-05-24 11:29:24 +02:00
kay delaney
a1b709626f
DashList: Handle long dashboard titles more gracefully (#49460) 2022-05-24 09:29:36 +02:00
Nathan Marrs
5eb20739c2
Canvas: Fix inconsistent element resizing UX (#49450) 2022-05-23 20:13:58 -07:00
Adela Almasan
b1ba0bc7b0
Canvas: Quick positioning (#48992)
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
2022-05-23 15:31:39 -07:00
Joey Tawadrous
d463c3157c
Tempo: NativeSearch code simplification and cleanup (#49365)
* Cleanup and show loading for service/span name

* Method rename

* Simplify logic for getting options

* Simplify logic for setting/getting value

* Move getTags to own async

* Update tests

* Promise all

* Update const name
2022-05-23 20:32:40 +01:00
Andrej Ocenas
7cd034f33a
Loki: Cleanup some code for default editorMode (#49431) 2022-05-23 19:21:00 +02:00
Ashley Harrison
ce86b4ebe7
Navigation: Show starred items in the NavBar (#49219)
* switch saved items to starred items

* hook up redux properly

* Better query + hook up DashList

* update initial state so it's never undefined

* update GetDashboard call

* use new star service

* add scroll + maxwidth to navbar hover menu, sort starred items alphabetically

* increase height, revert changes to CustomScrollbar

* ellipsis!

* update starred dashboard name in navtree

* sort after renaming

* limit to first 50 starred dashboards found
2022-05-23 16:45:46 +01:00
Torkel Ödegaard
c29e6fcb3a
Prometheus/Loki: Improve metric search highlight contrast (#49384)
* Prometheus/Loki: Improve metric search highlight contrast

* Update other places, and add reusable variables
2022-05-23 15:53:45 +02:00
Joe Blubaugh
1cc034d960
Alerting: Add a "Reason" to Alert Instances to show underlying cause of state. (#49259)
This change adds a field to state.State and models.AlertInstance
that indicate the "Reason" that an instance has its current state. This
helps us account for cases where the state is "Normal" but the
underlying evaluation returned "NoData" or "Error", for example.

Fixes #42606

Signed-off-by: Joe Blubaugh <joe.blubaugh@grafana.com>
2022-05-23 16:49:49 +08:00
Joey Tawadrous
f06d9164a6
Jaeger: Update operations dropdown (#49329)
* Fix issue where no values would load in operations dropdown

* Better naming

* Updated tests
2022-05-22 10:29:25 +01:00
Leon Sorokin
4f46c2f75f
HeatmapNG: render exemplars (#49287)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-05-21 19:13:28 -07:00
Gábor Farkas
0caeaaafe3
loki: add back frontend-mode metadata queries (#49297) 2022-05-21 16:46:39 +02:00
Gábor Farkas
93e299305c
loki: backend-mode: apply default max-lines if not set in the UI (#48859) 2022-05-21 16:39:21 +02:00
Adela Almasan
b3b650be1f
Canvas: Context menu (#48909)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
2022-05-20 12:30:29 -07:00
Gábor Farkas
c980655f08
elastic: config: hide access-mode selector when not needed (#49246) 2022-05-20 17:42:12 +02:00
Andreas Christou
34fa7b493c
AzureMonitor: Fixes metric definition for Azure Storage queue/file/blob/table resources. (#49101)
* Appropriately set metric definition

- Nested storage account resources (queues/blobs/tables/files) require metric definition of Microsoft.Storage/storageAccounts
- Update tests accordingly

* Restructure getResourceNames test

- Add expect on getResource args

* Update to fix issue for new query editor

- Reconstruct resourceUri if the resource is a storage account
- Correctly push storage namespaces as options for metric namespaces
- Filter options appropriately

* Fix duplicate options

* Fix lint issues

* Add comment explaining URI modification
2022-05-20 16:36:42 +01:00
Gábor Farkas
061055fac9
loki: dataframes: do not set field.config.DisplayName (#49317) 2022-05-20 17:27:49 +02:00
Andreas Christou
2780651ea8
AzureMonitor: Fix auto-selection of time-grain for metrics. (#49278)
* Update query editor to fix auto time-grain selection

* Update new query editor to fix auto time-grain selection

* Remove log and fix lint issues

* Add test for useMetricMetadata

- Add necessary types

* More test updates

- Update old dataHooks test
- Ensure query changes

Co-authored-by: Kevin Yu <kevinwcyu@users.noreply.github.com>
Co-authored-by: Andres Martinez Gotor <andres.mgotor@gmail.com>
Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
2022-05-20 15:45:54 +01:00
Erik Sundell
bd320ee0b3
Auth: Remove grafana ui dependency to the aws sdk (#43559)
* remove grafana ui dependency to the aws sdk

* wip

* cleanup

* add tests

* point to real version of aws-sdk
2022-05-20 16:04:20 +02:00
renovate[bot]
be7de1041a
Update Monthly patch updates (#49257)
* Update Monthly patch updates

* remove @types/slate update and run prettier

* fix @types/slate resolution

* lockfile update

* more fixes

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2022-05-20 13:07:07 +01:00
Nathan Marrs
646dcfccf9
Canvas: Implement minimum element size + center constraint UX (#49294) 2022-05-20 00:04:34 -07:00
Kevin Yu
0a95d493e3
Cloud Monitoring: Use new annotation API (#49026)
* remove angular code

* format annotation on backend

* format time with time type instead of string

* update annotation query tests

* update get alignment data function

* update annotation query editor

* add annotation query editor test

* update struct

* add tests

* remove extracted function

* remove non-null assertion

* remove stray commented out console.log

* fix jest haste map warning

* add alignment period

* add AnnotationMetricQuery type
2022-05-19 13:52:52 -07:00
Isabella Siu
66220758b3
CloudWatch: migrate old variable queries with empty array (#49197) 2022-05-19 10:43:26 -04:00
Gábor Farkas
0355772e36
loki: do not use backend-mode when keepCookies is used (#49222) 2022-05-19 14:26:54 +02:00
Nathan Marrs
35ea67c210
47853 canvas constraint visualizations (#49206)
Co-authored-by: Adela Almasan <adela.almasan@grafana.com>
2022-05-18 18:49:57 -07:00
Ryan McKinley
d0d4d8af7f
Heatmap: improve new heatmap options (#49201) 2022-05-19 01:54:32 +02:00
Isabella Siu
ce1b1bc36b
CloudWatch: migrate variable query dimension filter (#48562)
* CloudWatch: migrate variable query dimension filter

* separate tests
2022-05-18 13:51:18 -04:00
Gábor Farkas
45d6d38183
Elasticsearch: Remove browser access mode (#49014)
* elastic: remove browser-access-mode

* improved text

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* improved text

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* better text

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* better text

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* better text

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* prettier fixes

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
2022-05-18 11:04:47 +02:00
renovate[bot]
d4d2a747d0
Update dependency lru-cache to v7.10.1 (#49096)
* Update dependency lru-cache to v7.10.1

* update snapshot

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2022-05-18 10:00:46 +01:00
Konrad Lalik
43ab0c1f95
Alerting: Fix Loki buildinfo request error (#49073)
* Skip buildinfo fetching for Loki data sources

* Fix and add tests

* Fix linter

* Improve typings

* Improve Loki's buildinfo notice

* Fix rename, improve prom app display name
2022-05-18 10:45:26 +02:00
Shirley
ef9e08ffcf
CloudWatch: Change aggregateResponse to return slice instead of map (#48805)
* Rename tests

* Change test names

* Change metrics from map to slice

* Add test for one output, multiple MetricDataResults

* Rename test input file

* Use map instead of iterating over the response metrics

* Rename variable

* move partial data set to query row response

* remove not used label field

* remove incorrect placeholder

Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
2022-05-18 09:16:38 +02:00
Ryan McKinley
30e4e9399b
Geomap: show delete button (#49125) 2022-05-17 23:39:54 -07:00
Sarah Zinger
c652849303
Azure Monitor: Add Resource Picker for Metrics Queries (#49029) 2022-05-17 12:53:39 -04:00
Adela Almasan
14c2f4f3da
Geomap: Legend threshold style update (#49020) 2022-05-16 19:54:10 -07:00
Nathan Marrs
3fbda0f35b
Canvas: Improve constraint selection ux (#48837) 2022-05-16 10:28:19 -07:00
Connor Lindsey
ea1001f1f5
Tempo: Trim whitespace from trace id query (#49008) 2022-05-16 10:50:02 -06:00
Gábor Farkas
683c1c0f40
logs: use explicit frame-type-check (#48940) 2022-05-16 13:38:05 +02:00
Ieva
f256f625d8
AccessControl: Enable RBAC by default (#48813)
* Add RBAC section to settings

* Default to RBAC enabled settings to true

* Update tests to respect RBAC

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2022-05-16 12:45:41 +02:00
Erik Sundell
3106af9eec
Cloudwatch: Set time zone offset in GMD request (#48772)
* set timezone offset in case feature is enabled

* add unit tests

* add unit tests

* remove unused import
2022-05-16 12:15:54 +02:00
Gábor Farkas
f866165445
loki: backend: add error-prop if loki parse error happened (#48860) 2022-05-16 08:29:46 +02:00
Gábor Farkas
8b9419222a
loki: backend-mode: fix experimental stream-mode (#48936) 2022-05-16 08:28:41 +02:00
Leon Sorokin
c1b56e79ef
HeatmapNG: Sparse renderer (#48993)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-05-15 21:03:50 -07:00
Björn Rabenstein
97759c75f4
Prometheus: add support for new _experimental_ sparse histograms/heatmaps (#47801)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-05-16 02:47:18 +02:00
Andres Martinez Gotor
6c9cf4843f
AzureMonitor: Style improvements to ResourcePicker (#48875)
Co-authored-by: Kevin Yu <kevinwcyu@users.noreply.github.com>
Co-authored-by: Isabella Siu <isabella.siu@grafana.com>
Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>
2022-05-12 16:32:29 +02:00
Gábor Farkas
44e7602ad2
loki: backend-mode: add "limit" dataframe meta attribute (#48894) 2022-05-12 06:56:09 +00:00
Adam Simpson
a1217ef8da
AzureMonitor: begin moving metrics query editor to use @grafana/experimental (#48878)
* feat: migrate Azure Metrics Query Editor Field to experimental UI

* feat: ensure tests pass with experimental feature flag enabled

* feat: avoid duplicate unit tests for experimental MetricsQueryEditor
2022-05-12 02:54:43 +00:00
Ryan McKinley
3a32a73459
Search: use bluge index for frontend search (playground) (#48847) 2022-05-11 15:32:13 +00:00
Gábor Farkas
270e38cfcf
loki: backend-mode: handle derived fields (#48873) 2022-05-11 09:29:04 +02:00
Andreas Christou
2bd9e9aca5
AzureMonitor: Add support for selecting multiple options when using the equals and not equals dimension filters (#48650)
* Add support for multiselect

- Add filters param to Dimensions
- Update existing tests
- Add MultiSelect component
- Add helper function to determine valid options
- Update labels hook to account for custom values
- Update go type
- Add function to build valid filters string

* Additional go tests

- Ensure query targets are built correctly

* Update DimensionFields frontend test

- Corrently rerender components
- Additional test for multiple labels selection
- Better selection of options in react-select components

* Fix lint issue

* Reset filters when operator or dimension changes

* Terminology

* Update test

* Add backend migration

- Update types (deprecate Filter field)
- Add migration logic
- Update tests
- Update dimension filters buliding

* Add migration test code

* Simplify some logic

* Add frontend deprecation notice

* Add frontend migration logic and migration tests

* Update setting of filter values

* Update DimensionFields test

* Fix linting issues

* PR comment updates

- Remove unnecessary if/else condition
- Don't set filter default value as queries should be migrated
- Add comment explaining why sw operator only accepts one value
- Remove unnecessary test for merging of old and new filters

* Nit on terminology

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>

* Rename migrations for clarity

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2022-05-10 15:05:48 +01:00
Andres Martinez Gotor
b1bde7667f
CloudMonitoring: Allow to set a custom value or disable graph_period (#48646) 2022-05-09 13:43:10 +02:00
Ryan McKinley
42098a7a27
Heatmap (new): exemplars tooltip stub (#48795) 2022-05-06 07:21:14 -07:00
Gábor Farkas
c4edab884e
logs: simpler nanoscecond timestamp handling (#48773) 2022-05-06 10:55:12 +02:00
Stephanie Closson
454e804657
Heatmap (new): add exemplar mapping function (#48780) 2022-05-05 15:27:28 -07:00
Connor Lindsey
c1b5ea3e54
Tracing: Add trace to metrics config behind feature toggle (#46298)
* Add trace to metrics behind feature flag
2022-05-05 14:46:18 -06:00
Nathan Marrs
34fefa1d47
Fix to geomap editor crash (#48786) 2022-05-05 13:28:03 -07:00
Leon Sorokin
6de77283c6
Prometheus: make parsing of Infinity variants case-insensitive (#48660) 2022-05-05 12:38:26 -05:00
sam boyer
ea96c42545
schemas: Update to cuetsy v0.0.1 (#48753)
* Add explicit cuetsy annotations to all models.cue

* Update to first cuetsy release

* Clean up cuetsify a bit; remove unification

* Update changes to news codegen output
2022-05-05 11:56:53 -04:00
Ivana Huckova
250b72cc1b
Elasticsearch: Remove support for versions after their end of the life (<7.10.0) (#48715)
* Elasticsearch: Remove support for versions after their EOL

* Update docs

* Remove old versions from config

* Update pkg/tsdb/elasticsearch/elasticsearch.go

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>

* Fix tests

* Fix typecheck errors

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2022-05-05 16:16:34 +02:00
Konrad Lalik
65d7d466d7
Alerting: Improved RBAC for Alert managers (#48344)
* Initial support for grafana or cloud only alert managers

* Handle missing alert manager

* Refactor code, fix tests

* Fix redirect url

* Bring back the test

* Improve missing alert manager warning, add useAlertManagerSourceName tests

* Fix lint errors

* Rename alert manager hook

* Refactor alert manager label creation

* Improve warnings' messages

* Fix linter

* Fix warning condition in RuleEditor
2022-05-05 13:34:58 +02:00
Gábor Farkas
da74dba7c8
Loki: backend: use streaming JSON parser, try2 (#48752)
* converter: remove __name__ customization because Loki does not do that

Loki does not handle __name__ in a special way.
for Prometheus, the caller can implement the formatting
by themselves

* converter: change labels-formatting

the labels.String() method does not handle strange values well

* loki: backend: use streaming-json parser

* more idiomatic code

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>

* simpler row-length check

* simpler code

* fixed converter/prom tests

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
2022-05-05 13:09:01 +02:00
Gábor Farkas
3cade2f669
Revert "Loki: backend: use streaming JSON parser (#47656)" (#48747)
This reverts commit 46b40b6e82.
2022-05-05 12:02:53 +02:00
Giordano Ricci
143810bb95
Explore: simplify support for multiple query editors (#48701)
* Explore: simplify support for multiple query editors

* CloudWatch: remove usage of deprecated plugin methods

* Apply suggestions from code review

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

* Update docs/sources/developers/plugins/add-support-for-explore-queries.md

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

* Update docs/sources/developers/plugins/add-support-for-explore-queries.md

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

* run prettier

Co-authored-by: JitaC <70489351+achatterjee-grafana@users.noreply.github.com>
2022-05-05 10:36:50 +01:00
Gábor Farkas
60cabaea0a
loki: use metadataRequest in testDatasource (#48431) 2022-05-05 09:43:36 +02:00
Gábor Farkas
46b40b6e82
Loki: backend: use streaming JSON parser (#47656)
* converter: remove __name__ customization because Loki does not do that

Loki does not handle __name__ in a special way.
for Prometheus, the caller can implement the formatting
by themselves

* converter: change labels-formatting

the labels.String() method does not handle strange values well

* loki: backend: use streaming-json parser

* more idiomatic code

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>

* simpler row-length check

* simpler code

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
2022-05-05 08:47:40 +02:00
Adela Almasan
5df91bdcf1
Canvas: Inline edit (#48222)
Canvas inline edit panel

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-05-04 14:15:07 -05:00
Adela Almasan
efe09d6a8b
Geomap: Legend and scale overlapping (#47594)
Updated legend bottom left custom style when scale is shown
2022-05-04 10:14:19 -05:00
Ashley Harrison
06d3c27bc1
Select: Portal menu by default (#48176)
* Remove menuShouldPortal from all <Select /> components

* fix unit tests

* leave menuShouldPortal as an escape hatch

* Fix import order
2022-05-04 15:12:59 +01:00
renovate[bot]
00dbea91ea
Update dependency lru-cache to v7.9.0 (#47480)
* Update dependency lru-cache to v7.9.0

* update snapshot

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2022-05-04 15:07:27 +01:00
Adam Simpson
b2644de6c8
AzureMonitor: add feature toggle azureMonitorExperimentalUI for migrating to experimental UI (#48658)
* feat: add feature toggle azureMonitorExperimentalUI

Add QueryHeader which adds an experimental header to AzureMonitor. This work is documented in #44432.
2022-05-04 13:54:09 +00:00
Alexander Kubyshkin
f00ffb190c
Escape backslashes in regexps in Loki label browser (#45809, #47039). (#47412)
* Escape backslashes in regexps in Loki label browser (#45809, #47039).

* Escape values in Loki Query Builder.

* Escape more values in Loki Query Builder.
2022-05-04 12:49:04 +02:00
Nathan Marrs
ff38f24044
Canvas: Refactor group to frame (#48671) 2022-05-03 22:58:00 -07:00
Erik Sundell
0d60b1ce0a
CloudWatch: Display dynamic label field in case feature is enabled (#48614)
* move metrics editor related files to a separate folder

* cleanup

* add tests

* remove snapshot test

* nit

* remove unsued import

* remove snapshot
2022-05-04 07:36:18 +02:00
Nathan Marrs
66d7105b34
Canvas: Group constraint support (#48563) 2022-05-03 19:51:01 -07:00
Adela Almasan
0b5ffcfcf0
Geomap: Legend style update (#48641)
Legend style update
2022-05-03 15:03:41 -05:00
Joey Tawadrous
09634b518c
Traces Panel: Add new Traces Panel visualization (#47534)
* Panel

* Support tempo dash variables

* Support tempo explore variables

* Only show span links for explore

* Cleanup

* Added tests

* apply variables to search

* Tests for search variables

* Handling no data

* Interpolation and tests

* TracesPanel tests

* More tests

* Fix for backend test

* Manager integration test fix

* Traces doc and updated visualizations index doc

* Logs for this span

* Search, scrollToTop, other improvements

* Refactor to extract common code

* Removed TopOfViewRefType optional

* Remove topOfViewRef optional

* Removed another optional and fixed tests

* Test

* Only show search bar if trace

* Support traces panel in add to dashboard

* Self review

* Update betterer

* Linter fixes

* Updated traces doc

* Ahh, moved the for more info too

* Updated betterer.results

* Added new icon

* Updated expectedListResp.json
2022-05-03 17:42:36 +01:00
Will Browne
4ecd57f49c
Plugins: Introduce HTTP 207 Multi Status response to api/ds/query (#48550)
* feature toggles

* return HTTP 207 from ds/query

* add ft check

* add API test

* add 207 check for qr

* change to OR

* revert check

* add explicit toggle check for cloudwatch

* remove unused import

* remove from defaults.ini

* add status codes to md and update swagger

* new fangled http api tests pattern

* update swagger

* Update docs/sources/http_api/data_source.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* add missing word and reformat

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
2022-05-03 18:02:20 +02:00
Ivana Huckova
769be876a5
Loki, Prometheus: Remember preferred editor (#48580)
* Loki: Remember default editor

* Loki: Add tests

* Prometheus: Set default editor type

* Fix and refactor tests

* Remove unused import
2022-05-03 14:50:13 +02:00
jcolladokuri
3ee99821bc
AzureMonitor: Updates allowed namespaces (#48468) 2022-05-03 14:41:05 +02:00
Erik Sundell
929d3134d1
Cloudwatch: Dynamic labels frontend migration (#48579)
* migrate metric queries

* restructure migrations

* self review

* cleanup tests

* ensure alias is not changed

* apply pr feedback
2022-05-03 13:52:17 +02:00
Leon Sorokin
a927608cf5
Chore: uPlot 1.6.20 (#48596) 2022-05-03 05:22:14 -06:00
Andreas Gerstmayr
21034e31de
chore: remove executable permissions of source files and docs (#46303) 2022-05-03 12:08:14 +02:00
Gábor Farkas
7d369a1dea
Loki: backend: use json-field (#48486)
* fixed strings

* loki: backend: use json-field
2022-05-03 08:03:25 +02:00
Sarah Zinger
a8354a0319
Azure Monitor: add search feature to resource picker. (#48234)
Co-authored-by: Andres Martinez Gotor <andres.mgotor@gmail.com>
2022-05-03 03:57:56 +02:00
Brendan O'Handley
4867a6b15f
Graphite Datasource: add responseType: 'text' to http options to return full list of functions (#47663)
* add response type text to graphite datasource http options to return full list of functions

* add comment for adding response type text to call to  graphite /functions endpoint

* Add tests for invalid and valid JSON mocking backendSrv fromFetch

* remove unnecessary code from tests

* remove extra logic for graphite /functions endpoint returning {} #46681

* add graphite functions list logic back in to see why alert test broke

* fix conflict message

* fix conflicts

* fix issues with rebase, add responseType text back in, remove extra graphite functions list logic checks

* add email for license/cla check
2022-05-02 13:05:31 -04:00
Ivana Huckova
da1d34e83d
Elasticsearch: Add deprecation notice for < 7.10 versions (#48506)
* Elasticsearch: Add deprecation notice for old versions

* Add option to remove notice

* Remove deprecation from editor

* Update

* Update public/app/plugins/datasource/elasticsearch/configuration/ConfigEditor.tsx

* Simplify

* Update documentation

* Update

* Update docs/sources/datasources/elasticsearch.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>
2022-05-02 17:08:47 +02:00
Adam Simpson
c57924e332
A11y: Fix remaining focus issues with Switch (#48376)
* refactor: replace uses of checked prop for <Switch> with value prop

* fix: remove spaces from ids

The ID format is stated as follows([source][1]):

> ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]),
hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

Since `QueryHeaderSwitch` is used in two places I created a new variable that replaces spaces with a dash in the label.

[1]: https://www.w3.org/TR/html401/types.html#type-name

* fix: allow Switch in AlertingSettings to be focused by keyboard

* fix: allow Switch in PromSettings to be focused by keyboard

Fixes #46472

Co-authored-by: Elfo404 <me@giordanoricci.com>
2022-05-02 13:50:44 +00:00
Kristina
a98a872929
Command Palette - use same focus overlay as modals, override monaco keybinding for prometheus (#48391)
* Command Palette - use same focus overlay as modals, override whatever captures command K in monaco

* Pass the key event out of monaco
2022-05-02 08:22:33 -05:00
Erik Sundell
a5c570a5f6
Cloudwatch: Refactor metrics query editor (#48537)
* refactor metrics query editor to return a function component

* add tests for metrics query editor

* add simple render tests for panel query editor

* remove obsolete test

* pr feedback
2022-05-02 10:09:24 +02:00
Isabella Siu
74c2c2ccf0
CloudWatch: add generic filter component to variable editor (#47907)
* CloudWatch: add generic filter component to variable editor

* remove multi-text-select object

* remove hidden

* andres comments

* migration between 8.5 and this

* add waitFors to tests

* more await tweaks

* actually fix tests

* use popoverContent tooltip

* fix template variable handling

* prettier fix

* fix prettier 2

* feat: make tooltip links in query variable editor clickable

* fix template stuff

Co-authored-by: Adam Simpson <adam@adamsimpson.net>
2022-04-29 16:42:59 -04:00
Andreas Christou
d7c16e06d2
AzureMonitor: Add support for not equals and startsWith operators when creating Azure Metrics dimension filters. (#48077)
* Allow dimension operator selection

- Add dimension operators and function to update the operator in the query
- Add logic to ensure the same dimension cannot be selected multiple times (Azure restriction)
- Add selection component

* Update backend logic to default operation and filter to eq '*'

- This must be done as the ne and sw operators do not work with the wildcard filter

* Add tests on dimension operators

* Correct placement of 'and' when building query

* Add comment and simplify filtering logic

* Allow multiSelect for eq and ne operators

- Pass PanelData to DimensionFields component
- Add logic to retrieve labels from PanelData
- Add MultiSelect component for relevant operators
- Update frontend types to allow filter to be an array of strings
- Update backend types to allow filter to be an array of strings
- Update filter string building

* Improve setting of labels

* Update go tests

* Update frontend tests

- Add panelData mock (to be expanded later)
- Update null check in DimensionFields

* Allow custom value and set default

* Add frontend test and fix lint issues

* Improved handling of options for sw operator

* Remove changes related to multiselect

* Add check on refId to ensure dimension labels are correct for query

* Extract custom hook for setting dimension labels

* Add documentation around Azure Monitor metrics dimensions

* Update MetricQueryEditor tests

- Add missing data prop

* Correctly set field values

* Add additional expect for onQueryChange

* Correctly set operators

- Simplify onFilterInputChange

* Ensure no duplicate filters appear

* Ensure that filters are displayed correctly for saved queries

* Update dimension filter test

* Include additional test around changing dimension labels

* Pass panel data through new metrics query editor
2022-04-29 17:01:13 +01:00
Joey Tawadrous
412dbc21e3
Traces: Filter by service/span name and operation in Tempo and Jaeger (#48209)
* Filter search options in Tempo

* Tests for filtering search options in Tempo

* Filter search options in Jaeger

* Tests for filtering search options in Jaeger

* Self review

* Fuzzy search
2022-04-29 09:52:11 +01:00
Andrej Ocenas
bd9cec8827
Prometheus: Fix disappearing multi values in metric label values (#48127) 2022-04-29 10:22:49 +02:00
Gábor Farkas
ae926c2144
loki: better resource-call urls (#48250) 2022-04-28 14:28:57 +02:00
Torkel Ödegaard
4fef50272f
Select: Improve usability slightly (#47796)
* Select: Improve usability slightly

* Latest change

* Fixed test

* Updated test
2022-04-28 12:25:51 +02:00
Andres Martinez Gotor
6edefe5147
AzureMonitor: Remove deprecated code (#48328) 2022-04-28 10:27:39 +02:00
Torkel Ödegaard
07bd261cff
Graph: Deprecate Graph (old) and make it no longer a visualization option for new panels (#48034)
* Graph: Make old graph deprecated, no longer selectable

* Fixing snapshot
2022-04-28 08:20:51 +00:00
Nathan Marrs
b990d3c9e3
Canvas: Fix selecto breaking on enter / exit panel edit mode (#48387) 2022-04-27 20:51:02 -07:00
Sarah Zinger
3ae90efda2
Azure Monitor: refactor resource picker (#48312)
* Refactor Resource Picker to split up data logic from view logic.
2022-04-27 20:06:21 -04:00
Sarah Zinger
ebfb70dc12
Azure Monitor: Scroll on resource picker fix and general clean up (#48311)
* Fix bug where resource picker doesn't open automatically to a previously selected resource.
2022-04-27 12:57:18 -04:00
Ivana Huckova
a60c32275e
LabelFilter: Use EditorField instead of Field (#48339) 2022-04-27 15:13:11 +02:00
Erik Sundell
f58a2d879e
Cloudwatch: Use new annotation API (#48102)
* use new annotation api

* fix bad merge
2022-04-27 12:41:48 +02:00
Ryan McKinley
5294a2af48
Testdata: show settings for current simulation (#48017)
Co-authored-by: An Le <an.le@grafana.com>
2022-04-26 13:45:42 -07:00
Connor Lindsey
0da50294fe
Service Graph: Display alert if no metrics found (#48214) 2022-04-26 11:43:18 -06:00
Kevin Yu
1be45d1ed9
Azure Monitor: reset resource uri when resource changes (#48235) 2022-04-26 07:36:37 -07:00
Connor Lindsey
4e6c3be7ab
Tracing: Add string unit to trace search results to prevent Infinity bug (#48206) 2022-04-26 07:09:40 -06:00
Gábor Farkas
c73b9d1818
Loki: do not use the old labels-api (#48185)
* loki: do not use old labels-api

* adjust allowed-url-list

* fixed tests
2022-04-26 11:51:26 +02:00
Ivana Huckova
c0ee94a04d
Update grafana/experimental and fix Cloudwatch components (#48132)
* Update grafana/experimental and fix components

* Simplify
2022-04-26 11:28:34 +02:00
Adam Simpson
6c0a5b121e
CloudWatch: prevent log groups from being removed on query change. (#47994)
* CloudWatch: prevent log groups from being removed on query change.

Previously when a query was changed the existing log groups for that query were "dropped". The fix is to combine the
new query with the existing query object in memory to preserve the log groups.

fixes #33626

* CloudWatch: fix typos in runWithRetry documentation

* chore: fix eslint issue
2022-04-25 17:59:52 +00:00
Isabella Siu
801a2a240a
Cloudwatch: fix template variables in variable queries (#48140) 2022-04-25 10:33:49 -04:00
Gábor Farkas
d8a754c4a0
loki: send metadata requests through backend (#48063) 2022-04-25 13:16:14 +02:00
Andres Martinez Gotor
7cfab77650
AzureMonitor: Remove workaround in Logs editor (#48104) 2022-04-25 12:34:12 +02:00
Erik Sundell
cb2c6fe6bc
AzureMonitor: Remove unused angular code (#48110)
* remove unsued code

* fix import
2022-04-25 12:30:33 +02:00
Nathan Marrs
2b2f275a08
Canvas: Support scale + center constraints (#48085) 2022-04-22 14:02:36 -07:00
Josh Hunt
3c6e0e8ef8
Chore: ESlint import order (#44959)
* Add and configure eslint-plugin-import

* Fix the lint:ts npm command

* Autofix + prettier all the files

* Manually fix remaining files

* Move jquery code in jest-setup to external file to safely reorder imports

* Resolve issue caused by circular dependencies within Prometheus

* Update .betterer.results

* Fix missing // @ts-ignore

* ignore iconBundle.ts

* Fix missing // @ts-ignore
2022-04-22 14:33:13 +01:00
Ivana Huckova
28665a869b
Prometheus: Add report interaction for editor modes (#47940)
* Prometheus: Add report interaction for editor modes

* Add new query

* Fix test

* Update public/app/plugins/datasource/prometheus/querybuilder/components/PromQueryEditorSelector.tsx

* Add app to feature tracking

* Update
2022-04-22 10:46:16 +02:00
Gábor Farkas
f2814046d1
loki: logrowcontext: explicitly name fields (#48043) 2022-04-22 08:43:33 +02:00
Ivana Huckova
ce6aed21a7
Loki: Show raw query and patterns only in query builder (#48049) 2022-04-21 14:23:03 +02:00
Ashley Harrison
d832bde270
Upgrade @testing-library/user-event to v14 (#47898)
* Update dependency @testing-library/user-event to v14

* everything is async...

* everything is async pt.2

* Fix cascader tests

* hack the yarn.lock file to remove the old version of @testing-library/dom

* some more fixes!

* MOAR FIXES

* more fixes

* remove a bunch of places where we're wrapping in act()

* down to 7 failing tests...

* Fix arrow tests

* Fix rest of NavBarItem tests

* Fix last tests

* Use {Enter} instead of {enter}

* Revert "Use {Enter} instead of {enter}"

This reverts commit e72453bb52.

* remove some unused act imports

* Fix LibraryPanelsSearch tests

* more stable test

* More consistent test...

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-04-21 13:15:21 +01:00
Andrej Ocenas
ff5aef194c
Prometheus: Highlight operations added in the query builder (#47961)
* Highlight newly added operations

* Better diff for the operations change

* Changed the highlight style
2022-04-21 10:26:27 +02:00
Ryan McKinley
72b5af8d9b
Testdata: add basic tank simulation (#47990) 2022-04-20 12:01:09 -07:00
Nathan Marrs
d442608eb9
Canvas: Implement new constraint system (#47911)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-04-20 09:59:49 -07:00
Gilles De Mey
459c64fd44
Alerting: adds variable replacement to panel filters (#47962) 2022-04-20 16:29:55 +02:00