grafana/pkg/services
Steve Simpson 9effb9a708
Alerting: Allow hooking into request handler functions. (#67000)
* Alerting: Allow hooking into request handler functions.

Adds a facility to AlertNG for hooking into API handlers, allowing the
replacement of request handlers for specific paths. One of goals of this
approach was to allow hooking as late as possible in the request, e.g.
after all middleware has been applied, to simplfiy usage.

* Update pkg/services/ngalert/api/hooks.go

Co-authored-by: gotjosh <josue.abreu@gmail.com>

* Update pkg/services/ngalert/api/hooks.go

Co-authored-by: gotjosh <josue.abreu@gmail.com>

* Update pkg/services/ngalert/ngalert.go

Co-authored-by: gotjosh <josue.abreu@gmail.com>

* Fixes to review comments

* Fix passing logger in

---------

Co-authored-by: gotjosh <josue.abreu@gmail.com>
2023-04-24 18:18:44 +02:00
..
accesscontrol RBAC: Feature to override default assignments (#66561) 2023-04-14 17:17:59 +02:00
alerting Search v1: Add support for inherited folder permissions if nested folders are enabled (#63275) 2023-04-06 11:16:15 +03:00
annotations Annotations: Improve get tags query performance (#66182) 2023-04-18 13:27:40 +03:00
anonymous AnonymousService: Test tagging service (#64708) 2023-03-14 10:47:34 +01:00
apikey Chore: Remove result field from API keys commands and queries (#65055) 2023-03-21 13:26:33 +01:00
auth Auth: Add feature flag to move token rotation to client (#65060) 2023-03-23 14:39:04 +01:00
authn AuthN: Tune logs in client (#65714) 2023-03-31 16:43:24 +02:00
caching Caching: Consolidate resource cache checking and updating in plugin middleware (#67002) 2023-04-21 13:03:49 -04:00
cleanup Chore: Fix goimports grouping in pkg/services (#62420) 2023-01-30 08:21:27 +00:00
contexthandler Auth: Remove the session cookie only if it's invalid or revoked (#65984) 2023-04-13 09:23:39 +02:00
correlations Correlations: Add usage stats about correlations (#66021) 2023-04-11 08:53:34 +02:00
dashboardimport Dashboards: Avoid adding unused revision property (#64362) 2023-03-08 08:26:38 -08:00
dashboards NestedFolders: Add API endpoint for descendant count in a folder (#66550) 2023-04-24 15:57:28 +02:00
dashboardsnapshots Snapshots: Add snapshot enable config (#61587) 2023-01-26 10:28:11 -03:00
dashboardversion API: Fix "Updated by" Column in dashboard versions table (#65351) 2023-03-30 17:31:53 +03:00
datasourceproxy Caching: Refactor enterprise query caching middleware to a wire service (#65616) 2023-04-12 12:30:33 -04:00
datasources Datasources: provide generic function to extract custom headers (#66738) 2023-04-19 17:04:30 +02:00
encryption Chore: Fix goimports grouping in pkg/services (#62420) 2023-01-30 08:21:27 +00:00
featuremgmt Loki: Enable new log context query editor (#67131) 2023-04-24 17:27:43 +02:00
folder NestedFolders: Add API endpoint for descendant count in a folder (#66550) 2023-04-24 15:57:28 +02:00
grpcserver ApiKeyGenPrefix: rename package (#65623) 2023-03-30 17:04:10 +02:00
guardian Cfg: Move ViewersCanEdit into cfg (#64876) 2023-03-16 10:54:01 +01:00
hooks chore: move user_auth models to (mostly) login service (#62269) 2023-01-27 13:36:54 -05:00
kmsproviders Encryption: Refactor secrets.Service initialization (#51091) 2022-07-07 09:48:25 +02:00
ldap LDAP: Always synchronize Server Admin role through role sync if role sync is enabled (#58820) 2023-03-31 15:39:23 +01:00
libraryelements RBAC: Update library element tests to use RBAC (#66782) 2023-04-20 12:24:41 +03:00
librarypanels RBAC: Update library element tests to use RBAC (#66782) 2023-04-20 12:24:41 +03:00
licensing Chore: Clean up old navigation (#66287) 2023-04-14 09:43:11 +01:00
live Live: Update Centrifuge to the latest version (#66637) 2023-04-18 21:47:15 -07:00
login Chore: Remove result fields from login (#65136) 2023-03-28 20:32:21 +02:00
loginattempt Chore: Remove result field from loginattempt (#65117) 2023-03-22 21:25:29 +01:00
navtree FIX: Make dashboards navlink accessible with only folders permissions (#67049) 2023-04-24 09:02:42 +02:00
ngalert Alerting: Allow hooking into request handler functions. (#67000) 2023-04-24 18:18:44 +02:00
notifications Chore: Remove result field from notifications (#65170) 2023-03-28 13:44:15 +02:00
oauthtoken Chore: Remove result fields from login (#65136) 2023-03-28 20:32:21 +02:00
org Auth: Fix orgrole picker disabled if isSynced user (#64033) 2023-03-22 17:41:59 +00:00
playlist Chore: Update oapi-codegen library (#62962) 2023-02-21 12:34:24 +01:00
plugindashboards Plugins: Add file store abstraction for handling plugin files (#65432) 2023-03-29 12:55:55 +02:00
pluginsintegration Caching: Consolidate resource cache checking and updating in plugin middleware (#67002) 2023-04-21 13:03:49 -04:00
preference SQLStore: Fix wrong usage of xorm's insert functions in tests (#63850) 2023-03-02 13:01:36 +02:00
provisioning Alerting: Remove dependency on alerting package in definitions (#65390) 2023-03-29 13:34:59 -04:00
publicdashboards Annotations: Support filtering the target panels (#66325) 2023-04-18 15:39:30 -05:00
query SSE: (Instrumentation) Add Tracing (#66700) 2023-04-18 08:04:51 -04:00
queryhistory Chore: Use time mocks in queryhistory to speed up tests (#66644) 2023-04-17 12:02:47 +02:00
quota Chore: Remove xorcare/pointer dependency (#63900) 2023-03-06 05:23:15 -05:00
rendering Rendering: Experimental support to use JWTs as auth method (#60841) 2023-04-03 18:53:38 +02:00
screenshot Alerting: Fix a bug taking screenshots with Dashboard UID (#63220) 2023-02-09 15:23:01 -05:00
search Chore: Remove result field from search (#65583) 2023-03-30 11:28:12 +02:00
searchusers Chore: Move ReqContext to contexthandler service (#62102) 2023-01-27 08:50:36 +01:00
searchV2 Chore: remove querylibrary feature toggle (#65021) 2023-03-20 20:00:14 +04:00
secrets Chore: Remove result field from remaining datasources queries (#65054) 2023-03-20 19:18:21 +01:00
serviceaccounts ApiKeyGenPrefix: rename package (#65623) 2023-03-30 17:04:10 +02:00
shorturls Chore: Replace short UID generation with more standard UUIDs (#62731) 2023-02-06 20:44:37 -05:00
signingkeys Auth: Add SigningKeys Service (#64343) 2023-04-17 11:42:37 +02:00
sqlstore RBAC: Remove the option to disable RBAC and add automated permission migrations for instances that had RBAC disabled (#66652) 2023-04-19 16:34:19 +01:00
star Search: Improvements for starred dashboard search (#64758) 2023-03-16 09:20:07 +00:00
stats UsageStats: Add database age and driver (#66535) 2023-04-17 18:27:04 -07:00
store ApiKeyGenPrefix: rename package (#65623) 2023-03-30 17:04:10 +02:00
supportbundles Support bundles: fix user collector permissions and format collector output (#64531) 2023-03-09 11:43:18 -05:00
tag Annotations: Ignore unique constraint violations for tags (#65935) 2023-04-18 14:21:38 +02:00
team Chore: Remove CreateUserForTests() (#64125) 2023-03-03 11:01:23 -05:00
teamguardian Chore: Fix goimports grouping (#62426) 2023-01-30 09:34:18 +01:00
temp_user fix: create temp user no longer sets ID to 0 for all users (#64149) 2023-03-03 10:50:54 -05:00
updatechecker Plugins: Improve instrumentation by adding metrics and tracing (#61035) 2023-03-28 11:01:06 +02:00
user Usagestats: Add interface for stats for user.Service and add Usagestats for case_insensitive_login (#66742) 2023-04-18 14:34:40 +01:00
validations chore: move validations model into the validations service (#61953) 2023-01-23 15:10:14 -05:00