Commit Graph

150 Commits

Author SHA1 Message Date
sam boyer
6aba592741
Schema: get all devenv dashboards passing validation (#37857)
* Strip nulls (again)

* Add stripnulls script

* Add transformations field

* Close FieldConfig struct; proper plugin validating

* s/graph/viz/ field in histogram dashboard

* Use ui.GraphFieldConfig in histogram model

* Add models for stat, gauge, barguage panel plugins

Also toss necessary shared types into cue/ui/gen.cue, with TODOs to move
them appropriately later.

* Add required license headers

* Heap of updates to cue UI components

* Fix barchart types and one old devenv input

* Use the GraphFieldConfig directly for timeseries

* Add models.cue for a few panel plugins

Barchart, state-timeline, and status-history

* Enable the test validating all devenv dashboards!!

* Fix effects of not checking after making comments

* Update packages/grafana-ui/src/options/models.gen.ts

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

* Realign and unalign cue with ts types

* Update devenv test to sniff for null errors

Best option we have right now for helping people to know they need to
strip nulls from devenv dashboards.

* Add speculative default for barchart stacking

* Fixup some dated devenv dashboards

timeline-modes needed to be regenerated with the appropriate tooltip
values included, per typing requirements, and timeline-demo needed to
have the `mode` field removed, as it is not intended to be persisted.

* Add necessary missing options for various panels

* Regenerate devenv dashboards

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-08-17 07:11:57 -04:00
Ryan McKinley
f5b8e8b48a
Devenv: remove unused stacking setting (#37898) 2021-08-13 21:09:57 +02:00
Leon Sorokin
6a77cd43ae
GraphNG: refactor by-value color schemes (#37670)
* GraphNG: account for top canvas padding in gradient gen for color scheme/thresholds-by-value

* Updated test dashboard

* Added fix for issue when scaleMin was same as threshold

* fixed firefox issue

* revert docs changes

* update gdev dash for easier comparisons & regression spotting

* refactor

* optimize gradient re-gen/re-use and color more tinycolor.setAlpha() -> alpha(). update uPlot to dev build.

* fix percentage steps

* implement % threshold region rendering

* crisp threshold line rendering

* simplify

* WIP: hoverpoint dynamic color interpolation

* fix hover point color interp

* re-use gradient gen to draw threshold areas

* re-implement by-value color scales

* tweak comment

* mimic tinycolor behavior in colorManipulator.alpha() for empty colors

* explicitly disable hover points for BarChart and Histogram

* reduce test failures and required changes to tests

* fix barchart tests

* uPlot 1.6.15

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-08-13 09:38:04 -05:00
ying-jeanne
d18bd03a82
Scuemeta: Fix cue schemas for panels (#37788)
* complete the data model of graph panel

* fix histogram graph

* fix timeseries panel type

* Update cue/ui/gen.cue

Co-authored-by: sam boyer <sam.boyer@grafana.com>

* fix graph/viz and gradientMode enum

* add the changes into cue component and remove fields for graph panel

Co-authored-by: sam boyer <sam.boyer@grafana.com>
2021-08-12 09:52:03 -04:00
sam boyer
a17339cb9a
One-off schema support for old graph and row plugins (#37810)
* Add special types for graph and row panels

* Update old keys on dashboard json
2021-08-12 09:50:10 -04:00
sam boyer
e1637f70bd
Strip nulls from all latest devenv dashboards (#37602)
Everything schemaVersion >= 30
2021-08-10 00:42:41 +08:00
Dominik Prokop
40a87a7851
BarChart: use uPlot's native bars pathbuilder (#36725) 2021-07-22 00:50:59 +02:00
Torkel Ödegaard
702fd1cad9
Visualizations: Dynamically set any config (min, max, unit, color, thresholds) from query results (#36548)
* initial steps for config from data

* Moving to core and separate transforms

* Progress

* Rows to fields are starting to work

* Config from query transform working

* UI progress

* More scenarios working

* Update public/app/core/components/TransformersUI/rowsToFields/rowsToFields.ts

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

* transform all

* Refactor

* UI starting to work

* Add matcher UI to transform

* Apply to self

* Adding a reducer option

* Value mapping via new all values reducer

* value mappings workg add -A

* Minor changes

* Improving UI and adding test dashboards

* RowsToFieldsTransformerEditor tests

* Added tests for FieldToConfigMapping Editor

* Added test for ConfigFromQueryTransformerEditor

* Minor UI tweaks

* Added missing test

* Added label extraction

* unified mapping

* Progress refactoring

* Updates

* UI tweaks

* Rename

* Updates

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-07-13 10:51:34 +02:00
Torkel Ödegaard
a241f03167
TimeSeries: Support coloring series and line by thresholds or gradient color scales (#35910)
* TimeSeries: Adds support for color scheme series and line colors

* Updates

* fixed device issue

* Evaluate series color in legend

* two fixes

* It works with points

* Added test dashboard

* Minor fix

* Reset color mode to palette when switching to panel that supports by series mode

* Add support for relative thresholds

* Updated snapshots
2021-07-07 12:40:40 +02:00
idafurjes
7231eba6a5
Chore: Refactor OpenTSDB using backend SDK (#35815)
* Refactor OpenTSDB using backend SDK

* Adjust tests to the SDK refactor

* Remove openTSDB from service

* Rename OpenTASDB service to Service, use AuthPassword from DecryptedSecureJson

* Devenv: Add opentsdb v2.3 data source and dashboard

* Letting http client provider to set basic auth,
renaming,
casting datasource direclty to pointer

* Update pkg/tsdb/opentsdb/opentsdb.go

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

* Update pkg/tsdb/opentsdb/opentsdb.go

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

* Format struct

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-06-30 15:58:44 +02:00
Leon Sorokin
503c3b8f66
Time series: always show single points if surrounded by nulls (#35845) 2021-06-17 15:44:26 -05:00
Ryan McKinley
4972e0f6a1
Rename: Status grid to history (#34864) 2021-05-29 20:24:14 +02:00
Torkel Ödegaard
119dbc4d76
Histogram: Adds histogram test dashboard & test data (#34821)
* Added test data that contains normal distribution

* Added histogram test dashboard

* Fixed so panels share same data
2021-05-27 17:27:29 +02:00
Torkel Ödegaard
29d34974e7
PieChart: Enable shared crosshair on pie chart test dashboard (#34809) 2021-05-27 13:31:22 +02:00
Torkel Ödegaard
6fb0560a84
TestData: Some simple small test data and first draft of what's new in v8 demo dashboard (#34731)
* TestData: More test data

* Added v8 demo dashboard
2021-05-26 14:11:57 +02:00
Torkel Ödegaard
987bffe482
TestData: Support for csv files & csv content (#34674)
* initial implementation of csv support for test data source

* CSV file & content scenarios working

* Removing categorical data

* fixing handler names

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fixed lint issues

* updated so it uses the same parsing

* more CSV tests

* lint fixes

* more lint

* lint

* support time field

* migrate manual entry to csv

* more test output

* more test output

* missing file

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-05-26 10:42:42 +02:00
Leon Sorokin
9237348076
Timeline: legend (#34340) 2021-05-19 21:38:31 -07:00
Dominik Prokop
a2cbbe1b8a
BarChart: value label sizing (#34229)
* Bar chart label positioning and sizing

* Dev dashbard

* Improve autosizing

* Remove sync option

* Unify text sizing options between stat-ish visualizations and bar chart

* Add simple categorical data scenario and update dev dashboard

* Remove unused options builder

* Add docs annotations

* Fix go lint
2021-05-19 17:33:56 +02:00
Leon Sorokin
e3188458d5
Timeline & StatusGrid: cleanups (#34250)
* remove text alignment, per-box hover for grid, fix mergeValues

* unconditionally set spanNulls = -1

* fix stroke width offset math

* split multi-hover, so only single mark overlays in grid mode

* restore alignValue in state-timeline

* better descriptions, maybe

* init field.config.custom if necessary

* don't show last out-of-view value

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-05-18 16:38:39 -05:00
Ryan McKinley
de5cd4a7d3
Timeline: split "periodic" mode into its own panel (#34171) 2021-05-17 13:00:04 -07:00
Torkel Ödegaard
953aadd6e4
Timeline: Adds opacity & line width option (#34118)
* Timeline: Adds opacity & line width option

* Updated devenv dashboards, added back original timeline modes
2021-05-14 17:24:40 +02:00
Giordano Ricci
8ec87250c1
Elasticsearch: Fix handling of inline scripts in different ES versions (#34070)
* Devenv: add block for es 5.0, provisioned datasource & dashboard

* Trasnsform script property based on running ES version

* Handle different scripts format in BE
2021-05-14 11:50:15 +01:00
Leon Sorokin
601455190e
Timeline: rename modes, grid -> Periodic samples, spans -> State changes (#34033) 2021-05-13 00:04:22 -07:00
Dominik Prokop
deeef321d3
Unify tooltip options across visualizations (#33892)
* Unify tooltip options across visualizations

* Update tests

* use addTooltipOptions in piechart

Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
2021-05-11 15:46:12 +02:00
Leon Sorokin
4959c55985
Timeline: add support for strings & booleans (#33882) 2021-05-10 20:41:06 -07:00
Dominik Prokop
9f8fa4212f
GraphNG - shared cursor (#33433)
* Initial work

* WIP add cursor in debug panel

* shared cursor.sync filter

* explicit uplot events

* explicit uplot events

* uplot events

* uplot events

* depend on master uplot

* sync sync sync

* Fix merge

* Get rid of PlotSyncContext and sync tooltip positions

* make sync optional

* Improve shared tooltip positioning

* Plugins: add level and signature badges to plugin details page (#33553)

* feat(grafana-ui): badge can accept react node for text, add shield-exclamation to icons

* feat(plugins): add PluginSignatureType type

* feat(pluginpage): introduce PluginSignatureDetailsBadge. Fix sidebar icon margin

* feat(pluginlistpage): update filterinput placeholder, introduce filter by plugin type

* Variables: Removes the never refresh option (#33533)

* Variables: Removes the never refresh option

* Tests: fixes DashboardModel repeat tests

* Tests: fixs snapshots

* Tests: fixes processVariable test

* Tests: fixes DashboardModel tests

* PageLayout: Fixes max-width breakpoint so that it triggers only when there is room for margin+ (#33558)

* Alerting: Remove datasource (name) from migration (#33544)

no longer needed as of https://github.com/grafana/grafana/pull/33416
for https://github.com/grafana/alerting-squad/issues/126

* Library panels: Adds description to library panels tab (#33428)

* CodeOwners: Set owners of unified alerting migration (#33571)

* ButtonSelect: updates component with the new theme model (#33565)

* EmptySearchResult: updates component with the new theme model (#33573)

* DashboardSettings: Slight design tweak to fix page toolbar padding and align design (#33575)

* DashboardSettings: Slight design tweak to fix page toolbar padding and align design

* Fixed font weight

* Removed comment

* Update

* gitignore: Ignore files for accesscontrol provisioning (#33577)

* Alerting/metrics (#33547)

* moves alerting metrics to their own pkg

* adds grafana_alerting_alerts (by state) metric

* alerts_received_{total,invalid}

* embed alertmanager alerting struct in ng metrics & remove duplicated notification metrics (already embed alertmanager notifier metrics)

* use silence metrics from alertmanager lib

* fix - manager has metrics

* updates ngalert tests

* comment lint
Signed-off-by: Owen Diehl <ow.diehl@gmail.com>

* cleaner prom registry code

* removes ngalert global metrics

* new registry use in all tests

* ngalert metrics impl service, hack testinfra code to prevent duplicate metric registrations

* nilmetrics unexported

* Add note to Snapshot API doc to specify that user has to provide the entire dashboard model  (#33572)

* Added note as suggested by Macus E.

* Update docs/sources/http_api/snapshot.md

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

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

* Alerting: backend "ng" code cleanup (#33578)

* AlertMigration: remove alert_rule UID db check (#33568)

do not believe this is needed due to uniqueness promised by shortid lib
since there is no provisioning yet. https://github.com/teris-io/shortid

* Live: persisting last message in cache for broadcast scope (#32938)

* Alerting: Load annotations from rule into State cache (#33542)

for https://github.com/grafana/alerting-squad/issues/127

* add template for dashboard url parameters  (#33549)

* Update dashboard-links.md

parameters with plain text like `var-something=value` can make confusion. 
template it to clarify .

* describe way for template link.

* AlertingMigration: Create alert_rule_version entry (#33585)

Create the alert rule version entry during the migration so it is consistent with rules created via api.
for https://github.com/grafana/alerting-squad/issues/123

* Build: Fix with cleanup call maybe? (#33590)

* add selector for code editor (#33554)

* broadcast over eventBus

* broadcasting to eventbus (but not useing it yet)

* merge master

* moved to context

* fix yarn.lock

* update snapshot

* Fix direct state mutation

* Persist location state on partial updates

* GraphNG- use getStream rather than subscribe

* Sync LegacyGraphHoverEvent with GraphNG

* Chenge plotRef signature

* use subscription

* subscription

* one fewer file

* Update types

* Remove unnecessary filtering

* Disable cursor sync when in edit mode

* GraphNG - bring back logging

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
Co-authored-by: Kyle Brandt <kyle@grafana.com>
Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
Co-authored-by: Uchechukwu Obasi <obasiuche62@gmail.com>
Co-authored-by: gamab <gamab@users.noreply.github.com>
Co-authored-by: Owen Diehl <ow.diehl@gmail.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
Co-authored-by: Nagle Zhang <nagle.zhang@sap.com>
Co-authored-by: Erik Sundell <erik.sundell@grafana.com>
2021-05-10 14:24:23 +02:00
Torkel Ödegaard
b62e87f753
TimeSeries: Render thresholds as lines and areas (#33357)
* TimeSeries: First take on uplot thresholds rendering

* Updating theme for color picker and fixing issues

* Updating theme for color picker and fixing issues

* Minor progress

* Added test dashboard

* Adding transparent and text colors to color picker and making them visible

* Good progress on migrations

* Fixed selected issue in color picker

* Fixes

* migration fix

* Fixed test

* Fixing line rendering and refactoring

* Minor ordering fix

* fixed test

* Draw thresholds before axes & series and other tweaks

* Update packages/grafana-ui/src/components/uPlot/config/UPlotThresholds.ts

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2021-05-04 13:03:35 +02:00
Dominik Prokop
0cc620aea7
GraphNG: stacking (#30749)
* First iteration

* Dev dash

* Re-use StackingMode type

* Fix ts and api issues

* Stacking work resurected

* Fix overrides

* Correct values in tooltip and updated test dashboard

* Update dev dashboard

* Apply correct bands for stacking

* Merge fix

* Update snapshot

* Revert go.sum

* Handle null values correctyl and make filleBelowTo and stacking mutual exclusive

* Snapshots update

* Graph->Time series stacking migration

* Review comments

* Indicate overrides in StandardEditorContext

* Change stacking UI editor, migrate stacking to object option

* Small refactor, fix for hiding series and dev dashboard
2021-04-15 13:00:01 +02:00
Gábor Farkas
31a6d12d34
devenv: influxdb data sources and blocks cleanup (#32894)
* devenv: influxdb cleanup

* devenv: influxdb: auto-delete now-unused gdev-data-sources
2021-04-13 15:13:50 +02:00
Dominik Prokop
b47fba4b68
v8: remove Singlestat panel and add automatic migration to stat/gauge(#31904)
* Remove singlestat panel from the codebase

* Automatically migrate deprecated panels

* Migrate singlestat to stat when initializing panel

* Singlestat -> gauge detection

* Missing await

* Throw error when panel plugin not found and allow new panels to take names of the deprecated ones

* Make it pretty

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-04-12 12:47:17 +02:00
Leon Sorokin
6082a9360e
Alpha panel: new Timeline/Discrete panel (#31973) 2021-04-06 18:06:46 -05:00
Leon Sorokin
066c9c8ff4
GraphNG: accept number for spanNulls to indicate max threshold below which nulls are connected (#32146) 2021-03-22 23:00:34 -07:00
Ryan Showalter
de0c98771f
Units: add inches (in) and pounds (lb) (#32196) 2021-03-22 08:28:39 -07:00
Dominik Prokop
fdc6f2cc6f
DataLinks: Bring back single click links for Stat, Gauge and BarGauge panel (#31692)
* Bring back clickable Stat, Gauge and BarGauge panels

* Demo dashboard

* Add DataLinksContextMenu tests

* Only use new UI for data links, revert panel links logic
2021-03-05 10:29:19 +01:00
Alexander Emelin
621500b201
fix devenv dashboard content typo (#31583) 2021-03-03 11:18:52 +03:00
Torkel Ödegaard
fcac61203e
PieChart: Update text color and minor changes (#31546) 2021-03-01 14:08:48 +01:00
Oscar Kilhed
10def28989
PieChart: Improve piechart legend and options (#31446)
* Add percent of total to piechart legend

* Remove defaults

* Add label selector

* Fix multiselect option ui

* Add percent of total to piechart legend

* Add label selector

* add multiselect options ui

* change how pie chart labels are displayed

* Fixed right aligned values in legend

* added titles to display values so they show in table mode

* Move legend display value options to below other options

* Add addMultiSelect method to ui builder

* Use addMultiSelect on builder

* Use multiselect for the legend columns and update the panel test dashboard

* Remove explicit typing on addMultiselect and remove non existing properties from piechart story

* Add release tag

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-03-01 11:18:24 +01:00
Torkel Ödegaard
ce63df425d
TimeSeriesPanel: Fixes overlapping time axis ticks (#31332)
* GraphNG: Fixes overlapping time axis ticks

* Review tweaks
2021-02-19 12:10:48 +01:00
Oscar Kilhed
aeb4bcb3ed
Grafana/UI: Add basic legend to the PieChart (#31278)
* Add basic legend to the PieChart

* Remove console log

* Remove PieChartWithLegend and refactor PieChart a bit

* Use FALLBACK_COLOR

* Refactor PieChart

* Change back to [function]
2021-02-19 11:49:40 +01:00
Torkel Ödegaard
cb5928fdb7
PieChart: Progress on new core pie chart (#28020)
Use visx for the Pie chart plugin.

Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
2021-02-11 14:32:33 +01:00
Torkel Ödegaard
8f691115bc
Table: Updates devenv test dashboard after change to TestData Randrom Table response (#30927) 2021-02-06 18:03:35 +01:00
Hugo Häggmark
2a3aa95163
Variables: Adds queryparam formatting option (#30858)
* Variables: Adds queryparam formatting option

* Chore: fixes strict errors

* Chore: changes after PR comments
2021-02-05 07:16:06 +01:00
Hugo Häggmark
0b1f5c5e32
PanelLibrary: better handling of deleted panels (#30709) 2021-01-29 06:11:13 +01:00
Leon Sorokin
79bc6b6892
TestData: Improve what's new in v7.4 (#30612) 2021-01-25 13:59:00 -06:00
Torkel Ödegaard
0079a275af
TestData: Adding what's new in v7.4 to the devenv dashboards (#30568) 2021-01-25 10:14:39 +01:00
Hugo Häggmark
b7b6632a4d
PanelLibrary: adding library panels to Dashboard Api (#30278)
* Wip: First naive impl

* Chore: fix after merge

* Chore: changes after PR comments

* Chore: removes unused types

* Chore: adds feature toggle

* Refactor: adds library panels cleanup and connect when storing dashboards

* Refactor: adds feature toggle

* Update pkg/services/librarypanels/librarypanels.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/services/librarypanels/librarypanels.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Refactor: adds disconnect library panels when deleting a dashboard

* Chore: changes after PR comments

* Tests: adds tests for LoadLibraryPanelsForDashboard

* Tests: adds tests for CleanLibraryPanelsForDashboard

* Tests: adds tests for ConnectLibraryPanelsForDashboard

* Tests: adds tests for DisconnectLibraryPanelsForDashboard and small refactor

* Update pkg/services/librarypanels/librarypanels_test.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/services/librarypanels/librarypanels_test.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/services/librarypanels/librarypanels_test.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/services/librarypanels/librarypanels_test.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Refactor: deletes all connections in one call and connects all in the same transaction

* Chore: adds better comments

* Chore: changes after PR comments

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-01-20 09:28:10 +01:00
Torkel Ödegaard
93a59561ba
GraphNG: Color series from by value scheme & change to fillGradient to gradientMode (#29893) 2021-01-18 19:48:45 +01:00
Leon Sorokin
803fe70c3e
GraphNG: implement softMin/softMax for auto-scaling stabilization. close #979. (#30326) 2021-01-16 08:24:13 -06:00
Ryan McKinley
8aba480a21
GraphNG: support fill below to (bands) (#30268) 2021-01-15 11:03:41 -08:00
Chris Cowan
5088e2044a
Elasticsearch: Support extended stats and percentiles in terms order by (#28910)
Adds support to the terms aggregation for ordering by percentiles and extended stats. 

Closes #5148

Co-authored-by: Giordano Ricci <grdnricci@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-01-15 12:10:16 +01:00