grafana/pkg/services/sqlstore
George Robinson ed7d29f2b9
Alerting: Migrate old alerting templates to Go templates (#62911)
* Migrate old alerting templates to use $labels

* Fix imports

* Add test coverage and separate rewriting to Go templates

* Fix lint

* Check for additional closing braces

* Add logging of invalid message templates

* Fix tests

* Small fixes

* Update comments

* Panic on empty token

* Use logtest.Fake

* Fix lint

* Allow for spaces in variable names by not tokenizing spaces

* Add template function to deduplicate Labels in a Value map

* Fix behavior of mapLookupString

* Reference deduplicated labels in migrated message template

* Fix behavior of deduplicateLabelsFunc

* Don't create variable for parent logger

* Add more tests for deduplicateLabelsFunc

* Remove unused function

* Apply suggestions from code review

Co-authored by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>

* Give label val merge function better name

* Extract template migration and escape literal tokens

* Consolidate + simplify template migration

---------

Co-authored-by: William Wernert <william.wernert@grafana.com>
2023-10-02 11:25:33 -04:00
..
migrations Alerting: Migrate old alerting templates to Go templates (#62911) 2023-10-02 11:25:33 -04:00
migrator Instrumentation: Improve instrumentation for database migrations (#74659) 2023-09-11 14:10:21 +03:00
permissions Auth: Implement requester interface in access control module (#74289) 2023-09-06 11:16:10 +02:00
searchstore User: Support sort query param for user and org user, search endpoints (#75229) 2023-09-28 10:16:18 +02:00
session Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
sqlutil Chore: remove xorm from preference (#53803) 2022-08-17 22:07:20 -04:00
bulk_test.go Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
bulk.go Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
database_wrapper.go Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
logger.go Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
session_test.go SQLStore: Fix SQLite error propagation if query retries are disabled (#64904) 2023-03-17 12:57:13 +02:00
session.go Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
sqlstore_metrics_test.go Metrics: Fixed grafana_database_conn_* metrics, and added new go_sql_stats_* metrics as eventual replacement (#54405) 2022-08-31 08:54:32 -04:00
sqlstore_metrics.go Metrics: Fixed grafana_database_conn_* metrics, and added new go_sql_stats_* metrics as eventual replacement (#54405) 2022-08-31 08:54:32 -04:00
sqlstore_test.go SQLStore: Fix regression in PostgreSQL connection string (#71368) 2023-07-11 16:47:35 +03:00
sqlstore.go SQLStore: Fix race condition in RecursiveQueriesAreSupported (#75274) 2023-09-22 11:30:14 +01:00
tls_mysql.go Handle ioutil deprecations (#53526) 2022-08-10 15:37:51 +02:00
transactions_test.go SQLStore: Add test for nested transactions events (#60500) 2023-01-23 14:17:56 +01:00
transactions.go SQLStore: Add test for nested transactions events (#60500) 2023-01-23 14:17:56 +01:00
user_test.go Bug(sqlstore): fix issue with postgres unable to find existing main organization (#73789) 2023-08-30 11:45:20 -04:00
user.go Bug(sqlstore): fix issue with postgres unable to find existing main organization (#73789) 2023-08-30 11:45:20 -04:00