Commit Graph

10603 Commits

Author SHA1 Message Date
Tobias Skarhed
21f702f7c9 TablePanel: Remove scroll option on TablePanel (#18318) 2019-07-31 18:56:06 +02:00
Eric Leijonmarck
12f5d16c76 Keyboard Shortcuts: Sign in to enable them (#18271) 2019-07-31 15:52:46 +02:00
Tobias Skarhed
7891233812
Chore: noImplicitAny Sub 500 errors (#18287) 2019-07-30 15:49:32 +02:00
Ryan McKinley
4ce814ba94
Utils: avoid calling console.warn() too often for deprecation warnings (#18269) 2019-07-29 21:13:31 -07:00
Ryan McKinley
a52162da37 GettingStarted: Skip Query for getting started (#18268) 2019-07-28 07:54:38 +02:00
kay delaney
9d87923986
Chore: Upgrades typescript to version 3.5 (#18263)
* Chore: Upgrade typescript to version 3.5
2019-07-26 15:14:06 +01:00
Andrej Ocenas
7f1214ac46
Permissions: Show plugins in nav for non admin users but hide plugin configuration (#18234)
Allow non admins to see plugins list but only with readme. Any config tabs are hidden from the plugin page. Also plugin panel does not show action buttons (like Enable) for non admins.
2019-07-25 16:54:26 +02:00
Torkel Ödegaard
43543d5682
DataLinks: Fixed interpolation of series name, fixes #18250 (#18251) 2019-07-24 20:40:41 +02:00
kay delaney
c01bbf2058 Timerange: Fixes a bug where custom time ranges didn't respect UTC (#18248)
Closes #18170
Closes #18178
2019-07-24 15:09:52 +02:00
David
459769af70
Loki: Remove prefetching of default label values (#18213) 2019-07-24 14:58:32 +02:00
kay delaney
6144c0f51d Revert "Timerange: Fixes a bug where custom time ranges didn't respect UTC (#18217)" (#18246)
This reverts commit 0752a09f92.
2019-07-24 12:29:12 +02:00
kay delaney
0752a09f92
Timerange: Fixes a bug where custom time ranges didn't respect UTC (#18217)
* Timerange: Fixes a bug where custom timeranges didn't respect UTC
Closes #18170
Closes #18178
2019-07-24 11:00:36 +01:00
David
9cd069f2c5
Graph: fix time label description for datalink suggestions (#18214) 2019-07-22 13:35:12 +02:00
David
7139544c76
Explore: Reduce default time range to last hour (#18212) 2019-07-22 13:34:10 +02:00
Raphael Couto
bc0da1bbfc Plugin: AzureMonitor - Reapply MetricNamespace support (#17282)
* Reapply MetricNamespace support

* Fixing tests

* refactor: move metricnamespace param to backend

* refactor: remove unused function

* azuremonitor: migration for new metric namespace field

* azuremonitor: add template query for metric namespace with a sub

* docs: template queries for azure monitor

Adds new lines for the metricnamespace template function and fixes
some messed up lines
2019-07-20 01:43:52 +02:00
Ryan McKinley
9f415e84b4
Refactor: move end-to-end test infrastructure to @grafana/toolkit (#18012) 2019-07-19 08:13:12 -07:00
Ryan McKinley
06b43f6d4b
Plugins: avoid app importDashboards() NPE (#18128)
* tables display

* add missing file

* adding toolbar option

* adding toolbar option

* add items to index

* use root import path

* merge master

* show tables info

* add importDashboards code

* remove table changes

* remove table changes

* use deprecation warning
2019-07-19 07:11:16 -07:00
Kyle Brandt
7cac393ddc
datasource: testdata - add predicatable csv wave scenario (#18183) 2019-07-18 13:36:22 -04:00
David
c6d3ffce91
Panel: Show error in edit mode (#18175)
- the error was set, but has not been shown
- this change will force a digest before the query promises return with
their error handling
2019-07-18 16:09:04 +02:00
David
fb21492eae
E2E: saving a dashboard should wait for success (#18171)
- navigating right away triggered the unsaved warning on slower machines
- this change makes sure we see a success message first
2019-07-18 15:36:03 +02:00
Tobias Skarhed
c8498461a5 noImplicitAny: Down approx 200 errors (#18143)
* noImplicitAny playlist approx 200

* Add AngularPanelMenuItem interface

* Roughly 100 noImplicitAny
2019-07-18 08:03:04 +02:00
Kyle Brandt
ed099d5ca0
datasource: testdata - add predictable pulse scenario (#18142)
Adds pulse waveform. Is predictable in the sense that the start of the waveform is aligned to epoch time (instead of the start of the query time). This makes a useful signal for manual testing of alerting in the devenv.
2019-07-17 15:48:08 -04:00
Ryan McKinley
c194ae1ba5
Registry: add a reusable function registry (#17047) 2019-07-16 11:40:23 -07:00
Tobias Skarhed
0ef4060b98
Chore: Fix about 200 noImplicitAny errors (#18067)
* Fix 200 ish errors

* Add interface
2019-07-16 11:35:42 +02:00
Ryan McKinley
14caa6a068
FieldDisplay: move threshold and mapping to Field (#17043) 2019-07-12 08:32:39 -07:00
kvc-code
acc678c309 InfluxDB: Enable interpolation within ad-hoc filter values for InfluxDB data source (#18077) 2019-07-12 17:05:55 +02:00
Tobias Skarhed
e1cec1069c noImplicitAny: 1670 errors (#18035)
* Sub 2000 errors

* Down to 1670 errors

* Minor fixes
2019-07-11 17:05:45 +02:00
kay delaney
bf7fb67f73
Explore/Loki: Display live tailed logs in correct order (#18031)
Closes #18027
2019-07-10 13:57:23 +01:00
Alexander Zobnin
5f0a7f43c3
Users: show badges for each auth provider (#17869)
* Users: show badges for each auth provider

* Chore: don't use functions in angular bindings

* Users: minor style changes to labels

* Chore: convert auth labels on the backed side, deduplicate frontend code

* Users: use authLabels everywhere instead of authModule

* User: fix edit user page style

* Users: minor fixes after review
2019-07-10 12:06:51 +03:00
Damien Lespiau
ebff883016 Loki: Don't use _ numerical separator (#18016)
It breaks the build on a fresh checkout and install.

Fixes: #18015
2019-07-10 11:03:06 +02:00
Ryan McKinley
6599bdc7f1
AnnoList: add alpha annotations list plugin (#17187)
adding an alpha panel
2019-07-09 09:28:19 -07:00
Tobias Skarhed
9e87dbb153
CSV Export: Timezone based on dashboard setting (#18002)
* Timezone export CSV based on dashboard setting

* Add options object and interface
2019-07-09 16:16:46 +02:00
gotjosh
332920954e
SAML: Show SAML login button even if OAuth is disabled (#17993)
* Move the SAML button outside of the oauth div
* Don't attempt to search cookies with an empty name
2019-07-09 10:15:52 +01:00
Ryan McKinley
66a4d1a57e
Refactor: fix range util imports (#17988) 2019-07-08 10:12:02 -07:00
Ryan McKinley
ccc3d88cee
Refactor: move dom utils to @grafana/ui (#17976) 2019-07-08 10:02:16 -07:00
Martin Chodur
c284a11a95 Prometheus: added time range filter to series labels query (#16851)
* fix datasource/prometheus: added time range filter to prom series labels

* fix datasource/prometheus: added missing method to test mock
2019-07-08 17:48:09 +02:00
kay delaney
246358344c
Explore: Adds support for new loki 'start' and 'end' params for labels endpoint (#17512)
* Explore: Adds support for new loki 'start' and 'end' params for labels endpoint
Also initializes absoluteRange when explore is initialized
Closes #16788

* Explore: Dispatches updateTimeRangeAction instead of passing absoluteRange when initializing
Also removes dependency on sinon from loki language provider test

* Loki: Refactors transformation of absolute time range to URL params into small utility function

* Makes use of rangeToParams() util function in loki language provider test
Also updates LanguageProvider.request() interface so that url should be type string, and adds optional params argument
2019-07-08 16:14:48 +01:00
Ryan McKinley
8f5df80161 Chore: Removes custom debounce utility in favor of lodash/debounce (#17977) 2019-07-08 15:20:29 +01:00
Ryan McKinley
bdaf0aa81a
Refactor: move more files to @grafana/data (#17972) 2019-07-06 09:18:23 -07:00
Ryan McKinley
fcdc29746f
@grafana/data: export dateMath and rangeUtil (#17971) 2019-07-05 23:43:12 -07:00
Ryan McKinley
3f15170914 Refactor: move some files to @grafana/data (#17952)
* moving to data WIP

* more refactoring

* add missing test

* mock full path

* remove sinon from grafana-ui
2019-07-06 08:05:53 +02:00
Tobias Skarhed
baed5d7bd9 noImplicitAny: Azure Monitor (#17966) 2019-07-06 07:01:22 +02:00
Tobias Skarhed
88a2c6fce7 Graphite: Refactor lexer and parser (#17958) 2019-07-05 16:47:21 +02:00
Tobias Skarhed
9b468caea4 noImplicitAny: Datasource files, under 2500 (#17959)
* noImplicitAny on Graphite

* More noImplicitAny
2019-07-05 16:46:46 +02:00
Leonard Gram
e574147b1e Auth: SAML login button. (#17932)
* Auth: SAML login button.

* Fixed ts issue
2019-07-05 15:24:52 +02:00
Dominik Prokop
c5b6365858
grafana/toolkit: Add support for extensions styling (#17938)
* Add support for static files

* Use url-loader in single css setup

* Add postcss setup

* Expose emotion to plugins and externalise it in toolkit

* Add readme note about emotion
2019-07-05 13:33:42 +02:00
Tobias Skarhed
17b5f48cf6 Datasource: Refactor Graphite to class (#17942)
* Rewrite Graphite Datasources to class

* Graphite: removed unused prop
2019-07-05 13:26:14 +02:00
Tobias Skarhed
418dba4b21 noImplicitAnys: Fix InfluxDB type issues #17937) 2019-07-05 07:52:23 +02:00
Torkel Ödegaard
de71875e6b
TimePicker: align position between dashboard and explore (#17940) 2019-07-05 07:49:45 +02:00
Daniel Lee
7e95ded164
AzureMonitor: remove duplicate query logic on the frontend (#17198)
* feat: AzureMonitor implements legend key on backend

To be able to remove the duplicated query logic on the
frontend, the backend code needs to implement alias
patterns for legend keys as well as allowing the default
list of allowed time grains to be overridden. Some metrics
do not support all the time grains and the auto timegrain
calculation can be incorrect if the list is not overridden.

* feat: AzureMonitor - removes duplicate query logic on frontend

* AzureMonitor small refactoring

Extracted method and tidied up the auto time grain
code.

* azuremonitor: support for auto time grains for alerting

Converts allowed timegrains into ms and saves in dashboard json.
This makes queries for alerting with an auto time grain work in
the same way as the frontend.

* chore: typings -> implicitAny count down to 3413

* azuremonitor: add more typings
2019-07-04 22:47:24 +02:00
Tobias Skarhed
55b63905ea UserProfilePage: Fix team avatar urls #17866 (#17930) 2019-07-04 16:54:44 +02:00
kay delaney
d4e9a8c009
Explore: Introduces storage keys for last used data source on per-orgId basis (#17934)
* Explore: Introduces storage keys for last used data source on per-orgId basis
Closes #17903
2019-07-04 15:31:15 +01:00
kay delaney
3a18098760 Explore: Restricts query text edit toggle to metrics mode (#17921)
* Explore: Adds datasource plugin config option 'modesSupportingTextEdit'
This allows one to specify which modes support toggling query text edit on and off
Closes #17904

* Explore: Restricts query text edit toggle to metrics mode
2019-07-04 14:10:44 +02:00
Dominik Prokop
cf37b5439f
grafana/runtime: Expose SystemJS from @grafana/runtime (#17927)
In 4281344 the loadPluginCss util was migrated to @grafana/runtime package. This made SystemJS to fail loading the css files for a plugin. Root cause was that core and runtime used different SystemJS instances.

To solve the issue, I am exposing SystemJS from @grafana/runtime package to make sure we are always using the same instance. Also, the SystemJS dependency was moved to runtime.
2019-07-04 13:32:09 +02:00
Eduard Sergeev
19ae5351fb Templating: Correctly display __text in multi-values variable after refresh (#17918)
Fixes: #17915 - Templating: __value's are displayed instead of __text's after variable is updated
2019-07-04 08:34:42 +02:00
Dominik Prokop
9f351156c3 grafana/toolkit: bundle plugins with webpack (#17850) 2019-07-03 09:25:12 -07:00
kay delaney
164fb13d99
Explore: Adds orgId to URL for sharing purposes (#17895)
Also replaces one-off segment detection functions in explore.ts with general purpose function
Closes #15462
2019-07-03 16:36:12 +01:00
Shavonn Brown
874b8abcc0 ChangePassword: Rewrite change password page to react (#17811)
* ChangePassword to React, created PasswordInput component, attempting UserProvider wrapper component, adding flex to btn row

* UserAPI interface, force classes on PasswordInput, remove api call from ChangePassword

* refactored out form

* clean up

* removed unnecessary bind, added loading state and loading component to change password form

* should be OR

* arrow funcs instead of binds, inline-block instead of flex, isSaving instead of isLoading, disabled button instead of spinner

* inline-flex on the react btn

* change state instatiatiation
2019-07-03 17:02:11 +02:00
Torkel Ödegaard
b1126cb0ed
AngularPanels: Fixed loading state indication for angular panels (#17900) 2019-07-03 16:58:38 +02:00
kay delaney
98147fd52b
Explore: Adds support for toggling text edit mode in explore (#17870)
* Explore: Adds support for toggling text edit mode in explore
Also modifies query-row-status css to use relative position instead of absolute
Closes #16770

* Explore: Defines State interface for <QueryRow /> and removes unnecessary constructor
2019-07-03 15:42:03 +01:00
kay delaney
1c291e26f8
Loki: Adds comment explaining usage of RFC3339Nano string (#17872)
* Loki: Adds comment explaining usage of RFC3339Nano string
2019-07-03 13:54:06 +01:00
kay delaney
b06ad02a74
Explore: Query rows are now reset when changing data sources (#17865)
Except when those data sources are compatible, via query import.
Closes #17861
2019-07-03 13:49:47 +01:00
kay delaney
364f1f2e55
Explore: Log highlights only update when user stops typing (#17845)
Reverts performance enhancements made to LogsContainer as they are no
longer needed, and complicated things.
Closes #17818
2019-07-02 09:06:21 +01:00
kay delaney
0a1bb97a2f
Loki: getHighlighterExpressionsFromQuery Returns null if filter term is not quoted (#17852)
Closes #17687
2019-07-02 09:06:04 +01:00
Ryan McKinley
e7c3d0ed97
Refactor: rename SeriesData to DataFrame (#17854) 2019-07-01 12:00:29 -07:00
Tobias Skarhed
4e27ba9646 noImplicitAny: Sub 3000 errors (#17821)
* noImplicitAny Stackdriver

* Sub 3000 noImplicitAny

* Update error count limit

* Add DataQueryRequest type
2019-07-01 11:11:57 +02:00
Torkel Ödegaard
bd4a7ddf3a
TimePicker: Style and responsive fixes, restored dashboard settings (#17822)
* TimePicker: Restore time picker settings

* CleanUp: removed unuused angular-ui (calendar) components

* Fix angular boot dependency list

* TimePicker: set time to 23:59:00 when setting To time using calendar
2019-07-01 10:16:33 +02:00
Eduard Sergeev
d94bdb930f Templating: Correctly display __text in multi-values variable (#17840)
Fixes #17839: __value is displayed instead of __text when single item is selected
2019-07-01 09:42:36 +02:00
Marcus Efraimsson
0833f26b43
Elasticsearch: Fix default max concurrent shard requests (#17770)
Elasticsearch v7.0 changed the behavior of max concurrent shard
requests and the default to 5. v5.6 and before 7.0 the default
is 256. This adds some additional behavior given certain
version is selected when configure the datasource to set
default max concurrent shard requests.
Changing from a version pre-v7.0+ to v7.0+ sets max
concurrent shard requests to 5.
Changing from a version v7.0+ to a pre-v7.0 sets max
concurrent shard requests to 256.

Fixes #17454
2019-06-28 18:38:16 +02:00
Marcus Efraimsson
53db823511
Explore: Fix filter by series level in logs graph (#17798)
Adds back support for filtering log messages by series level 
in logs graph which seem to have been broken since merging
of #17027.

Fixes #17769
2019-06-28 17:05:59 +02:00
Sofia Papagiannaki
d9fea07e6e
Graphite: use POST for /metrics/find requests (#17814)
* Add test that expects a POST request

* Change graphite /metric/find request to POST

Query parameter can become large enough
to exceed GET URI limits.

* Fix requests with time range

Initialise httpOptions.params

* Fix for supporting queries referencing template variable
2019-06-28 16:21:32 +03:00
Ryan McKinley
70d4dfe9f7 Dashboard: Force update after dashboard resize (#17808) 2019-06-28 14:25:38 +02:00
Hugo Häggmark
ead4b1f5c7
Explore: Uses new TimePicker from Grafana/UI (#17793)
* Wip: Intiail commit

* Refactor: Replaces TimePicker in Explore

* Refactor: Removes Angular TimePicker folder

* Refactor: Adds tests for getShiftedTimeRange

* Fix: Fixes invalid import to removed TimePicker

* Fix: Fixes dateTime tests

* Refactor: Reuses getShiftedTimeRange for both Explore and Dashboards

* Refactor: Shares getZoomedTimeRange between Explore and Dashboard
2019-06-28 12:07:55 +02:00
Hugo Häggmark
2379de53c4
Explore: Uses RFC3339Nano string to retrieve LogRow contexts from Loki API (#17813)
* Refactor: Uses nanosecond string to retreive LogRow contexts

* Reafactor: Small changes to comments after PR comments
2019-06-28 10:47:19 +02:00
Tobias Skarhed
0b9de3f761 noImplicitAny: Lower count to about 3450 (#17799) 2019-06-27 15:56:02 +02:00
Torkel Ödegaard
8fcc370fe9
Graphite: Fixes issue with seriesByTag & function with variable param (#17795)
Fixes #17696
2019-06-27 14:10:43 +02:00
Tobias Skarhed
3045daedbd noImplicitAny: Reduce errors to 3800-ish (#17781)
* Reduce noImplicitAny errors to 3900-ish

* Fix lots of errors

* Add interface
2019-06-27 13:21:04 +02:00
Torkel Ödegaard
013a1abb6f
Graphite: remove feature that moves alias function last (#17791) 2019-06-27 11:16:11 +02:00
kay delaney
5f3a71bc7a Explore: Adds URL support for select mode (#17755)
Adds URL support for mode state (Metrics/Logs). It's important 
to be able to share a link to logs when a data source supports 
both metrics and logs.

Closes #17101
2019-06-27 11:11:49 +02:00
Ryan McKinley
021f5351fa TestData: add option to increase the number of test streams (#17789)
* variable number of points

* add variable number of bands
2019-06-27 10:28:35 +02:00
Hugo Häggmark
7cac7435ce
Explore: Displays only one Time column as configured in TimeZone settings (#17775)
* Refactor: Removes switches for TimeStamp and LocalTime and displays time as configured for user

* Styles: Updates classname used to display timeUtc

* Refactor: Adds switch for Time column
2019-06-26 13:35:23 +02:00
Tobias Skarhed
8541214c9e
Markdown: Replace rendering library (#17686)
* Replace remarkable with marked

* Add wrapper and options for marked
2019-06-26 13:15:45 +02:00
Sofia Papagiannaki
6fb36e705f ApiKeys: Fix check for UTC timezone (#17776)
getTimeZone() no longer returns an object, but a string
2019-06-26 10:26:16 +02:00
Torkel Ödegaard
40e5c4f8ba
Prometheus: Minor style fix (#17773)
* Prometheus: Minor style fix

* Updated snapshot
2019-06-26 09:56:11 +02:00
Sofia Papagiannaki
dc9ec7dc91
Auth: Allow expiration of API keys (#17678)
* Modify backend to allow expiration of API Keys

* Add middleware test for expired api keys

* Modify frontend to enable expiration of API Keys

* Fix frontend tests

* Fix migration and add index for `expires` field

* Add api key tests for database access

* Substitude time.Now() by a mock for test usage

* Front-end modifications

* Change input label to `Time to live`
* Change input behavior to comply with the other similar
* Add tooltip

* Modify AddApiKey api call response

Expiration should be *time.Time instead of string

* Present expiration date in the selected timezone

* Use kbn for transforming intervals to seconds

* Use `assert` library for tests

* Frontend fixes

Add checks for empty/undefined/null values

* Change expires column from datetime to integer

* Restrict api key duration input

It should be interval not number

* AddApiKey must complain if SecondsToLive is negative

* Declare ErrInvalidApiKeyExpiration

* Move configuration to auth section

* Update docs

* Eliminate alias for models in modified files

* Omit expiration from api response if empty

* Eliminate Goconvey from test file

* Fix test

Do not sleep, use mocked timeNow() instead

* Remove index for expires from api_key table

The index should be anyway on both org_id and expires fields.
However this commit eliminates completely the index for now
since not many rows are expected to be in this table.

* Use getTimeZone function

* Minor change in api key listing

The frontend should display a message instead of empty string
if the key does not expire.
2019-06-26 09:47:03 +03:00
fxmiii
19185bd0af 17278 prometheus step align utc (#17477)
* Update datasource.ts

* Update datasource.test.ts

* utcOffset reverse

from moment docs, utcOffset "function returns the real offset from UTC, not the reverse offset"

* add utcOffset() to DateTime interface

method returns the UTC offset as a number of minutes

* Fixed test
2019-06-26 07:55:36 +02:00
Alexandre de Verteuil
4f1d495ba1 Fix typo s/Applicaiton/Application/ in error messages (#17765) 2019-06-25 20:59:58 +02:00
Alexander Zobnin
77375f3772 UserAdmin: UI for disabling users (#17333)
* Feat: initial disable user UI

* batch disable users

* batch revoke users tokens

* split batch disable user and revoke token

* API: get users with auth info and isExternal flag

* fix tests for batch disable users

* Disable users: show is user external or not

* Users: refactor /api/users/search endpoint

* Users: use alias for "user" table

* Chore: add BatchDisableUsers() to the bus

* Users: order user list by id explicitly

* Chore: switch back to /api/users/search endpoint

* Users: move disable button to user profile page

* Users: return AuthModule from /api/users/:id endpoint

* Users: do not return unused fields

* Users: mute auth badge for disabled users

* Users: move disable button to the user section

* Users: fix SearchUsers method after last changes

* User: return auth module as array for future purposes

* User: tests for SearchUsers()

* User: return only latest auth module in SearchUsers()

* User: fix JOIN, get only most recent auth module

* Users: fix ldap badge after backed changes

* Users: show tooltip for inactive disable/enable button

* Users: move delete button to edit user view

* Users: put deactivated badge on the user list

* Users: minor refactor

* Users: adjust deactivated badge style

* Minor design changes
2019-06-25 18:49:12 +02:00
Hugo Häggmark
2c5400c61e Explore: Parses and updates TimeSrv in one place in Explore (#17677)
* Wip: Adds timeEpic

* Refactor: Introduces absoluteRange in Explore state

* Refactor: Removes changeTime action

* Tests: Adds tests for timeEpic

* Refactor: Spells AbsoluteRange correctly
2019-06-25 13:44:19 +01:00
Tobias Skarhed
0904607eda Password: Remove PasswordStrength (#17750)
* Closes #17748

* Remove remaining occurences

* And the last one
2019-06-25 13:56:35 +02:00
Torkel Ödegaard
335cec07a5
Graph: Add data links feature (click on graph) (#17267)
* WIP: initial panel links editor

* WIP: Added dashboard migration to new panel drilldown link schema

* Make link_srv interpolate new variables

* Fix failing tests

* Drilldown: Add context menu to graph viz (#17284)

* Add simple context menu for adding graph annotations and showing drilldown links

* Close graph context menu when user start scrolling

* Move context menu component to grafana/ui

* Make graph context menu appear on click, use cmd/ctrl click for quick annotations

* Move graph context menu controller to separate file

* Drilldown: datapoint variables interpolation (#17328)

* Add simple context menu for adding graph annotations and showing drilldown links

* Close graph context menu when user start scrolling

* Move context menu component to grafana/ui

* Make graph context menu appear on click, use cmd/ctrl click for quick annotations

* Add util for absolute time range transformation

* Add series name and datapoint timestamp interpolation

* Rename drilldown link variables tot snake case, use const values instead of strings in tests

* Bring LinkSrv.getPanelLinkAnchorInfo for compatibility reasons and add deprecation warning

* Rename seriesLabel to seriesName

* Drilldown: use separate editors for panel and series links (#17355)

* Use correct target ini context menu links

* Rename PanelLinksEditor to DrilldownLinksEditor and mote it to grafana/ui

* Expose DrilldownLinksEditor as an angular directive

* Enable visualization specifix drilldown links

* Props interfaces rename

* Drilldown: Add variables suggestion and syntax highlighting for drilldown link editor (#17391)

* Add variables suggestion in drilldown link editor

* Enable prism

* Fix backspace not working

* Move slate value helpers to grafana/ui

* Add syntax higlighting for links input

* Rename drilldown link components to data links

* Add template variabe suggestions

* Bugfix

* Fix regexp not working in Firefox

* Display correct links in panel header corner

* bugfix

* bugfix

* Bugfix

* Context menu UI tweaks

* Use data link terminology instead of drilldown

* DataLinks: changed autocomplete syntax

* Use singular form for data link

* Use the same syntax higlighting for built-in and template variables in data links editor

* UI improvements to context menu

* UI review tweaks

* Tweak layout of data link editor

* Fix vertical spacing

* Remove data link header in context menu

* Remove pointer cursor from series label in context menu

* Fix variable selection on click

* DataLinks: migrations for old links

* Update docs about data links

* Use value time instead of time range when interpolating datapoint timestamp

* Remove not used util

* Update docs

* Moved icon a bit more down

* Interpolate value ts only when using __value_time variable

* Bring href property back to LinkModel

* Add any type annotations

* Fix TS error on slate's Value type

* minor changes
2019-06-25 11:38:51 +02:00
kay delaney
cbe057fce8
Explore: Changes LogsContainer from a PureComponent to a Component (#17741) 2019-06-25 09:10:20 +01:00
Tobias Skarhed
1b17b7893f noImplicitAny: time region manager etc. (#17729)
* Fix errors

* Wrong branch

* minor type fix
2019-06-25 09:49:31 +02:00
Tobias Skarhed
75c29566a6 Panel: Fully escape html in drilldown links (was only sanitized before) (#17731)
* Sanitize HTML

* Replace sanitization lib and check for config

* Add htmlToText

* Refactor: Renaming htmlToText to escapeHtml
2019-06-25 09:06:28 +02:00
Marcus Efraimsson
5713048f48
Alerting: Improve alert rule testing (#16286)
* tsdb: add support for setting debug flag of tsdb query

* alerting: adds debug flag in eval context

Debug flag is set when testing an alert rule and this debug
flag is used to return more debug information in test aler rule
response. This debug flag is also provided to tsdb queries so
datasources can optionally add support for returning additional
debug data

* alerting: improve test alert rule ui

Adds buttons for expand/collapse json and copy json to clipboard,
very similar to how the query inspector works.

* elasticsearch: implement support for tsdb query debug flag

* elasticsearch: embedding client response in struct

* alerting: return proper query model when testing rule
2019-06-25 08:52:17 +02:00
Marcus Efraimsson
eecd8d1064 Elasticsearch: Visualize logs in Explore (#17605)
* explore: try to use existing mode when switching datasource

* elasticsearch: initial explore logs support

* Elasticsearch: Adds ElasticsearchOptions type
Updates tests accordingly

* Elasticsearch: Adds typing to query method

* Elasticsearch: Makes maxConcurrentShardRequests optional

* Explore: Allows empty query for elasticsearch datasource

* Elasticsearch: Unifies ElasticsearchQuery interface definition
Removes check for context === 'explore'

* Elasticsearch: Removes context property from ElasticsearchQuery interface
Adds field property
Removes metricAggs property
Adds typing to metrics property

* Elasticsearch: Runs default 'empty' query when 'clear all' button is pressed

* Elasticsearch: Removes index property from ElasticsearchOptions interface

* Elasticsearch: Removes commented code from ElasticsearchQueryField.tsx

* Elasticsearch: Adds comment warning usage of for...in to elastic_response.ts

* Elasticsearch: adds tests related to log queries
2019-06-24 21:15:03 +01:00
Johannes Schill
0412a28d2e TimePicker: New time picker dropdown & custom range UI (#16811)
* feat: Add new picker to DashNavTimeControls

* chore: noImplicitAny limit reached

* chore: noImplicityAny fix

* chore: Add momentUtc helper to avoid the isUtc conditionals

* chore: Move getRaw from Explore's time picker to grafana/ui utils and rename to getRawRange

* feat: Use helper functions to convert utc to browser time

* fix: Dont Select current value when pressing tab when using Time Picker

* fix: Add tabIndex to time range inputs so tab works smoothly and prevent mouseDown event to propagate to react-select

* fix: Add spacing to custom range labels

* fix: Updated snapshot

* fix: Re-adding getRaw() temporary to fix the build

* fix: Disable scroll event in Popper when we're using the TimePicker so the popup wont "follow" the menu

* fix: Move all "Last xxxx" quick ranges to the menu and show a "UTC" text when applicable

* fix: Add zoom functionality

* feat: Add logic to mark selected option as active

* fix: Add tooltip to zoom button

* fix: lint fix after rebase

* chore: Remove old time picker from DashNav

* TimePicker: minor design update

* chore: Move all time picker quick ranges to the menu

* fix: Remove the popover border-right, since the quick ranges are gone

* chore: Remove function not in use

* Fix: Close time picker on resize event

* Fix: Remove border bottom

* Fix: Use fa icons on prev/next arrows

* Fix: Pass ref from TimePicker to TimePickerOptionGroup so the popover will align as it should

* Fix: time picker ui adjustments to get better touch area on buttons

* Fix: Dont increase line height on large screens

* TimePicker: style updates

* Fix: Add more prominent colors for selected dates and fade out dates in previous/next month

* TimePicker: style updates2

* TimePicker: Big refactorings and style changes

* Removed use of Popper not sure we need that here?
* Made active selected item in the list have the "selected" checkmark
* Changed design of popover
* Changed design of and implementation of the Custom selection in the dropdown it did not feel like a item you
could select like the rest now the list is just a normal list

* TimePicker: Refactoring & style changes

* TimePicker: use same date format everywhere

* TimePicker: Calendar style updates

* TimePicker: fixed unit test

* fixed unit test

* TimeZone: refactoring time zone type

* TimePicker: refactoring

* TimePicker: finally to UTC to work

* TimePicker: better way to handle calendar utc dates

* TimePicker: Fixed tooltip issues

* Updated snapshot

* TimePicker: moved tooltip from DashNavControls into TimePicker
2019-06-24 14:39:59 +02:00
David
4ddeb94f52 Dashboard: Use Explore's Prometheus editor in dashboard panel edit (#15364)
* WIP prometheus editor same in panel

* Dont use panel in plugin editors

* prettiered modified files

* Fix step in external link

* Prevent exiting edit mode when slate suggestions are shown

* Blur behavior and $__interval variable

* Remove unused query controller

* Basic render test

* Chore: Fixes blacklisted import

* Refactor: Adds correct start and end time
2019-06-24 08:42:08 +02:00
Tobias Skarhed
219d711597 noImplicitAny: slate (#17681)
* Update slate types

* Fix noImplicitAny
2019-06-20 20:41:01 +02:00
kay delaney
57dadebbd8
Explore: Improves performance of Logs element by limiting re-rendering (#17685)
* Explore: Improves performance of Logs element by limiting re-rendering
Re-renders only when query has finished executing or when deduplication
strategy changes.
Closes #17663

* Explore: Adds logsHighlighterExpressions as prop to consider when re-rendering Logs
2019-06-20 12:56:47 +01:00
Ryan McKinley
428134482d
@grafana/runtime: expose config and loadPluginCss (#17655)
* move config to grafana runtime

* set defaults

* defaults in constructor

* use @types/systemjs

* rename Settings to GrafanaBootConfig
2019-06-19 11:31:47 -07:00
Tobias Skarhed
c9ad411d8e noImplicitAny: Fix basic errors (#17668)
* Fix basic noImplicitAny errors

* noImplicitAny HeatmapCtrl

* Update error limit
2019-06-19 19:59:03 +02:00
Tobias Skarhed
17826796da
Chore: Fix noImplicitAny issues (#17636)
* noImplicitAny: TableRenderer

* noImplicitAny and add types

* HeatmapData interface

* Heatmap rendering

* Fix optional type

* Remove use of lodash
2019-06-19 13:40:42 +02:00
Tobias Skarhed
7eb820081d AddPanel: Fix issue when removing moved add panel widget (#17659)
* Fixes #17592

* Remove console.log
2019-06-19 13:12:04 +02:00
Ryan McKinley
35e1524b02
TablePanel: fix annotations display (#17646) 2019-06-18 11:56:09 -07:00
Ryan McKinley
401615847c
Build: add @grafana/data package (#17436)
first step in moving non-ui components to their own package
2019-06-18 08:17:27 -07:00
kay delaney
477d5643b6
Explore: Prometheus query errors now show (#17470)
* Explore: Prometheus query errors now show
Fixes: #17435

* Explore: Adds test to ensure prometheus query errors are reported

* Explore: removes implicit anys introduced previously
2019-06-18 11:07:09 +01:00
Tobias Skarhed
8b8f2c4540 noImplicitAny: SingleStat panel (#17616)
* noImplicitAny on Singlestat

* Lower threshold

* Fix fixes
2019-06-18 11:44:17 +02:00
Hugo Häggmark
3424b64299
Typescript: Removes implicit anys (#17625)
* Chore: Remove implicit anys from ResultProcessor and tests

* Chore: Removes implicit anys for /loki/**/*.ts

* Chore: Removes implicit anys for prometheus/**/*
2019-06-18 11:01:12 +02:00
kay delaney
d6ee96ee64
Explore: Removes minus button in adhoc query field (#17573)
Closes #17571
2019-06-18 09:48:32 +01:00
srid12
b950eebf99 JsonTree: fix jsonTree angular binding (#17608)
The API changed so it expects a numeric level rather than a boolean flag.  Since 6.1 plugins using jsonTree just show an empty div
2019-06-17 15:10:56 -07:00
Tobias Skarhed
6de75de755
Refactor buttons (#17611) 2019-06-17 16:15:49 +02:00
Hugo Häggmark
8192fa538e
Tests: Replaces e2e tests truth screenshot (#17609) 2019-06-17 13:41:29 +02:00
Martin Brenner
aa1f9cdd40 AppPlugin: Fix load legacy plugin app (#17574)
* first init meta befor set legacy components

* add load legacy app test

* AppPlugin: minor refactor
2019-06-15 08:26:31 +02:00
Tobias Skarhed
8ffef57178 Typescript: A batch of implicit any fixes (#17590)
* Reduce noImplicitAny errors

* Lower err count

* Static version

* Fix noImplicitAny

* Table: moved type file
2019-06-15 08:25:33 +02:00
Hugo Häggmark
51c6b50582
Explore: Tag and Values for Influx are filtered by the selected measurement (#17539)
* Fix: Filters Tags and Values depending on options passed
Fixes: #17507

* Fix: Makes sure options is not undefined

* Fix: Fixes tests and small button refactor

* Chore: PR comments
2019-06-14 10:13:06 +02:00
Torkel Ödegaard
2c5c333858
Graph: Added new fill gradient option (#17528)
* Graph: Added new fill gradient option

* Graph: changed gradient area fill option, added test dashboard
2019-06-13 20:06:04 +02:00
Tobias Skarhed
375dc333f2 Typescript: Reduce implicit any errors (#17550)
* Fix types on linkSrv

* Lower err count, shoot down some errs, add type pkg

* Fix changes and add test

* Update public/app/features/panel/panel_ctrl.ts

Co-Authored-By: Hugo Häggmark <hugo.haggmark@gmail.com>

* Update public/app/features/panel/panel_ctrl.ts

Co-Authored-By: Hugo Häggmark <hugo.haggmark@gmail.com>

* Update public/app/features/panel/panellinks/link_srv.ts

Co-Authored-By: Hugo Häggmark <hugo.haggmark@gmail.com>

* Update public/app/features/panel/panel_ctrl.ts

Co-Authored-By: Hugo Häggmark <hugo.haggmark@gmail.com>

* Fix last types to compile

* Fix formatting issue

* Update public/app/features/panel/panel_ctrl.ts

Co-Authored-By: Hugo Häggmark <hugo.haggmark@gmail.com>
2019-06-13 20:04:15 +02:00
Daniele Ruggieri
74829f4898 SinglestatPanel: Manages when getColorForValue() function returns null value. Closes #9747 (#17552) 2019-06-13 20:00:13 +02:00
Dave
c78b6e2a67 Elasticsearch: Fix empty query request to send properly (#17488)
* ensure that empty Elasticsearch queries are properly set to *.  Fixes issue that appears when passing raw data from variables.

* combine null check and empty check into one
2019-06-13 15:45:31 +02:00
☃ pitr
a2370a379d SinglestatPanel: fix min/max config in singlestat sparklines (#17543) 2019-06-13 15:43:42 +02:00
kay delaney
e11edf3fc2
Explore: Includes context parameter when invoking getExploreState() from Prometheus datasource (#17569)
Closes #17457
2019-06-13 14:14:09 +01:00
Hugo Häggmark
c59f308414
Tests: Replaces truth image (#17570) 2019-06-13 14:45:15 +02:00
Hugo Häggmark
fabc6f4241
Fix: Fixes merge conflict (#17568) 2019-06-13 12:46:10 +02:00
Hugo Häggmark
9e9fdb9cf1
Build: Fix failing e2e tests and implicit any check (#17567)
* Tests: Updates truth screen shot

* Fix: Fixes an implicit any error
2019-06-13 12:37:18 +02:00
kay delaney
d612beec25
Explore: Fixes implicit any error in AdHocFilterField.test.tsx (#17565) 2019-06-13 11:28:03 +01:00
kay delaney
6170a039e5
Explore: Adds ability to remove filter from <AdHocFilterField /> key dropdown (#17553)
Also adds tests to validate behaviour
Query now reruns when filter is removed
Changes <AdHocFilterField /> such that after a measurement and field have been chosen,
just a '+' button is displayed, rather than an empty <AdHocFilter />

Closes #17544
Closes #17497
2019-06-13 10:00:53 +01:00
Marcus Efraimsson
d168057fc6
Influx: Reset logs query field on clear all and clear row in explore (#17549)
Resets influx logs query field when hitting clear all and clear row 
in explore logs mode.

Fixes #17506
2019-06-12 17:27:13 +02:00
kay delaney
0a3af385e1
Explore: Runs query when measurement/field and pairs are selected in logs mode for influx (#17523)
* Explore: Runs query when measurement/field and pairs are select in logs mode for influx
Closes #17500

* Explore: Modifies logic determining when to auto-run query during influx logs mode
Also adds test to validate this logic
2019-06-12 14:14:39 +01:00
kay delaney
2a47c315df
Influx: Adds start page for logs in Explore (#17521)
* Influx: Adds start page for logs in Explore
Closes #17499

* Influx: Rebased with master and removed conditional display of cheat sheet in explore
Cheat sheet now displays during both Metrics and Logs mode, though this is only
temporary.
2019-06-12 14:01:48 +01:00
☃ pitr
3e64214338 Singlestat: Add y min/max config to singlestat sparklines (#17527)
* Add scaling toggle to Singlestat panel

This toggle allows a user to choose between auto scaling or
zero-based scaling.

* Update Singlestat docs to include Zero Scale option

* Add min/max config to Singlestat sparklines y axis
2019-06-11 21:39:09 +02:00
Marcus Efraimsson
fcd2fb8b04
Explore: Clear queries when switching between metrics and logs (#17505)
This will clear the existing queries when switching between metrics and logs. 

Closes #17496
2019-06-11 16:18:33 +02:00
Shavonn Brown
40f95a95c0
16223 user auth token list and revoke (#17434)
* Start user auth token list on user profile (#16223)

* Now session found and first, better os regex (#16223)

* Revoke for user and admin user token manage (#16223)

* Tidying and styling (#16223)

* Tidying and styling (#16223)

* Update to use #16222 (#16223)

* Update for changes to 16222

* update per api issue
2019-06-11 14:23:54 +02:00
Hugo Häggmark
20f81539b8
Tests: Adds better logging to e2e tests (#17511) 2019-06-11 11:41:11 +02:00
Hugo Häggmark
591ea0bfe3
Explore: Adds LogQueryField for InfluxDb (#17450)
* Wip: Intial commit

* Wip: Adds intial InfluxLogsQueryField

* Refactor: Adds measurements to InfluxLogQueryField

* Style: Tweaks styles and adds chosen measurement to measurements

* Refactor: Adds remove filter row

* refactor: make influx datasource typed

Uses the new api for exporting the plugin.

* adds metricFindQuery to DataSourceApi

metricFindQuery, getTagKeys and getTagValues now returns a promise

* influx: minor improvements

Limits logs result to 1000.
Don't show adhoc filter until measurement have been selected.

* Refactor: Adds fields to Cascader and uses chosen field as log column

Co-authored-by: Marcus <marcus.efraimsson@gmail.com>
2019-06-10 14:39:53 +02:00
rrFeng
c31b939e10 Explore: Handle newlines in LogRow Highlighter (#17425) 2019-06-06 13:55:04 +02:00
Thibault Chataigner
e06abb30aa Alerting: Add tags to alert rules (#10989)
Ref #6552
2019-06-06 13:29:30 +02:00
Patrick Hahn
606825703f Prometheus: Use overridden panel range as $_range instead of dashboard range (#17352)
The range variables get filled with the range from the query options,
not with the range in the timeSrv object. This means that panels that
use a relative time override get the correct values from the __range
variables.

Fixes #17102
2019-06-06 10:03:14 +02:00
Torkel Ödegaard
ad744beb60
NavModel: Fixed page header ui tabs issues for some admin pages (#17444) 2019-06-05 15:18:31 +02:00
Torkel Ödegaard
de7856cf93 PluginConfig: Fixed plugin config page navigation when using subpath (#17364) 2019-06-05 13:24:48 +02:00
Ryan McKinley
574a37e46f
@grafana/runtime: expose location update (#17428) 2019-06-04 16:20:55 +02:00
Hugo Häggmark
10a4a89902
Fix: Adds context to list of keys that are not part of query (#17423)
Fixes: #17408
2019-06-04 14:07:25 +02:00
Charlie Briggs
8ef961bba5 Prometheus: Correctly escape '|' literals in interpolated PromQL variables (#16932)
This escape is currently not happening which breaks multi-value queries with
'|' characters in the variable value.

Added tests for 'interpolateQueryExpr' which should possibly be private, but is difficult to
test due to TemplateSrv calling it.

Closes #16840
2019-06-04 13:07:39 +02:00
Marcus Efraimsson
d1ab29c36d Explore: Makes it possible to use a different query field per mode (#17395) 2019-06-04 12:35:16 +02:00
Ryan McKinley
1e76f1a728
DataSourceApi: remove ExploreDataSourceApi (#17424) 2019-06-04 10:30:07 +02:00
Ryan McKinley
4066c55298
Fix: change angular loader paths (#17421) 2019-06-04 09:19:55 +02:00
Ryan McKinley
96ba32d0c8
Add a @grafana/runtime package with backendSrv interface (#16533)
grafana-runtime/tsconfig.json imports query to avoid a build error  ¯\_(ツ)_/¯
2019-06-03 17:55:59 +02:00
Hugo Häggmark
fb39831df2
Explore: Queries the datasource once per run query and uses DataStreamObserver (#17263)
* Refactor: Removes replaceUrl from actions

* Refactor: Moves saveState thunk to epic

* Refactor: Moves thunks to epics

* Wip: removes resulttype and queries once

* Refactor: LiveTailing uses observer in query

* Refactor: Creates epics folder for epics and move back actioncreators

* Tests: Adds tests for epics and reducer

* Fix: Checks for undefined as well

* Refactor: Cleans up previous live tailing implementation

* Chore: merge with master

* Fix: Fixes url issuses and prom graph in Panels

* Refactor: Removes supportsStreaming and adds sockets to DataSourcePluginMeta instead

* Refactor: Changes the way we create TimeSeries

* Refactor: Renames sockets to streaming

* Refactor: Changes the way Explore does incremental updates

* Refactor: Removes unused method

* Refactor: Adds back Loading indication
2019-06-03 14:54:32 +02:00
Hugo Häggmark
5761179ad9
Feature: Adds redux action logging toggle from url params (#17368)
With live tailing introduced in Explore we now have a lot of actions dispatching and the Redux Dev Tools doesn't cope with the amount and rate of actions and crashes. This PR turns on redux action logging when you add logActions=true in the url and turns it off if you refresh the page or add logActions=false in the url.
2019-06-03 13:40:33 +02:00
Hugo Häggmark
20229a40eb
Build: Adds e2e tests back to master workflow with better error messages and with artifacts (#17374)
* Refactor: Adds better error message and removes chromium download progess

* Test: Adds e2e tests to pr builds for testing purpose

* Tests: Changes path to screenshots

* Tests: Adds failing test just to test message and artifacts

* Tests: Removes failing test
2019-06-03 13:39:36 +02:00
Marcus Efraimsson
4fe6eaa0f7
Explore: Handle datasources with long names better in ds picker (#17393) 2019-06-03 11:41:41 +02:00
Dieter Plaetinck
95012271ac Annotations: Improve annotation option tooltips (#17384)
* should be 'Tags' not 'All'
* fix poor wording in 'Match any' tooltip
* add tooltip for 'Tags' input (untested! and can probably be worded
  better, i just don't know enough about the implementation)
2019-06-03 11:32:35 +02:00
Matthias Steffen
936308366e InfluxDB: Fixes single quotes are not escaped (#17398)
Fixes #17397
2019-06-03 11:25:46 +02:00
Marcus Efraimsson
1497f3d79a
Chore: Remove unused properties in explore (#17359)
This removes unused properties in explore and datasource 
meta data (tables and explore properties in plugin.json).
2019-05-31 09:45:53 +02:00
Dan Cech
5e7537878e Security: Prevent csv formula injection attack (#17363)
* mitigate https://www.owasp.org/index.php/CSV_Injection

- prepend csv cell values that begin with -, +, = or @ with '
- trim trailing whitespace from all csv values

* test for csv formula injection mitigation
2019-05-30 07:07:19 +02:00
Marcus Efraimsson
e951e71843
Explore: Update time range before running queries (#17349)
This makes sure that refresh/update/run query are parsing a
relative time range to get proper epoch time range before
running queries.

Fixes #17322
2019-05-29 13:47:05 +02:00
Torkel Ödegaard
afbdfe7cb4
NewDataSourcePage: Add Grafana Cloud link (#17324)
* NewDataSource: adding initial grafana cloud link

* Minor update

* Updated
2019-05-29 09:37:29 +02:00
Joshua Piccari
5fa5d4bdd5 CloudWatch: Avoid exception while accessing results (#17283)
When accessing the `series` property of query results, if a query is
hidden, an exception is thrown. This is caused by lack of checks to
verify that the query result exists before accessing the `series`
property.

Closes #17112
2019-05-29 09:10:09 +02:00
Shavonn Brown
27874a1881 16365 change clashing variable names (#17140)
* Fix: change  and  to  and  so not clashing with grafana vars (#16365)

* Fix: change  and  to  and  so not clashing with grafana vars (#16365)

* Fix: update now to datetime (#16365)

* Fix: test should look for datetime instead of now (#16365)

* Fix: _az suffix to datasource convention (#16365)

* Fix: convert vars to macro, update doc (#16365)

* Fix: convert vars to macro, update doc (#16365)

* Fix: remove support for time vars (#16365)

* Fix: confilct from master

* add migration on editor open

* fix migration var name
2019-05-28 15:04:42 +02:00
Šimon Podlipský
4b0ad174ff Frontend/utils: Import has only from lodash (#17311) 2019-05-28 10:17:03 +02:00
Šimon Podlipský
83af1bdff3 Frontend/utils: Add missing type (#17312) 2019-05-28 10:13:49 +02:00
Marcus Efraimsson
a07296bf24
explore: don't parse log levels if provided by field or label (#17180)
If a field or a label named level is returned from datasource that is 
used as log level for the logs result instead of parsing the log level 
from the message.

Closes #17122
2019-05-27 18:43:04 +02:00
Hugo Häggmark
db32c7dcf5
Build: Enables end-to-end tests in build-master workflow (#17268)
* Fix: Adds back necessary aria-labels for e2e tests

* Build: Adds end-to-end-tests job to build-master workflow

* Build: Changes grafana image used
2019-05-27 12:22:43 +02:00
Torkel Ödegaard
6acc7d37da Singlestat: fixes issue with value placement and line wraps (#17249)
Fixes #17237
2019-05-24 08:52:47 +02:00
Utkarsh Bhatnagar
8e434ad163 CloudWatch: Made region visible for AWS Cloudwatch Expressions (#17243)
Fixes #14933
2019-05-23 12:02:19 +02:00
Filip Barl
a04bf0cded Panel: Pass transparency prop down to React panels. (#17235) 2019-05-23 11:58:50 +02:00
Ryan McKinley
9e7fa74682 DataSourcePlugin: Avoid anuglar injector if only one parameter (#17239) 2019-05-23 11:56:00 +02:00
Dominik Prokop
a9c94ec93b
Explore: Update the way Loki retrieve log context (#17204)
* Move log's typings into grafana/ui
* Update the way context is retrieved for Loki

Major changes:

1. getLogRowContext expects row to be of LogRowModel type
2. getLogRowContext accepts generic options object, specific to a datasource of interest. limit option has been removed, and now it's a part of Loki's context query options (see below)
3. LogRowContextProvider performs two queries now. Before, it was Loki ds that performed queries in both directions when getLogRowContext.
4. Loki's getLogRowContext accepts options object of a type:

interface LokiContextQueryOptions {
    direction?: 'BACKWARD' | 'FORWARD';
    limit?: number;
}

This will enable querying in either direction independently and also slightly simplifies the way query errors are handled.

LogRowContextProvider maps the results to a Loki specific context types, basically string[][], as raw log lines are displayed in first version.
2019-05-22 23:10:05 +02:00
Filip Barl
87688930a2 Panels: Show Drilldown links in top-left corner of custom React panels (#17142) 2019-05-22 14:21:43 +02:00
Torkel Ödegaard
e421723992
Search: removed old not working search shortcuts (#17226) 2019-05-22 12:23:30 +02:00
Daniel Lee
577beebcca
azuremonitor: revert to clearing chained dropdowns (#17212)
* azuremonitor: revert to clearing chained dropdowns

After feedback from users, changing back to clearing
dropdowns to the right in the chain. E.g. if the user
changes the subscription dropdown which is first in
the chain then all the dependent dropdowns to the right
should be cleared (reset to default values).

Also, now triggers getting subscriptions every time the
dropdown menu is shown rather than just the first time.
It is apparently common to add subscriptions while
building queries.
2019-05-22 11:34:54 +02:00
Torkel Ödegaard
a96b522a42
Search: changed how search filter on current folder works (#17219) 2019-05-22 11:28:11 +02:00
Ryan McKinley
1033f0f905 DataSourceMeta: add an option to get hidden queries (#17124)
* add an option to get hidden queries

* make sure you have meta

* supportsHiddenQueries

* remove spaces

* DataSources: hidden queries flag
2019-05-21 13:46:19 +02:00
Dominik Prokop
73e4178aef Panel: Apply option defaults on panel init and on save model retrieval (#17174)
* Apply panel options defaults on panel init and on save model retrieval

* Remove unnecessary argument, added tests

* Make FieldPropertiesEditor statefull to enable onBlur changes

* Remove unnecessary import

* Post-review updates

Fixes #17154
2019-05-21 13:19:19 +02:00
Daniel Lee
fa9ffe38d2
Azuremonitor: multiple subscription support for alerting (#17195)
* fix: azuremonitor adds multi-sub support to alerting

* fix: AzureMonitor missing parameter in metadata func

getMetricMetadata function when called in the query ctrl
was missing a parameter for Subscription Id.

Also, made some tweaks to what happens when a chained
dropdown is changed to not reset all the fields that
are dependent on it.
2019-05-21 12:28:30 +02:00
Ryan McKinley
744682e648 AppPlugin: add types for jsonData (#17177)
* add types for App jsonData

* add types for App jsonData

* add value as possible type

* make it extend {}
2019-05-21 10:39:29 +02:00
Marcus Efraimsson
5414a31101 explore: fix null checks (#17191) 2019-05-21 09:37:31 +02:00
Hugo Häggmark
3b35e9d5e8 Fix: Fixes so new data is pushed during live tailing (#17189)
Fixes: #17188
2019-05-21 09:34:41 +02:00
Marcus Efraimsson
3b008d06b4
testdata: logs scenario (#17182)
Adds logs scenario which is quite basic and not that smart 
to begin with. This will hopefully ease development of 
Explore and support for logs in Grafana.
2019-05-21 09:21:59 +02:00
Shavonn Brown
b695dcd0eb TablePanel: Check for table using keys (#17185)
* Fix: the type is not set so can check for columns and rows to validate is table (#16996)

* Fix: the type is not set so can check for columns and rows to validate is table (#16996)

* Fix: fix no table check and tests (#16996)
2019-05-21 08:56:34 +02:00
Ryan McKinley
7e3ac4ebde
AppPlugin: add an init function (#17150) 2019-05-20 13:05:23 -07:00
Hugo Häggmark
458bb3b0e3 Fix: Changes WebSocket protocol to wss:// for https (#17173) 2019-05-20 15:24:48 +02:00
Hugo Häggmark
db48ec1f08
Explore: Adds Live option for supported datasources (#17062)
* Wip: Initial commit

* Refactor: Adds support in Loki datasource for streaming

* Refactor: Adds Live option to RefreshInterval

* Refactor: Adds styles to logrows

* Style: Reverses the order of Explore layout on Live

* Refactor: Adds LiveLogs component

* Tests: Adds tests for epics

* Style: Adds animation to Live in RefreshPicker

* Refactor: Adds ElapsedTime and progress line to LiveLogs

* Style: Adds specific colors to each theme

* Refactor: Adds support for Lokis new API

* Fix: Adds null to resulting empty array

* Refactor: Limits the rate of incoming messages from websockets

* Refactor: Throttles messages instead for simplicity

* Refactor: Optimizes row processing performance

* Refactor: Adds stop live button

* Fix: Fixes so that RefreshPicker shows the correct value when called programmatically

* Refactor: Merges with master and removes a console.log

* Refactor: Sorts rows in correct order and fixes minor UI issues

* Refactor: Adds minor improvments to sorting and container size
2019-05-20 13:28:23 +02:00
Marcus Efraimsson
a564a54b13
chore: mocks plugin loader for DataSourceSettingsPage tests (#17157)
Properly mocks the plugin loader in DataSourceSettingsPage tests 
and by that removes console logs.
2019-05-20 11:41:22 +02:00
Marcus Efraimsson
0e210dc271
Explore: Fix selection/copy of log lines (#17121)
This adds some logic to identify if the user is selecting 
text and if so disables parsing of log messages on hover. 
This should resolve the issue of selecting log lines to be 
copied and the selection is truncated.

Fixes #17072
2019-05-20 09:51:57 +02:00
Marcus Efraimsson
2b32e768bd
Explore: Fix empty space in toolbar on smaller devices (#17110)
Removes the empty space in Explore toolbar when on mobile/tablet.

Co-Authored-By: Hugo Häggmark <hugo.haggmark@gmail.com>
2019-05-20 09:38:41 +02:00
Dominik Prokop
12e0616413
Explore: display log line context (#17097)
* Extend DataSourceAPI to enable log row context retrieval

* Add react-use package

* Display log row context in UI

* Make Loki datasource return "after" log context in correct order

* Don't show Load more context links  when there are no more new results

* Update getLogRowContext to return DataQueryResponse

* Use DataQueryResponse in log row context provider, filter out original row  being duplicated in context
2019-05-20 08:44:37 +02:00
Ryan McKinley
ae1df1cf89
Plugins: expose rxjs matching 6.4.0 (#17148)
* expose rxjs

* remove super old observable export
2019-05-18 08:31:25 -07:00
Marcus Efraimsson
1a80885180
explore: fix issues when loading and both graph/table are collapsed (#17113)
Removes the functionality of being able to collapse/expand the logs 
container.
When both graph and table are collapsed and you reload the page 
then the start page should not be displayed.
When both graph and table are collapsed and you reload the page 
then the graph and table panels should be displayed.
Fix so that reducer tests are run. On of the test used fit() instead of 
it() which had the consequence of only 1 reducer test was executed 
and the rest skipped. There was some failing tests that now is 
updated and now passes.

Fixes #17098
2019-05-17 12:45:11 +02:00
Marcus Efraimsson
32cdab4cbf
explore: make sure datasource is added to target (#17116)
Fixes a regression introduced in #16959 which removed datasource 
property from changed query for angular query editors having the 
result of loading explore URL's without datasource loaded the 
default query in query editor and Explore.

Ref #16808
2019-05-17 10:11:55 +02:00
Shavonn Brown
0a9863a8b4 GraphPanel: Don't sort series when legend table & sort column is not visible (#17095)
* Fix: if current sort key is not active column, do not use for sort and select next available active (#16980)

* Fix: only sort if sortkey is active column and table is active (#16980)

* Fix: sorting stacked series as legend. current descending order test (#16980)

* Fix: existing sort tests and added additional to prevent bug from resurfacing (#16980)
2019-05-16 21:16:05 +02:00
Johannes Schill
b11eeadbd9 fix: Initial url update in Explore should replace existing url history #17030 (#17061) 2019-05-16 11:02:21 +02:00
Marcus Efraimsson
e6001f57a2
Explore: Allow switching between metrics and logs (#16959)
Adds basic support for switching between Metrics and Logs in Explore. 
Currently only test datasource that supports both Metrics and Logs.
Summary of changes:
* Moves mode (Metric, Logs) selection to the left of datasource 
picker and add some quick styling.
* Only trigger change in ToggleButton if not selected
* Set correct mode if datasource only supports logs

Closes #16808
2019-05-16 09:52:22 +02:00
Hugo Häggmark
fdd421e24c Explore: Fixes filtering in Prometheus queries when clicking in Table (#17083)
Fixes: #17071
2019-05-15 11:43:27 +02:00
Ryan McKinley
d8280b895d InputDataSource: better empty value support (#17075) 2019-05-15 07:20:27 +02:00
Torkel Ödegaard
238a929262
Panels: Fixed alert icon position in panel header (#17070) 2019-05-14 18:47:35 +02:00
Ryan McKinley
a0b6ef4d01 GraphPanel: use SeriesData directly (skip legacy transformation) (#17037)
* support streaming in angular panels

* keep the same dashboard number

* skip the legacy data conversion

* fix tests
2019-05-14 18:43:26 +02:00
Ryan McKinley
7333f7ca17 Streaming: support streaming in MetricsPanelCtrl (#17034)
* support streaming in angular panels

* keep the same dashboard number
2019-05-14 17:47:41 +02:00
Torkel Ödegaard
68ad93f410
Gauge: Fix switching orientation issue when switching from BarGauge to Gauge (#17064) 2019-05-14 16:33:47 +02:00
Torkel Ödegaard
6c7224c74d
InfoPopover: Fixes transclude undefined error (#17063) 2019-05-14 15:28:09 +02:00