Fix encoded characters in URL path should be proxied as encoded in the data proxy.
Fixes#26870Fixes#31438
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* Chore: Collect elasticsearch version usage stats
* Fix lint error
* use GetDataSources from sqlstore
* Apply review suggestions
* Return error if datasource type is not specified
* Update pkg/services/sqlstore/datasource.go
* fix undefined var
* Add revoked_at field to user auth token to allow soft revokes
* Allow soft token revocations
* Update token revocations and tests
* Return error info on revokedTokenErr
* Override session cookie only when no revokedErr nor API request
* Display modal on revoked token error
* Feedback: Refactor TokenRevokedModal to FC
* Add GetUserRevokedTokens into UserTokenService
* Backendsrv: adds tests and refactors soft token path
* Apply feedback
* Write redirect cookie on token revoked error
* Update TokenRevokedModal style
* Return meaningful error info
* Some UI changes
* Update backend_srv tests
* Minor style fix on backend_srv tests
* Replace deprecated method usage to publish events
* Fix backend_srv tests
* Apply suggestions from code review
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
* Apply suggestions from code review
* Apply suggestions from code review
Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
* Minor style fix after PR suggestion commit
* Apply suggestions from code review
Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
* Prettier fixes
Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
* AlertingNG: base API implementation
* Pass the interface instead of the base impl
* Ruler mock draft (WIP)
* Update alerting-api dependency
* Improve mock implementation
* Tempo: Support opentelemetry response
* Tempo: convert Tempo to backend data source
* Update data source test
* Fix lint issues
* Apply suggestions from code review
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* Return error when trace not found
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
This is a translation of services/alerting/conditions. Main Changes:
- Work with types in SSE (series/number) which are data frames (no more null.Float).
- The query part from alerting/conditions is handled by SSE logic
- Convey / simplejson removed.
- Time range no longer part of "query" in the condition
* adding state to the payload
* fix test
* fix linter
* documentation payload current state
* Apply suggestions from code review
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
* Refactor: adds version column and fixes tests
* Chore: adds version check when patching the library panel
* Refactor: adds support for version in FrontEnd
* Make sure Metric field in Discord notification is never empty
Discord uniquely does not send the alert if the metric field is empty, which can happen in some cases, such as when the legend is {{hostname}}.
Signed-off-by: Levi Harrison <levisamuelharrison@gmail.com>
* Changed name of empty metric in Discord alert
Signed-off-by: Levi Harrison <levisamuelharrison@gmail.com>
* Refactor: adds permissions for library panel creation
* Refactor: checks folder permissions for patch requests
* Chore: changes after PR comments
* Refactor: adds permissions to delete
* Refactor: moves get all permission tests out of get all tests
* Chore: move out get all tests to a separate file
* Refactor: adds permissions to get handler
* Refactor: fixes a bug with getting library panels in General folder
* Refactor: adds permissions for connect/disconnect
* Refactor: adds permissions and tests for get connected dashboards
* Tests: adds tests for connected dashboards in General Folder
* LibraryPanels: Deletes library panels during folder deletion
* LibraryPanels: Deletes library panels during folder deletion
* Update pkg/api/folder.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* Update pkg/services/librarypanels/librarypanels_permissions_test.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* Chore: updates after PR comments
* Chore: forgot to change some function signatures
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* Refactor: adds permissions for library panel creation
* Refactor: checks folder permissions for patch requests
* Chore: changes after PR comments
* Refactor: adds permissions to delete
* Refactor: moves get all permission tests out of get all tests
* Chore: move out get all tests to a separate file
* Refactor: adds permissions to get handler
* Refactor: fixes a bug with getting library panels in General folder
* Refactor: adds permissions for connect/disconnect
* Refactor: adds permissions and tests for get connected dashboards
* Tests: adds tests for connected dashboards in General Folder
* Stop using transformation to tables
* Update datasource.ts to parse from dataframes
* Add test on transformToDataframe func
* Remove parseResponse and do the work inside parseToAnnotations method
* Name the dataframe after the RefID
* Small fix when mapping to annotation
* Add tests in annotation_query_test.go class
* Small fix in loop iteration
* Change for loop signature
Changes the time value of the response to be milliseconds, which I think is like the other data sources I have seen.
Also if it sees the timerange values as numbers, assumes they are unixMS (and come from expressions, or our new backend.TimeRange type). When this timerange is used, the request is sent to graphite with from and until as epoch timestamps
* Run post-friendly request with set method first
* Improve messaging, retry only when post and specific status code
* Add comments
* Fix backend
* Update public/app/plugins/datasource/prometheus/datasource.ts
* Replace DataSourcesListItem with Card
* Add tests
* Remove unused styles
* Make card heading semi bold
* Make heading semi-bold
* Show type name instead of type id
* Fix key warning
* Update Card
* Fix tests
* Make typeName optional
* remove styling that was just a test
* Make typeName non-optional and fix tests
* Update list key
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
* LibraryPanels: Disconnect before connect during dashboard save
* Tests: fixed test
* Chore: updates after PR comments
* Chore: changes from context.Background() to c.Context.Req.Context()
* Chore: fixes lint issue
* Chore(deps): Bump xorm.io/xorm from 0.8.1 to 0.8.2
Bumps xorm.io/xorm from 0.8.1 to 0.8.2.
Signed-off-by: dependabot[bot] <support@github.com>
* Fix limit for snapshots
* Fix limit for org and users
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
* Cfg: fix hidden users initialization
* add tests
* do not call isHiddenUser function for non-user permission
* do not call isHiddenUser function for non-user permission
Fixes behaviour of Notify that returns error when one of the dispatch
event return error, to maintain high availability, we should return error
when all dispatched events return error instead.
Fixes#30509
* Add configuration in ConfigEditor and default to 1000
* Show data in explore if any even if there is an error
* Update pkg/tsdb/influxdb/flux/executor.go
* Better handling of defaults
* Add test for runQuery to show data even with error
* Update public/app/store/configureStore.ts
Co-authored-by: Giordano Ricci <gio.ricci@grafana.com>
* Update public/app/plugins/datasource/influxdb/components/ConfigEditor.tsx
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
* Update tooltip
* Update input
* Lint fixes
* Update snapshots
* Update decorator tests
Co-authored-by: Giordano Ricci <gio.ricci@grafana.com>
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
* update interval to fix no unit
* fix bug
* update with new method
* format go
* add test
* change test method to add test error nil
* add simplejson and model package
* change json format
* add parentheses
* add simplejson to function
* change mode to model
* move assert import package
* add one enter to avoid goimport error
* change to test case
* break out new and edit
* changed model to match new model in backend
* AlertingNG: API modifications (#30683)
* Fix API consistency
* Change eval alert definition to POST request
* Fix eval endpoint to accept custom now parameter
* Change JSON input property for create/update endpoints
* model adjustments
* set mixed datasource, fix put url
* update snapshots
* remove edit and add landing page
* remove snapshot tests ans snapshots
* wrap linkbutton in array
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
Co-authored-by: Sofia Papagiannaki <sofia@grafana.com>
* Introduce PluginRequestValidator abstraction with a NoOp implementation
* Update PluginRequestValidator abstraction to use the dsURL instead
* Inject PluginRequestValidator into the HTTPServer and validate requests going through data source proxy
* Inject PluginRequestValidator into the BackendPluginManager and validate requests going through it
* Validate requests going through QueryMetrics & QueryMetricsV2
* Validate BackendPluginManager health requests
* Fix backend plugins manager tests
* Validate requests going through alerting service
* Fix tests
* fix tests
* goimports
Co-authored-by: Leonard Gram <leo@xlson.com>
Fixes so that the warning WARN Failed to close
stream logger=plugins.backend err="cannot
close a closed stream" is not logged every
time calling a resource.
* Measure transformation number and elapsed time
* Change histogram to summary
* Apply suggestions from code review
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
* CDN: Initial poc support for serving assets over a CDN
* Minor fix
* added build path and test
* fix lint error
* Added edition to cdn path
* Move master builds to a separate path
* Added error handling for the url parsing, changed setting name, and added docs
* Updated sample.ini
* Some property renames
* updated
* Minor update to html
* index template improvements
* Update docs/sources/administration/configuration.md
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
* Update docs/sources/administration/configuration.md
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
* Added ContentDeliveryPrefix to Licence service
* updated docs
* Updated test mock
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Converts the core testdata data source to use the SDK contracts and by that
implementing a backend plugin in core Grafana in similar manner as an external one.
Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: Marcus Efraimsson <marefr@users.noreply.github.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* AlertingNG: pause/unpause definitions via the API
* Apply suggestions from code review
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
* Enable pausing/unpausing multiple definitions
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
* Usage Stats: Remove unused method for getting user stats
This was used in enterprise codebase, but is not longer in use, thus can be safely removed.
* Force refresh user stats in tests
* update go-mssqldb package
* mssql: support for Windows integrated security
Adds a dropdown to the config page to choose between
SQL Server auth and Windows auth. If the login/username
is empty then the go-mssqldb driver will use single sign on
(Windows integrated security) if on Windows.
* mssql: update ds - don't ignore the user column
* Expressions: remove feature toggle, add experimental badge
* Make button only show for backend and mixed data sources
Co-authored-by: Peter Holmberg <peter.hlmbrg@gmail.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
* Enforce unique alert definition title/uid per org
* Remove print statement from test
* Do not allow empty alert definition titles
* update error message on dup title
* also add title error to update
* CamelCase json properties
* Add test for title unique enforcement in updates
Co-authored-by: kyle <kyle@grafana.com>
* Auth: add error for expired token
* Auth: save token error into context data
* Auth: send full user and req context to CreateToken
* Auth: add token ID in context
* add TokenExpiredError struct
* update auth tests
* remove most of the changes to CreateToken func
* clean up
* Login: add requestURI in CreateToken ctx
* update RequestURIKey comment
* Add GraphView component
* Add service map panel
* Add more metadata visuals
* Add context menu on click
* Add context menu for services
* Fix service map in dashboard
* Add field proxy in explore linkSupplier
* Refactor the link creation
* Remove test file
* Fix scale change when view is panned
* Fix node centering
* Don't show context menu if no links
* Fix service map containers
* Add collapsible around the service map
* Fix stats computation
* Remove debug log
* Fix time stats
* Allow string timestamp
* Make panning bounded
* Add zooming by mouse wheel
* Clean up the colors
* Fix stats for single trace graph
* Don't show debug config
* Add more complex layout
* Update layout with better fixing of the root nodes
* Code cleanup
* Change how we pass in link creation function and some more cleanup
* Refactor the panel section into separate render methods
* Make the edge hover more readable
* Move stats computation to data source
* Put edge labels to front
* Simplify layout for better multi graph layout
* Update for dark theme
* Move function to utils
* Visual improvements
* Improve context menu detail
* Allow custom details
* Rename to NodeGraph
* Remove unused dependencies
* Use named color palette and add some fallbacks for missing data
* Add test data scenario
* Rename plugin
* Switch scroll zoom direction to align with google maps
* Do some perf optimisations and rise the node limit
* Update alert styling
* Rename function
* Add tests
* Add more tests
* Change data frame column mapping to use column names
* Fix test
* Fix type errors
* Don't show context menu without links
* Add beta status to panel
* Fix tests
* Changed function to standard methods
* Fix typing
* Clean up yarn.lock
* Add some UI improvements
- better styling of the zoom buttons
- disable buttons when max reached
* Fix panel references after rename
* Add panel icon
Replace hard-coded `GF_ENTERPRISE_LICENSE_TEXT` with a
`map[string]string` to allow the licensing service to allow sending any
environment variable through to the plugins for licensing purposes.
* cloud monitoring mql support
* reduce nesting
* remove resource type from deep link since. its removed for two reasons. first of all it is not needed for the link to work. secondly, by adding the resource type, the the link will differ from the query in grafana which I think is misleading
* use frame.meta.executedQueryString instead of legacy meta
Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
* Pass skipCache from context
* Use macaron Params instead of ParamsEscape for UIDs
* Modify queries and transform to get datasource UIDs
* Update github.com/grafana/grafana-plugin-sdk-go to v0.83.0
* Chore: moves common and response into separate packages
* Chore: moves common and response into separate packages
* Update pkg/api/utils/common.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* Chore: changes after PR comments
* Chore: move wrap to routing package
* Chore: move functions in common to response package
* Chore: move functions in common to response package
* Chore: formats imports
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
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>
* Convert Cloud Monitoring (Stackdriver) Datasource to use Dataframes #29830
* add deeplink into config
* omggggggggggggggg this deeplink works!
* move unit to the backend part
* remove unit from frontend
* only set the config fields[1] for deeplink and unit
* refactory + fix some test
* remove frontend test for unit
* adding backend test for unit mapping
* resolve review
* rewrtie unit logic to do exactly the same as frontend filter
* refactory
The current backend code doesn't honor the minimum interval set in the UI for alerts using
the Elasticsearch data source. This means that the data the alerts are triggering against
will never match the data in the visualization if auto is used in the date histogram as interval.
This fixes the problem to make sure that date histogram auto interval is set according to
min interval set in UI for the query or fallback to data source min interval setting.
Fixes#22082
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
* Auth: Add Content-Type to SigV4 header allowlist
* add MT headers to permitted headers
* add Kibana API header to allowlist
* add Content-Length header to allow list
* get meta data from dataframe meta
* gmdMeta is not used anymore
* wip: move deep link creation to backend
* Refactor backend. Remove not used front end code
* Unit test deep links. Remove not used frontend tests
* remove reference to gmdmeta
* fix goimports error
* fixed after pr feedback
* more changes according to pr feedback
* fix lint issue
* fix bad math expression check and fix bad test
* Decrease nesting
* put link on first data field only