Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Dan Cech <dcech@grafana.com>
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
This adds a version of the SQLStore that includes a ReadReplica. The primary DB can be accessed directly - from the caller's standpoint, there is no difference between the SQLStore and ReplStore unless they wish to explicitly call the ReadReplica() and use that for the DB sessions.
Currently only the stats service GetSystemStats and GetAdminStats are using the ReadReplica(); if it's misconfigured or if the databaseReadReplica feature flag is not turned on, it will fall back to the usual (SQLStore) behavior.
Testing requires a database and read replica - the replication should already be configured. I have been testing this locally with a docker mysql setup (https://medium.com/@vbabak/docker-mysql-master-slave-replication-setup-2ff553fceef2) and the following config:
[feature_toggles]
databaseReadReplica = true
[database]
type = mysql
name = grafana
user = grafana
password = password
host = 127.0.0.1:3306
[database_replica]
type = mysql
name = grafana
user = grafana
password = password
host = 127.0.0.1:3307
* 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>
* make the config sync happen on each call to ApplyConfig(), fix tests
* send autogen config
* add fake autogen function for tests
* update stale comments, tidy things up, make linter happy
* add auto-gen routes only if the feature toggle is enabled
* remove unnecessary fake autogen function
* throttle configuration syncs
* restore pkg/services/store/entity/sqlstash/sql_storage_server.go
* test sync loop in ApplyConfig, skip invalid autogen routes
* restore conf/defaults.ini
* restore conf/defaults.ini
* avoid skipping invalid auto-gen routes in SaveAndApplyConfig
* test that autogenFn is called and its errors are returned
* add debug message about the sync interval not having elapsed
* collapse two log lines into one
* Calculate row height
* Move things around
* Update getItemSize to use text bounding box
* Update types
* Cleanups and reminders
* Calculate line height
* Update line height calculation
* Remove debugging
* Add cell option editing
* Prettier
* Use field configured for text wrapping
* Add TODO
* Make sure column configuration is correct
* Update height heuristic and hover behavior
* Disable overflow on hover with text wrapping
* Update heuristic
* Clean things up
* Color background cell options
* Fix tests
* Prettier
* React deps
* Remove old hook dep
* Fix type errors
* Update label and description for editor
* Fix non-wrapped case
* Make sure color background works
* Prettier
* Address review comments
* fix prettier
* Add heuristic for field sizing
* Fix up logic
* Prettier
* Fix test
* Oh prettier 🙈
* Don't wrap text on non-string fields
* Add wrapping to color text cell
* Prettier
* Fix option not showing for auto cell type
* Move longest field guessing into function
* Clean things up
* Add tests
* Make sure text won't flake
* Prettier
* Remove spurious import
* Ignore any in this case
* Add alpha label
* Prettier
* Fix typecheck
* Fix crash when sampling when there are undefined records
* Update heuristic to take into account long strings
* Prettier
* Update scale factors
* Update field index selection
* Prettier
---------
Co-authored-by: jev forsberg <jev.forsberg@grafana.com>
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
* return error early
* enable gzip between grafana and influxdb
* use json-iterator package for json operations
* revert gzip changes
* update test
* go mod tidy
go work sync
* 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>
* Alerting: Update grafana/alerting
* make tests pass by implementing yaml unmarshallers and deleting fields with omitempty in their yaml tags
* go mod tidy
* fix tests by implementing not calling GettableApiAlertingConfig.UnmarshalYAML from GettableApiAlertingConfig.UnmarshalJSON
* cleanup, reduce diff
* fix more tests
* update grafana/alerting to latest commit, delete global section from configs in tests
* bring back YAML unmarshaller for GettableApiAlertingConfig
* update alerting package dependency to point to main
* skip test for sns notifier
* 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>
* Load custom clouds from config file
* Update docs
* Use the correct list of clouds, add test, fix error condition handling
* Remove on custom cloud from sample.ini and docs
* Remove unnecessary else block
* Use cached json instead of serializing with each request
* Update grafana-azure-sdk-go version to v2.0.4
* update configure-grafana entry for clouds_config
* fix lint errors
* fix lint errors
---------
Co-authored-by: Jeremy Angel (from Dev Box) <jeremyangel@microsoft.com>
* 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>
* 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