* Render new email template and fix the title
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
* Fix nit
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
* Initial commit
* Progress
* Update
* Progress
* updates
* Minor fix
* fixed ts issue
* fixed e2e tests
* More explorations
* Making progress
* Panel options and field options unified
* With nested categories
* Starting to find something
* fix paddings
* Progress
* Breakthrough ux layout
* Progress
* Updates
* New way of composing options with search
* added regex search
* Refactoring to react note tree
* Show overrides
* Adding overrides radio button support
* Added popular view
* Separate stat/gauge/bargauge options into value options and display options
* Initial work on getting library panels into viz picker flow
* Fixed issues switching to panel library panel
* Move search input put of LibraryPanelsView
* Changing design again to have content inside boxes
* Style updates
* Refactoring to fix scroll issue
* Option category naming
* Fixed FilterInput issue
* Updated snapshots
* Fix padding
* Updated viz picker design
* Unify library panel an viz picker card
* Updated card with delete action
* Major refactoring back to an object model instead of searching and filtering react node tree
* More refactoring
* Show option category in label when searching
* Nice logic for categories rendering when searching or when only child
* Make getSuggestions more lazy for DataLinksEditor
* Add missing repeat options and handle conditional options
* Prepping options category to be more flexibly and control state from outside
* Added option count to search result
* Minor style tweak
* Added button to close viz picker
* Rewrote overrides to enable searching overrides
* New search engine and tests
* Searching overrides works
* Hide radio buttons while searching
* Added angular options back
* Added memoize for all options so they are not rebuilt for every search key stroke
* Added back support for category counters
* Started unit test work
* Refactoring and base popular options list
* Initial update to e2e test, more coming to add e2e test for search features
* Minor fix
* Review updates
* Fixing category open states
* Unit test progress
* Do not show visualization list mode radio button if library panels is not enabled
* Use boolean
* More unit tests
* Increase library panels per page count and give search focus when switching list mode
* field config change test and search test
* Feedback updates
* Minor tweaks
* Minor refactorings
* More minimal override collapse state
* Initial commit for state tracking
* basic state transition logic and tests
* constructor. test and interface fixup
* use new sig for sch.definitionRoutine()
* test fixup
* make the linter happy
* more minor linting cleanup
* Alerting: Opsgenie send tags as extra properties
Allow users to select where to send notification tags when alerting via
OpsGenie. Supports sending tags as key/value details, concatenated
strings in tags or both.
Users will be able to see their tags as key/values under extra
properties in an alert on the Opsgenie UI. These key/values can
then be used in the platform for routing, templating etc.
* Configurable delivery to either tags, extra properties or both
* Default to current behaviour (tags only)
* Support both so users can transition from tags to details
Add docs and clean up references
* Alerting: Add additional arg for Opsgenie tests
The NewEvalContext function now requires a 'PluginRequestValidator' argument.
As our test does not use the validator we can specify 'nil' to satisfy the
function and allow our test to pass as expected.
* Alerting: Opsgenie doc fixes
Accept suggested changes for Opsgenie docs
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
* Alerting: Opsgenie provisioning settings docs
Add the new setting to the provisioning docs
* Alerting: Opsgenie doc typo correction
Move the comma (,) out of the preformatting tags for the setting value
* Alerting: Opsgenie refactor send switches
Refactor the send switches to be methods on the OpsgenieNotiefier
itself. This also cleans up the method names so that the code reads
a bit more logically as:
if we should send details: send details
if we should send tags: send tags
This avoids the calling code needing to care about passing the state
and allows an engineer working in the `createAlert` function to focus
on the results of applying the logic instead.
* Alerting: Opsgenie docs rename note
Rename the note heading to match the number to more clearly link them.
* Alerting: Opsgenie use standard reference to note
Refer to the note below as per recommendation and standards.
Fixes#30331
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
* Alerting: Fetch configuration from the database and run a notification
instance
Co-Authored-By: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
This pull request migrates testdata to coreplugin streaming capabilities,
this is mostly a working concept of streaming plugins at the moment,
the work will continue in the following pull requests.
- Add the ability to stick metadata attached to a value in expressions. Currently uses Frame.Meta.Custom.
- None of this is consumed by anything yet, so an incremental step.
- Takes the conditions property from the settings column of an alert from alerts table and turns into an ng alerting condition with the queries and classic condition.
- Has temp API rest endpoint that will take the dashboard conditions json, translate it to SEE queries + classic condition, and execute it (only enabled in dev mode).
- Changes expressions to catch query responses with a non-nil error property
- Adds two new states for an NG instance result (NoData, Error) and updates evaluation to match those states
- Changes the AsDataFrame (for frontend) from Bool to string to represent additional states
- Fix bug in condition model to accept first Operator as empty string.
- In ngalert, adds GetQueryDataRequest, which was part of execute and is still called from there. But this allows me to get the Expression request from a condition to make the "pipeline" can be built.
- Update AsDataFrame for evalresult to be row based so it displays a little better for now
* first pass
* add instance manager
* fix tests
* remove dead code
* unexport fields
* cleanup
* remove ds instance from executor
* cleanup
* inline im
* remove old func
* get error working
* unexport field
* let fe do its magic
* fix channel name
* revert some tsdb changes
* fix annotations
* cleanup
* Return dataframe directly from the backend
* Streamline some transforms
* Fix lint issues
* Remove unused lib
* Fix datasource test
* Fix imports and add some typings
* Fix the typings and some tests
* Add private doc comment
* Remove private tag
* Add comments
* Fix some API docs issues
* Alerting: Add database table for persisting alerting configuration
* Fix the linter
* Address review comments
* Don't split templates and configuration
It is already bundled together as part of a of the API so might as well
marshall it directly.
* Fix LoginService.UpsertUser user creation
* Fix API AdminCreateUser user creation
* Add missing underscore import
* Fix API CompleteInvite user creation
* Fix API SignUpStep2 user creation
* SQLStore: Close session in withDbSession
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
* SQLStore.WithDbSession: Never use session from context
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
* SSE/InfluxDB: Change InfluxQL to work with server side expressions
updates the request to handle EpochMS as the time range (which is what expressions sends)
and the response to use millisecond timestamps instead of seconds.
fixes#31604
similar to https://github.com/grafana/grafana/pull/31455
* LibraryPanels: Improves Get All Api
* Refactor: using useReducer instead of useState
* Refactor: adds Pagination to UI
* Tests: adds reducer tests
* Refactor: using Observable instead to avoid flickering
* Refactor: moves exclusion to backend instead
* Chore: changing back the perPage default value
* Convert Prometheus query response to dataframes
* Add parseResponse tests
* Fixed lint imports
* Force use UTC as timezone in timeVector
* Updated test to check timezone
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
* Elasticsearch: Add support for serial diff pipeline aggregation
* Removing settings transsforms
* Removing unused deps
* removing unused dep
* Fixing type in test
* Adding backend support for serial_diff