* add dev mechanism for making backend unavailable
* handle unavailable backend in html
* fix ordering of /-/ routes
* Add new loader to index.html
* tweak light colours
* fix readme
* add error handling and error state
* use setTimeout for the retry loop
* easier on the comments:
* Remote Alertmanager: Use the same struct for Grafana stat and Mimir full state
* Alertmanager: Add methods to merge nflog and silences
* update grafana/alerting version
* make update-workspace
* update mocks
* remove unnecesary methods from the remote Alertmanager implementation, create separate StateMerger interface
* (WIP) Remote Alertmanager: Optionally merge remote state before starting the internal Alertmanager
* cleanup ngalert.go
* restore defaults.ini
* move state parsing logic to 'remote' package, clean up ngalert.go
* remove GetBase, implement MegeNflog and MergeSilences
* delete fmt.Println
* FetchRemoteState -> GetRemoteState
* UserGrafanaState -> UserState
* remove duplicate clusterpb import
* reorder MimirClient interface
* use general getState() method for Grafana state and Mimir full state
* remove unnecessary state merging methods from the Alertmanager interface
* remove pullState field
* reduce diff
* add info log after merging
* merge silences and nflog entries in the same method
* merge the remote state in the forked AM
* reduce diff
* update remote AM mock
* tests
* make error more specific
* typo
* Cloud migrations: store snapshots in the database
* update github.com/grafana/grafana-cloud-migration-snapshot to v1.9.0
* make update-workspace
* use new field name in test
* return error after call to fmt.Errorf
* create methods for readability / fix session deletiong not deleting snapshots
* remove debugging changes
* update sample.ini
* update tests to include OrgID in ListSnapshotsQuery
* lint
* lint
* Update pkg/services/cloudmigration/cloudmigrationimpl/snapshot_mgmt.go
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
* remove TODO
* Update pkg/services/cloudmigration/cloudmigrationimpl/snapshot_mgmt.go
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
* remove one of the debug logs
---------
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
* fix: separate dashboard api tests
* fix: typo
* refactor: revert file rename
* fix: compilable
* fix: trial
* fix: remove unused func
* Pass the right value for kubernetesDashboardsEnabled flag
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Enable mode 3 for remaining tests
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Disable integration tests for MySQL and Postgres
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Run go work use
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Update go.mod
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Remove TODO comment
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Revert to go 1.24.5
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* go.mod
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Remove duplicated block
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Experiment without reusing client
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Reenable integration tests on Postgres and MySQL
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Revert "Experiment without reusing client"
This reverts commit 0126e321a08dbafc482a623f2593edaf5561ed32.
* Reapply "Experiment without reusing client"
This reverts commit 5368b4c5318f78aef9b1a5c310846f3f5569fe78.
* Refactor how we get an adminClient
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Add TODO comments
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
---------
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
Co-authored-by: Maicon Costa <maiconscosta@gmail.com>
* TimeComparison: Add time comparison option
* Display control conditionally based on option
* Provide timeCompare option to panels that opt in
* Only render time compare if panel supports it
* Create a custom time range compare component
* Move custom component
* Remove button checked
* Move time compare options out of field config
* Fix types and remove from fieldConfigProperty enum
* Remove from field config registry
* Add headerActions to V2 schema
* Remove dependency on timeCompare support registry
* Add feature flag
* Subscribe to options change in wrapper
* Remove custom rendering to simplify wrapper
* Bump scenes version
* Hide checkbox
* Remove unneeded query refresh during disable
* Fix import order in timeseries module
* Add util tests
* Support time comparison toggle for new viz panels
* Revert grafana-app-sdk and manifest changes
* Revert yarn lock
* Add ref option to stage options
* Fix the issue with ref in export worker
* Add unit tests for export stage options
* Do not fail if ref is equal to the stage branch
* Format code again
* fix test
---------
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
* deduplicate config preparation logic squashes config preparation in 3 places into a single method buildConfiguration
* remove copying config from decrypt because we already use copy
* move logic from decryptConfiguration to buildConfiguration
* move logic from mergeExtraConfigs to buildConfiguration
* load default config with buildConfiguration method and skip if fails
---------
Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>
* First draft autocomplete
* Better naming
* Change suggestion to table/column population
* Remove all suggestions, just use table/column population but trigger on space
* Gate feature flag behind a feature flag
* Reorganize and add function list
* Add blurb about autocomplete to docs
* Update public/app/features/expressions/utils/metaSqlExpr.ts
Co-authored-by: Alex Spencer <52186778+alexjonspencer1@users.noreply.github.com>
* Add try catch, remove promise resolve
---------
Co-authored-by: Alex Spencer <52186778+alexjonspencer1@users.noreply.github.com>
What is this feature?
This PR further improves concurrent updates to the provenance table (a follow-up for #101688). The fix explicitly checks for a provenance record using SELECT ... FOR UPDATE for the databases that support it before performing either an update or upsert operation. This preemptive locking reduces the possibility of deadlocks in MySQL.
This works only with the alertingProvenanceLockWrites feature flag enabled.
Why do we need this feature?
The current implementation (directly performing upserts without prior locking) may still encounter deadlocks because of the gap and insert-intention locks in some configurations, for example, with repeatable-read transaction isolation level in MySQL+InnoDB.
---------
Co-authored-by: William Wernert <william.wernert@grafana.com>
* Add warning job status
* Different strictness for export than for pulling
* Fix some unit tests
* Fix unit tests
* Update frontend to display the warning status
* Fix status badge
* Add missing return statement
* Improve text in alert
* FrontendService: Add tracing and logging middleware
* tests!
* middleware tests
* context middleware test
* revert http_server back to previous version
* fix lint
* fix test
* use http.NotFound instead of custom http handler
* use existing tracer for package
* use otel/trace.Tracer in request_tracing middleware
* tidy up tracing in contextMiddleware
* fix 404 test
* remove spans from contextMiddleware
* comment
* Dashboards API: v2alpha2 missing pieces
* Fix issue with dashboard client scope for alpha versions
As we now have 2 different alpha versions for v2 we need to store the
clients separately.
* Improve debuggability of provisioning export test
- Add a helper function to print the tree structure.
- Be explicit about the expected file names expected in each case.
* Update pkg/registry/apis/dashboard/mutate.go
* Update pkg/services/authz/zanzana/server/server.go
Co-authored-by: Igor Suleymanov <radiohead@users.noreply.github.com>
* Review
* go lint
---------
Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
Co-authored-by: Igor Suleymanov <radiohead@users.noreply.github.com>
* Context: Clean up contexthandler.Middleware spans
* seperate the middleware span from the rest of the request
* shuffle
* put of back
* span name
* Update pkg/services/contexthandler/contexthandler.go
Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
---------
Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
* Alerting: Contact point export snapshot test
* Fix Jira.fields hcl export type to allow map[string]any
Since gohcl does not support this type, we marshal as a string instead
which will be handled in the TF provider.
* mapToJSONStringCodec encoder needed for
TestContactPointFromContactPointExports