* Alerting: Add an empty Forked Alertmanager
* Alerting: Add methods for silences to the forked Alertmanager
* check for errors in tests
* make linter happy
* Alerting: Add methods for alerts to the forked Alertmanager
* Alerting: Add methods for receivers to the forked Alertmanager
* make linter happy
* separate into both forked AMs
* fix tests
* rename testErr -> expErr
* add permission check for updating the LBAC Rules
* permission scoped for id in the updating datasource
* fixed test to cover for permissions
* fix proper check for permissions and empty teamHTTPHeader requests
* check for jsondata
* check nil for jsondata inside the getEncodedString
* Folders: Show folders user has access to at the root level
* Refactor
* Refactor
* Hide parent folders user has no access to
* Skip expensive computation if possible
* Fix tests
* Fix potential nil access
* Fix duplicated folders
* Fix linter error
* Fix querying folders if no managed permissions set
* Update benchmark
* Add special shared with me folder and fetch available non-root folders on demand
* Fix parents query
* Improve db query for folders
* Reset benchmark changes
* Fix permissions for shared with me folder
* Simplify dedup
* Add option to include shared folder permission to user's permissions
* Fix nil UID
* Remove duplicated folders from shared list
* Only left the base part
* Apply suggestions from code review
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
* Add tests
* Fix linter errors
---------
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
* Alerting: Add an empty Forked Alertmanager
* Alerting: Add methods for silences to the forked Alertmanager
* check for errors in tests
* make linter happy
* Alerting: Add methods for alerts to the forked Alertmanager
* make linter happy
* separate into both forked AMs
* rename testErr -> expErr
* Alerting: Add an empty Forked Alertmanager
* Alerting: Add methods for silences to the forked Alertmanager
* check for errors in tests
* make linter happy
* make linter happy
* Alerting: Add methods for silences to the forked Alertmanager
* inital changes, db migration
* changes
* Implement basic GetAll, Delete
* Add first batch of tests
* Add more tests
* Add service tests for GetForProvider, List
* Update http_server.go + wire.go
* Lint + update fixed role
* Update CODEOWNERS
* Change API init
* Change roles, rename
* Review with @kalleep
* Revert a mistakenly changed part
* Updates based on @dmihai 's feedback
---------
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
* WIP
* Refactor, plus update source of error in response_parser
* Adjust test
* Use methods and httpclient from errorsource
* Update pkg/tsdb/elasticsearch/data_query.go
Co-authored-by: Scott Lepper <scott.lepper@gmail.com>
* Return nil error
* Fix test
* Fix integration test
---------
Co-authored-by: Scott Lepper <scott.lepper@gmail.com>
Currently, in the schema, it's a global definition called `ItemDTO`. It's hard to figure out what that is
Renaming it to `Annotation` should be more helpful
* cumulative sum
* refactor and create new mode
* refactor - use reduceOptions for new mode also
* revert naming
* Add window function, rename statistical to cumulative (#77066)
* Add window function, rename statistical to cumulative
* Fix merge errors
* fix more merge errors
* refactor + add window funcs
Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
* add ff + tests + centered moving avg
Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
* make sum and mean cumulative more efficient (#77173)
* make sum and mean cumulative more efficient
* remove cumulative variance, add window stddev
* refactor window to not use reducer for mean. wip variance stdDev
* fix tests after optimization
---------
Co-authored-by: Victor Marin <victor.marin@grafana.com>
* optimize window func (#77266)
* make sum and mean cumulative more efficient
* remove cumulative variance, add window stddev
* refactor window to not use reducer for mean. wip variance stdDev
* fix tests after optimization
* fix test lint
* optimize window
* tests are passing
* fix nulls
* fix all nulls
---------
Co-authored-by: Victor Marin <victor.marin@grafana.com>
* change window size to be percentage
* fix tests to use percentage
* fixed/percentage window size (#77369)
* Add docs for cumulative and window functions of the add field from calculation transform. (#77352)
add docs
* splling
* change WindowType -> WindowAlignment
* update betterer
* refactor getWindowCreator
* add docs to content.ts
* add feature toggle message
---------
Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
* add/update sqlstore-related helper functions
* add documentation & tests for InsertQuery and UpdateQuery, make generated SQL deterministic by sorting columns
* remove old log line
* Chore: Replace grafana-authnz-team with identity-access-team as code owner
* Chore: Replace grafana-authnz-team with identity-access-team as code owner
* Fix the failing test
* Add interface verification compliance
* rework service account api to a provider
* wire the service accounts api
* rewire the implementation of sa srv for the proxy
---------
Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
* Storage: Add maxFiles to list functions
* Add maxDataPoints argument to listFiles function
* Add maxFiles to ResourceDimensionEditor
* Update pkg/services/store/http.go
* rename First to Limit
---------
Co-authored-by: jennyfana <110450222+jennyfana@users.noreply.github.com>
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* Dashboards: Add integration tests for creating a dashboard
* Fix creating dashboard under folder using deprecated API
* Update swagger response
* Fix comments
* Update Tempo devenv to include profiles
* Update devenv to scrape profiles from local services
* Cleanup devenv
* Fix issue with flame graph
* Add width prop to ProfileTypeCascader
* Add trace to profiles settings
* Add new spanSelector API
* Add spanSelector to query editor
* Update span link query
* Conditionally show span link
* Combine profile and spanProfile query types and run specific query type in backend based on spanSelector presence
* Update placeholder
* Create feature toggle
* Remove spanProfile query type
* Cleanup
* Use feeature toggle
* Update feature toggle
* Update devenv
* Update devenv
* Tests
* Tests
* Profiles for this span
* Styling
* Types
* Update type check
* Tidier funcs
* Add config links from dataframe
* Remove time shift
* Update tests
* Update range in test
* Simplify span link logic
* Update default keys
* Update pyro link
* Use const
When running in dev mode, error messages would contain an additional "error" property alongside "message". Since this causes confusion, that has been removed and now error messages are the same both modes (using "message").
* Disable plugin service account
* Revert extsvc injection
* handle plugin state changes
* Use isProxyEnabled
* Remove plugininteg changes
* Change update function to also work for mysql 😩
* Plugin: enable service account based on plugin settings on
initialization
* Remove misleading comment
* Fix tests
* test message
* Clean up tests
* Simplify tests
* Re-order imports
* Remove unecessary comment
* Enable datasource plugins by default
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
---------
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
* Disable plugin service account
* Revert extsvc injection
* handle plugin state changes
* Use isProxyEnabled
* Remove plugininteg changes
* Change update function to also work for mysql 😩
* Change test to also check no collateral update
* Update pkg/services/serviceaccounts/database/store_test.go
* Update pkg/services/serviceaccounts/database/store_test.go
* add validation of team header values w. regex
* apply valid headers
* refactor testcases to account for badly formatted json
* refactoring to move validation code close to the validation itself
* removed tes
* Update pkg/api/datasources_test.go
Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
* Update pkg/api/datasources.go
Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
* review comments
* review during pairing
---------
Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
* Use context in aws ListSinks and ListAttachedLinks
In the current way, ListSinks and ListAttachedLinks is used which doesn't
allow cancelling the request if the context changes.
Using ListSinksWithContext and ListAttachedLinksWithContext is the
preferred way. Adding context for GetAccountsForCurrentUserOrRole
is required to pass it to ListSinks method.
* set default basic role permissions for dashboards even if dash creator permissions can't be set
* temporarily increase the test threshold until we can tweak the page
* Use singleflight to prevent logging error if the token has already been refreshed
* Change order of error checks
* align tests, change error name
* Change sf key
* Update based on the review
* refactor
* add FlagExternalServiceAccounts to proxy service
* add FlagExternalServiceAccounts value to tests
---------
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
* expand serviceaccount service interface
* implemet FakeServiceAccountService
* Replace SA service interface from api
* merge sa proxy tests with new fake service
* implement DeleteServiceAccountToken
* add test for DeleteServiceAccountToken
* Alerting: Rename remote.ExternalAlertmanager to remote.Alertmanager
* Alerting: Send alerts to the remote Alertmanager
* add ticker to readiness check, add tests
* use options when creating a new sender.ExternaAlertmanager
* unexport defaultMaxQueueCapacity
* delete unused defaultConfig field
* add debug log line when sending alerts to the remote alertmanager
* move and refactor readiness check
* update tests to not include defaultConfig
* AuthN: Add metrics to external service accounts management
* Add a new metric to count stored external service accounts
* Update variable names
Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>
* Add test to SearchOrgServiceAccounts
* Add feature flags checks before registering and using the metrics
---------
Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>
* correctly check permissions to list dashboards on the root
* correctly display the access inherited from general folder for dashboards
* Update pkg/services/sqlstore/permissions/dashboard.go
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
* Update dashboard_filter_no_subquery.go
---------
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
* Add resultFormat to query model
* don't add row name if the result format is table
* No need special formatting since we use unified dataframes
* betterer
* specify visualization type in response
* Unit tests
* fix unit tests