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.
* 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
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.
* 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
* 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
* 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
* 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
* 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
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.
* 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
* 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
* 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
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
* 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
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
* 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
* 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.
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* Explore: Prometheus query errors now show
Fixes: #17435
* Explore: Adds test to ensure prometheus query errors are reported
* Explore: removes implicit anys introduced previously
* Chore: Remove implicit anys from ResultProcessor and tests
* Chore: Removes implicit anys for /loki/**/*.ts
* Chore: Removes implicit anys for prometheus/**/*
* 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
* 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
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#17544Closes#17497
* 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
* 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.
* 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
* 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
* 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>
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
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
* 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
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.
* 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
* 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)
* 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
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
* 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
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
* 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.
* 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.
* 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
* 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.
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.
* 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)
* 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
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
* 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
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
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
* 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)
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