Skip to content

Commit

Permalink
Add Results Prometheus histogram config
Browse files Browse the repository at this point in the history
This adds the PROMETHEUS_HISTOGRAM configuration option existing in
Tekton Results.
  • Loading branch information
enarha committed Oct 30, 2024
1 parent 57b7385 commit 50d3c05
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/apis/operator/v1alpha1/tektonresult_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ type ResultsAPIProperties struct {
DBEnableAutoMigration *bool `json:"db_enable_auto_migration,omitempty"`
ServerPort *int64 `json:"server_port,omitempty"`
PrometheusPort *int64 `json:"prometheus_port,omitempty"`
PrometheusHistogram *bool `json:"prometheus_histogram,omitempty"`
LogLevel string `json:"log_level,omitempty"`
LogsAPI *bool `json:"logs_api,omitempty"`
LogsType string `json:"logs_type,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ data:
DB_PORT=5432
SERVER_PORT=8080
PROMETHEUS_PORT=9090
PROMETHEUS_HISTOGRAM=true
DB_NAME=
DB_SSLMODE=disable
DB_ENABLE_AUTO_MIGRATION=true
Expand Down
5 changes: 4 additions & 1 deletion pkg/reconciler/kubernetes/tektonresult/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ func Test_updateApiConfig(t *testing.T) {
TLSHostnameOverride: "localhostTest",
AuthDisable: &boolVal,
AuthImpersonate: &boolVal,
PrometheusPort: &intVal,
PrometheusHistogram: &boolVal,
LogLevel: "warn",
LogsAPI: &boolVal,
LogsPath: "/logs/test",
Expand All @@ -105,7 +107,8 @@ func Test_updateApiConfig(t *testing.T) {
assert.Equal(t, cm.Data["config"], `DB_HOST=localhost
DB_PORT=5432
SERVER_PORT=12345
PROMETHEUS_PORT=9090
PROMETHEUS_PORT=12345
PROMETHEUS_HISTOGRAM=true
DB_NAME=test
DB_SSLMODE=enable
DB_ENABLE_AUTO_MIGRATION=true
Expand Down

0 comments on commit 50d3c05

Please sign in to comment.