Commit Graph

194 Commits

Author SHA1 Message Date
Yuri Tseretyan
1b4b1af9b7 Alerting: Receiver API to use same logic for calculating UID as backend serivce (#91153)
use same logic for calculating uID as backend serivce
2024-07-29 15:55:49 -04:00
Yuri Tseretyan
6b0d20c96a Alerting: time interval service to support addressing intervals by Base64 encoded name (#90563)
* rename to getMuteTimingByName

* add UID to api model of MuteTiming

* update GetMuteTiming to search by UID

* update UpdateMuteTiming to support search by UID

* update DeleteMuteTiming to support uid

* make sure UID is populated

* update usages

* use base64 url-safe, no padding encoding for UID
2024-07-26 16:43:40 -04:00
Ryan McKinley
ec6c6bd6c3 Identity: Add read-only identity apiserver (#90418) 2024-07-26 17:09:08 +03:00
Ryan McKinley
be7b1ce2df Chore: Replace appcontext.User(ctx) with identity.GetRequester(ctx) (#91030) 2024-07-26 16:39:23 +03:00
Ryan McKinley
9db3bc926e Identity: Rename "namespace" to "type" in the requester interface (#90567) 2024-07-25 12:52:14 +03:00
Ryan McKinley
6e39f24588 Storage: Update storage.Interface for backend (#90382) 2024-07-18 07:47:47 -07:00
Ryan McKinley
f409f8c169 K8s/Dashboards: Implement dashboards as StorageBackend (#90295) 2024-07-17 10:49:23 -07:00
Jean-Philippe Quéméner
283280f329 fix(querier): use most specific timerange available (#90540)
* fix(querier): use most specific timerange available

* return zero values
2024-07-17 20:22:45 +04:00
Matthew Jacobson
b7f422b68d Alerting: Receiver API Get+List+Delete (#90384) 2024-07-16 10:02:16 -04:00
Piotr Jamróz
f14ba32ea6 Query Library: Use current namespace when calling API (#90423)
* Use the current namespace

* Enable PeakQ API

* Enable PeakQ API when Query API is enabled

* Enable PeakQ API when Query API & Query Library are enabled
2024-07-16 11:50:38 +02:00
Ryan McKinley
d2bc4f3255 DualWrite: Cleanup and centralize the dual write creation (#90013) 2024-07-11 23:23:31 +03:00
Stephanie Hingtgen
bb187ce4b1 K8s: Match status codes from single tenant (#90153)
Co-authored-by: Jean-Philippe Quémémer <jeanphilippe.quemener@grafana.com>
2024-07-10 20:48:02 +02:00
Giuseppe Guerra
9216a3df7d Plugins: Remove datasourceQueryMultiStatus feature toggle (#90191)
* Remove datasourceQueryMultiStatus feature toggle

* PR review suggestion
2024-07-10 11:15:10 +02:00
Yuri Tseretyan
5ae5fa3a7a Alerting: Support field selectors in time interval API (#90022)
* fix kind of TimeInterval
* register custom fields for selectors
* support field selectors in legacy storage
* support selectors in storage

===== Misc
* refactor conversions to build in one place
* hide implementation of provenance status behind accessors to use the key in selectors
* fix provenance error
2024-07-08 22:45:30 +03:00
Andres Martinez Gotor
f41ee615ba Chore: Add basic admission handlers for registered API services (#89824) 2024-07-03 09:19:54 +02:00
Charandas
f50c8566df K8s: handle queries being an empty slice (#89928)
* K8s: handle queries being an empty slice

* remove unnecessary comment

* remove redundant break
2024-07-02 19:44:29 +00:00
Todd Treece
9c6d3590a2 Chore: Fix apiserver circular dependencies (#89918) 2024-07-01 11:42:34 -04:00
Matthew Jacobson
e121e2609f Alerting: Receiver API (#89707) 2024-06-26 20:03:25 +03:00
Isabella Siu
3ac109e759 AWS: Update deprecated aws-sdk functions from env variable versions (#89643) 2024-06-26 11:56:39 -04:00
Ryan McKinley
3db4e5a0c6 K8s: remove dashboard summary abstraction (#89761) 2024-06-26 15:00:24 +03:00
Leonor Oliveira
2645958c8c Use global function to compare any entity to both stores (#89282)
* WIP implement generic compare interface

* Use global compare fn for all entities

* Lint

* Update pkg/apiserver/rest/dualwriter.go

Co-authored-by: Dan Cech <dcech@grafana.com>

* Don't need to hash, just compare bytes

* Fix tests

---------

Co-authored-by: Dan Cech <dcech@grafana.com>
2024-06-26 10:19:40 +02:00
Ryan McKinley
4651506319 K8s/Dashboards: Replace multiple calls with a single endpoint (#89639) 2024-06-26 07:27:52 +03:00
Todd Treece
71270f3203 Storage: Avoid relying on RequestInfo (#89635) 2024-06-25 10:06:03 -04:00
Jean-Philippe Quéméner
bc43078320 fix(grafana-apps): copy namespace from connect ctx (#89569) 2024-06-21 20:05:55 +03:00
Ryan McKinley
93ef90a1e4 K8s: remove (not great) example api (#89524) 2024-06-21 10:23:08 +03:00
Yuri Tseretyan
b075926202 Alerting: Time Intervals API (#88201)
* expose ngalert API to public
* add delete action to time-intervals
* introduce time-interval model generated by app-platform-sdk from CUE model the fields of the model are chosen to be compatible with the current model
* implement api server
* add feature flag alertingApiServer
---- Test Infra
* update helper to support creating custom users with enterprise permissions
* add generator for Interval model
2024-06-20 16:52:03 -04:00
Ryan McKinley
27e800768e K8s: Improve identity mapping setup (#89450) 2024-06-20 17:53:07 +03:00
Ryan McKinley
9b7f9ae22e K8s: Rename origin.key to origin.hash (#89337) 2024-06-18 22:27:16 +03:00
Leonor Oliveira
e1145472c4 For now, only compare if names are the same in playlists (#89206) 2024-06-14 13:13:49 +02:00
Leonor Oliveira
fd44f2ee4f Init dualwriter metrics (#89003)
* Pass prometheus registerer to the dual writer

* Fix tests

* Remove unused var

* Fix tests

* Uncomment test

* Remove leading line

* Fix tests. Reuse registerer if there's already one

* Lint

* Improve double registering logic

* Rebase main
2024-06-14 11:01:49 +02:00
Gabriel MABILLE
afcb5a855c AuthZ: embed an authorization server (#89018)
* AuthZ: embed an authorization server

* CODEOWNERS

* Remove swagger

* WIP

* Flatten structure and inject wireset

* sync mod files

* Rename authorization package

* Fix swagger gen

* CODEOWNERS

* Use itf instead of impl

---------

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2024-06-13 11:41:35 +02:00
Ryan McKinley
99d8025829 Chore: Move identity and errutil to apimachinery module (#89116) 2024-06-13 07:11:35 +03:00
Ryan McKinley
3ae95a6eb1 K8s: Update grafana resource metadata accessor (#89074) 2024-06-12 14:39:37 +03:00
Marcus Efraimsson
2403665998 Chore: Remove legacydata package (#88790)
* Chore: Remove legacydata package

* remove unused dependency

* sdk v0.234.0
2024-06-05 22:31:06 +02:00
Carl Bergquist
16cc75b02c Scopes: Add Handler for returning dashboards related to a list of scopes. (#87758)
- Adds a find endpoint to return dashboard bindings that match any of the scopes. For example /apis/scope.grafana.app/v0alpha1/namespaces/default/find/scope_dashboard_bindings?scope=s1&scope=s2
- Updates the ScopeNode find endpoint to a new path, /find/scope_node_children , makes the key "items" for all find endpoints (instead of mix of "found" and "items"), and makes the list item type a ScopeNode instead of its own type.
- Updates kubectl get commands to return more information about scopes, scopenodes, and scopedashboard bindings to display more fields in table output

---------

Signed-off-by: bergquist <carl.bergquist@gmail.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Kyle Brandt <kyle@grafana.com>
Co-authored-by: Todd Treece <todd.treece@grafana.com>
2024-06-05 11:47:36 -04:00
Ryan McKinley
41e0430f83 K8s/Dashboards: Add frontend api to switch between implementations (#88632) 2024-06-05 17:34:23 +03:00
Ryan McKinley
b640b6e8d1 K8s: Improve k8s dashboard query (#88629) 2024-06-05 11:21:51 +03:00
Carl Bergquist
c99fe4f970 Scopes: Add DashboardTitle to scopedashboardbinding (#88609)
scopes: add title to scopedashboardbinding

Signed-off-by: bergquist <carl.bergquist@gmail.com>
2024-06-04 10:36:03 +03:00
Arati R
36f42853dd Storage: Read desired mode from config instead of feature flags (#88353)
* Read desired mode from config
* Update playlist integration tests
* Add mode 1 playlist integration tests
* Add mode 0 dual writing to playlist integration tests
* Add documentation for the different dual writing modes
2024-05-31 19:29:59 +02:00
Leonor Oliveira
ade96dbdbd Introduce Comparator interface (#88016)
* Introduce Comparator interface

* Add compare implementation everywhere

* Add comment explaining what Compare should do

* Lint
2024-05-29 09:42:24 +02:00
Marcus Efraimsson
0b1aec6767 Tracing: Various improvements (#88308) 2024-05-27 14:21:40 +02:00
Ryan McKinley
42b0f802de QueryTypes: Add feature toggle to show query types in datasource apiservers (#88213)
* initial attempt

* show query types

* show query types

* with formatting

* with formatting

* more cleanup

* add feature toggle

* fix build
2024-05-23 18:46:28 +02:00
Arati R
0ffc4c441b Storage: Add mode reconciliation for modes 1 and 2 (#87919)
* Add skeleton implementation for mode reconciliation between 1 and 2
* Track mode for each dual writer
* Add test for setting dual writer
* Include context when setting dual writing mode

---------

Co-authored-by: Dan Cech <dcech@grafana.com>
2024-05-23 00:12:46 +02:00
Marcus Efraimsson
8ea0b336d5 API Server: Include traceID in HTTP request logs (#88179) 2024-05-22 17:56:34 +02:00
Marcus Efraimsson
9e6f18c947 API Server: Add temporary request log for queries (#88103) 2024-05-21 13:07:47 +02:00
Ryan McKinley
6d10797812 Errors: Update errutil to be compatible with k8s errors (#87605) 2024-05-20 18:11:37 +03:00
Arati R
6836bfe1ea Storage: Customise setting dual writing modes (#87668)
* Add feature toggles for mode 2 and 3 playlist dual writing
* Make current mode customised based on kind
* Check feature flags when initialising dual writer
* Fix linting
* Refactor NewDualWriter
2024-05-14 14:11:56 +02:00
Carl Bergquist
3160a4d909 ScopeNodes: Add naive filter functionality for scopenode.titles (#87721) 2024-05-13 18:21:09 +03:00
Ryan McKinley
f880abc292 QueryService: Move raw http.Handler to rest.Connector (#87595)
* query connector

* improve error wrappers

* return 400 for missing datasource (not 404)

* fix errors

* message
2024-05-10 21:01:17 +03:00
Kyle Brandt
baed7d6dbe Scopes: Fix logic in find call (#87565)
With Find, if the parent query parameter is empty or not provided, we want to list the top level of the forest.
2024-05-09 11:52:56 -04:00