Commit Graph

84 Commits

Author SHA1 Message Date
Todd Treece
9c6d3590a2
Chore: Fix apiserver circular dependencies (#89918) 2024-07-01 11:42:34 -04: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
Todd Treece
71270f3203
Storage: Avoid relying on RequestInfo (#89635) 2024-06-25 10:06:03 -04:00
Leonor Oliveira
e216de56e6
Unified Storage: Always populate RV and UID on create (#89554) 2024-06-21 17:37:53 +01:00
Ryan McKinley
70cd002826
Storage: Make entity to runtime.Object conversion public (#89549)
* make conversion public

* make conversion public
2024-06-21 16:28:09 +03:00
Ryan McKinley
5e95c1bdf8
Storage: Move grpc helper from entity store to resource store (#89490) 2024-06-20 22:32:19 +03:00
Kevin Minehart
78e9226ad8
CI: Add bump-version action to the release PR workflow (#89491) 2024-06-20 13:15:09 -05:00
Ryan McKinley
27e800768e
K8s: Improve identity mapping setup (#89450) 2024-06-20 17:53:07 +03:00
Andres Martinez Gotor
5f44c97e5f
API Servers: Avoid crashing on panic (#89281) 2024-06-20 09:10:03 +02:00
Ryan McKinley
9b7f9ae22e
K8s: Rename origin.key to origin.hash (#89337) 2024-06-18 22:27:16 +03:00
Karl Persson
606a74d0af
Zanzana: Initial work to run openFGA as embedded or standalone service (#89211)
* Zanana: Initial work to run zanana as ebeddedn or standalone

* Add addr settings for when remote client is used.

* sync dependencies

* Lock mysql driver version
---------

Co-authored-by: Dan Cech <dcech@grafana.com>
2024-06-18 10:04:18 +02:00
Leonor Oliveira
1691d80412
Refactor enrichObj function (#89210) 2024-06-14 13:13:59 +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
Will Browne
74230937f4
Plugins: Update plugin SDK Go to 0.235.0 (#89153)
update plugin SDK go to 0.235.0
2024-06-13 15:14:39 +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
3ae95a6eb1
K8s: Update grafana resource metadata accessor (#89074) 2024-06-12 14:39:37 +03:00
Leonor Oliveira
b30c81b1ad
Add and fix tests for playlists in mode1 (#88543)
* Add and fix tests for playlists in mode1

* Make etcd tests pass mode1 for now

* Fix mode1 and add more tests for playlists in mode 1

* Remove repeated test

* Fix test setup
2024-06-10 16:11:01 +02:00
Todd Treece
22989acf95
K8s: Improve response writer error handling (#88926)
---------

Co-authored-by: Diego Augusto Molina <diegoaugustomolina@gmail.com>
2024-06-07 16:10:02 -04:00
Isabella Siu
cd15e9732d
Cloudwatch: Use the metric map from grafana-aws-sdk (#88733) 2024-06-06 21:25:54 +03:00
Dave Henderson
ca1379bad3
chore: A few updates for the pkg/build/wire fork (#88813)
* chore: A few updates for the pkg/build/wire fork

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* chore: run go work sync

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

---------

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
2024-06-06 16:09:27 +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
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
Leonor Oliveira
ef07dfa3bb
Add latency metrics to mode2 (#88011)
* Also call storage on mode1. Add metrics

* Update comment

* Don't use compare function for now

* Remove very important space

* Improve code readability on modes 1 and 2

* Fix tests

* Return error from legacy write

* Renume useless defer

* Start adding logging for mode2

* Retrurn errors is storage read fails

* Finish adding latency metrics to mode2

* Emit kind to metrics instead

* Fix var name

* Return if legacy delete list fails

* Unify latency calls

* Fix get function
2024-05-28 16:15:53 +02:00
Kyle Brandt
a738cb42d8
Prometheus: Update dependency to v0.52.0 (#87809)
* Prometheus: Update dependency to v0.52.0

* go work sync

* fix panics in tests

* go work sync

* prometheus v0.52.0

* handle errors

* Update pkg/services/ngalert/sender/sender_test.go

Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>

* Update pkg/services/ngalert/sender/sender_test.go

Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>

---------

Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
2024-05-28 15:22:20 +02:00
Leonor Oliveira
502bd5612e
Storage: Extract returned object hydration into function (#88012)
* Extract returned object hydration into function

* Finish writing tests for utils func

* Lint

* Update pkg/apiserver/rest/dualwriter_mode2.go

Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com>

* Better var naming

* Remove duplicated logic

* Lint

* Fix test

* Lint

* Make type private

* Fix one more test

* Fix test

---------

Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com>
2024-05-28 15:14:27 +02:00
Giuseppe Guerra
2b54ce6c51
Chore: Bump google.golang.org/grpc to 1.64.0 (#88219)
* Bump google.golang.org/grpc to 1.64.0

* Address grpc.Dial deprecation notices

* go mod tidy

* Update go.work.sum

* go work sync
2024-05-27 12:44:39 +02:00
Ryan McKinley
ffc2702552
Plugins: Support Admission validation hooks (#87718) 2024-05-24 18:45:16 +03: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
Scott Lepper
cac40795a5
sql expressions - logging (#88193)
* sql expressions - logging
2024-05-22 17:18:46 -04:00
Marcus Efraimsson
8ea0b336d5
API Server: Include traceID in HTTP request logs (#88179) 2024-05-22 17:56:34 +02:00
Leonor Oliveira
dd771e818e
Also call storage on mode1. Measure latency (#87739)
* Also call storage on mode1. Add metrics

* Update comment

* Don't use compare function for now

* Remove very important space

* Finish add logging in mode2.
Also call US in mode1 in a non blocking way

* Improve code readability on modes 1 and 2

* Fix tests

* Rename vars

* Lint

* Return error from legacy write

* Renume useless defer

* [REVIEW] improvements

* Pass kind instead of name

* Use kind instead of name in metrics

* Only call latency metrics once

* Return error on writes to legacystore in mode1

* Move accesssor logic into the goroutine as well
2024-05-22 10:23:29 +02: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
Andres Martinez Gotor
ae152af119
Upgrade grafana-plugin-sdk-go to v0.230.0 (#87706) 2024-05-13 13:23:30 +02:00
Leonor Oliveira
b214f9cc3a
Add metrics utils to the dualwriter (#87693)
* Add metrics utils

* Ignore lint temporarily

* Lint
2024-05-13 11:36:24 +02: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
Stephanie Hingtgen
1bc6738d92
Chore: Upgrade go from 1.21.0 to 1.21.10 (#87479) 2024-05-09 15:57:08 +03:00
Todd Treece
6e4d35e1ee
Scopes: Add a /find query endpoint (#87457)
---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-05-08 13:35:11 -04:00
Todd Treece
f342217158
K8s: Add path rewriter filter (#87456) 2024-05-08 18:08:43 +03:00
Marcus Efraimsson
41b29ff93c
Chore: Migrate to use buf for protobuf generation (#87407)
* Chore: Migrate to use buf for protobuf generation

* fix codeowners

* fixes after review

* docs/tooling for installing buf

* add back codeowners

* Update upgrading-dependencies.md

Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>

* sdk v0.229.0

---------

Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
2024-05-08 15:42:40 +02:00
Karl Persson
2d8570e85e
IDToken: Reuse claims from authlib (#87437)
* bump authlib version

* Reuse claims from authlib
2024-05-07 16:46:43 +02:00
Leonor Oliveira
ee2f6a7b49
Force interface implementation also on legacy storage (#87414)
* Force interface implementation also on legacy storage

* Add DeleteCollection to folders and dashboards

* Fix integration tests

* Fix tests
2024-05-07 15:02:30 +02:00
Leonor Oliveira
0a2c5065a0
Choose mode. Turn DualWriter into a real interface. Better Logging (#87291)
* Choose mode. Add log field on top level dualwriter

* Add logs

* Turn DualWriter into a full interface. Fix tests

* Lint

* Use struct for dualWriter interface

* Use struct

* Default should be legacyStore for all entities

* Fix test. Get rid of extra concrete type

* Remove comment

* Add comment

* Temp set dualwriter mode 2 for playlists while configs are not in place

* Add modes type + add comment on what each mode does

* Don't require watcher interface for now

* Use storage implementation on mode 2

* Update pkg/apiserver/rest/dualwriter_mode2.go

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>

* Pass log values to the context

* test

* Update pkg/apiserver/rest/dualwriter_mode3.go

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

---------

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
Co-authored-by: Dan Cech <dcech@grafana.com>
2024-05-06 23:18:28 +02:00
Arati R
9e6de035c0
Storage: Add mode 2 dual writing improvements (#87204)
* Fix mode 2 List test
* Set origin timestamp during conversion to k8s resource
* Add instructions for updating a playlist
* Handle partial deletions of a collection in mode 2
2024-05-02 16:06:51 +02:00
Arati R
61f3d08c3f
Storage: Add List support for pagination (#87093)
* Add origin keys to List request
* Check origin keys requirement in the sql entity server's List method
* Refactor mode 2 List
* Check origin keys before making Storage List call

---------

Co-authored-by: Dan Cech <dcech@grafana.com>
2024-05-01 08:42:47 +02:00
Marcus Efraimsson
2fc99375df
Chore: Upgrade otel dependencies (#86994)
* Chore: Upgrade otel dependencies

* sdk changes

* ignore deprecated go.opentelemetry.io/otel/exporters/jaeger for now

* use latest commit from sdk branch

* sdk v0.228.0
2024-04-30 15:12:45 +02:00
Marcus Efraimsson
fbcb9a3677
Chore: Upgrade/fix deps after thema removal (#86763)
* Chore: Upgrade/fix deps after thema removal

* github.com/deepmap/oapi-codegen v1.14.0

* github.com/deepmap/oapi-codegen v1.15.0

* github.com/deepmap/oapi-codegen v1.16.0

* fix for dep used in enterprise

* github.com/deepmap/oapi-codegen/v2 v2.0.0

* oapi-codegen/v2 v2.1.0, kin-openapi v0.122.0, sdk

* keep kin-openapi at v0.122.0 and allow SDK to use v0.124.0

* remove github.com/deepmap/oapi-codegen v1 dep

* fix owner

* add back github.com/deepmap/oapi-codegen v1 dep

* upgrade github.com/influxdata/influxdb-client-go/v2 to get rid of deepmap/oapi-codegen

* migrate to oapi-codegen/runtime

* sdk

* sdk v0.227.0
2024-04-25 20:52:09 +02:00
Marcus Efraimsson
ac152ca416
Chore: Upgrade grpc-ecosystem/go-grpc-middleware to v2 (#86724)
* Chore: Replace deprecated prometheus grpc middleware

* go mod tidy without enterprise

* with updated sdk branch

* sdk v0.226.0

* remove deprecated opentracing support for outgoing plugin requests

* migrate to github.com/grpc-ecosystem/go-grpc-middleware/v2

* fix
2024-04-25 17:25:48 +02:00
George Robinson
c049e5bbfc
Alerting: Update grafana/alerting to bb4f4f4 (#86827) 2024-04-25 10:47:01 +01:00