Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Results Prometheus histogram config #2387

Merged
merged 1 commit into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion docs/TektonResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ spec:
is_external_db: false
loki_stack_name: #optional
loki_stack_namespace: #optional

prometheus_port: 9090
prometheus_histogram: false
```

These properties are analogous to the one in configmap of tekton results api `tekton-results-api-config` documented at [api.md]:https://github.com/tektoncd/results/blob/4472848a0fb7c1473cfca8b647553170efac78a1/cmd/api/README.md
Expand Down Expand Up @@ -298,3 +299,9 @@ spec:
inputRefs: [ only-tekton ]
outputRefs: [ default ]
```

### Debugging

#### Debugging gRPC

Set `prometheus_histogram: true` to turns on recording of handling time of RPCs. Histogram metrics can be very expensive for Prometheus to retain and query. Disabled by default.
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"`
jkandasa marked this conversation as resolved.
Show resolved Hide resolved
LogLevel string `json:"log_level,omitempty"`
LogsAPI *bool `json:"logs_api,omitempty"`
LogsType string `json:"logs_type,omitempty"`
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/operator/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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