Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Fargher <proglottis@gmail.com>2022-02-02 00:09:31 +0300
committerJames Fargher <proglottis@gmail.com>2022-02-02 00:09:31 +0300
commit64435b58d489e36fa923d2586ce544fc3ac01b42 (patch)
tree728d7aa9b4fe54446f16557e255f2ba99af9ff81
parente9c63af59d5080ebb76a9e73365319651b9a0b11 (diff)
parent22820f98ac055eab711e94922635f8c6bafe33d6 (diff)
Merge branch 'wc-exclude-default' into 'master'
config: Exclude DB metrics by default See merge request gitlab-org/gitaly!4300
-rw-r--r--internal/praefect/config/config.go3
-rw-r--r--internal/praefect/config/config_test.go9
2 files changed, 8 insertions, 4 deletions
diff --git a/internal/praefect/config/config.go b/internal/praefect/config/config.go
index b4e28cf48..9d128a862 100644
--- a/internal/praefect/config/config.go
+++ b/internal/praefect/config/config.go
@@ -126,7 +126,7 @@ type Config struct {
// PrometheusExcludeDatabaseFromDefaultMetrics excludes database-related metrics from the
// default metrics. If set to `false`, then database metrics will be available both via
// `/metrics` and `/db_metrics`. Otherwise, they will only be accessible via `/db_metrics`.
- // Defaults to `false`. This is used as a transitory configuration key: eventually, database
+ // Defaults to `true`. This is used as a transitory configuration key: eventually, database
// metrics will always be removed from the standard metrics endpoint.
PrometheusExcludeDatabaseFromDefaultMetrics bool `toml:"prometheus_exclude_database_from_default_metrics,omitempty"`
Auth auth.Config `toml:"auth,omitempty"`
@@ -167,6 +167,7 @@ func FromFile(filePath string) (Config, error) {
Reconciliation: DefaultReconciliationConfig(),
Replication: DefaultReplicationConfig(),
Prometheus: prometheus.DefaultConfig(),
+ PrometheusExcludeDatabaseFromDefaultMetrics: true,
// Sets the default Failover, to be overwritten when deserializing the TOML
Failover: Failover{Enabled: true, ElectionStrategy: ElectionStrategyPerRepository},
RepositoriesCleanup: DefaultRepositoriesCleanup(),
diff --git a/internal/praefect/config/config_test.go b/internal/praefect/config/config_test.go
index 45c5daad0..d3c8e3cfb 100644
--- a/internal/praefect/config/config_test.go
+++ b/internal/praefect/config/config_test.go
@@ -291,6 +291,7 @@ func TestConfigParsing(t *testing.T) {
ScrapeTimeout: time.Second,
GRPCLatencyBuckets: []float64{0.1, 0.2, 0.3},
},
+ PrometheusExcludeDatabaseFromDefaultMetrics: true,
DB: DB{
Host: "1.2.3.4",
Port: 5432,
@@ -345,7 +346,8 @@ func TestConfigParsing(t *testing.T) {
SchedulingInterval: 0,
HistogramBuckets: []float64{1, 2, 3, 4, 5},
},
- Prometheus: prometheus.DefaultConfig(),
+ Prometheus: prometheus.DefaultConfig(),
+ PrometheusExcludeDatabaseFromDefaultMetrics: true,
Replication: Replication{BatchSize: 1, ParallelStorageProcessingWorkers: 2},
Failover: Failover{
Enabled: false,
@@ -366,8 +368,9 @@ func TestConfigParsing(t *testing.T) {
expected: Config{
GracefulStopTimeout: config.Duration(time.Minute),
Prometheus: prometheus.DefaultConfig(),
- Reconciliation: DefaultReconciliationConfig(),
- Replication: DefaultReplicationConfig(),
+ PrometheusExcludeDatabaseFromDefaultMetrics: true,
+ Reconciliation: DefaultReconciliationConfig(),
+ Replication: DefaultReplicationConfig(),
Failover: Failover{
Enabled: true,
ElectionStrategy: ElectionStrategyPerRepository,