Skip to content

Commit

Permalink
docs: add timeout attribute in the prometheus docs
Browse files Browse the repository at this point in the history
Signed-off-by: AhmedGrati <[email protected]>
  • Loading branch information
TessaIO committed Jul 23, 2023
1 parent 55765a7 commit 44f66e2
Show file tree
Hide file tree
Showing 9 changed files with 541 additions and 508 deletions.
1 change: 1 addition & 0 deletions docs/analysis/prometheus.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
provider:
prometheus:
address: http://prometheus.example.com:9090
timeout: 40
query: |
sum(irate(
istio_requests_total{reporter="source",destination_service=~"{{args.service-name}}",response_code!~"5.*"}[5m]
Expand Down
3 changes: 3 additions & 0 deletions docs/features/kustomize/rollout_cr_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4282,6 +4282,7 @@
"type": "string"
},
"timeout": {
"format": "int64",
"type": "integer"
}
},
Expand Down Expand Up @@ -8675,6 +8676,7 @@
"type": "string"
},
"timeout": {
"format": "int64",
"type": "integer"
}
},
Expand Down Expand Up @@ -13068,6 +13070,7 @@
"type": "string"
},
"timeout": {
"format": "int64",
"type": "integer"
}
},
Expand Down
1 change: 1 addition & 0 deletions manifests/crds/analysis-run-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2780,6 +2780,7 @@ spec:
query:
type: string
timeout:
format: int64
type: integer
type: object
skywalking:
Expand Down
1 change: 1 addition & 0 deletions manifests/crds/analysis-template-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2776,6 +2776,7 @@ spec:
query:
type: string
timeout:
format: int64
type: integer
type: object
skywalking:
Expand Down
1 change: 1 addition & 0 deletions manifests/crds/cluster-analysis-template-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2776,6 +2776,7 @@ spec:
query:
type: string
timeout:
format: int64
type: integer
type: object
skywalking:
Expand Down
3 changes: 3 additions & 0 deletions manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2781,6 +2781,7 @@ spec:
query:
type: string
timeout:
format: int64
type: integer
type: object
skywalking:
Expand Down Expand Up @@ -5742,6 +5743,7 @@ spec:
query:
type: string
timeout:
format: int64
type: integer
type: object
skywalking:
Expand Down Expand Up @@ -8589,6 +8591,7 @@ spec:
query:
type: string
timeout:
format: int64
type: integer
type: object
skywalking:
Expand Down
20 changes: 20 additions & 0 deletions metricproviders/prometheus/prometheus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,3 +493,23 @@ func TestNewPrometheusAddressNotConfigured(t *testing.T) {
assert.NotNil(t, err)
log.Infof("api:%v", api)
}

func TestNewPrometheusNegativeTimeout(t *testing.T) {
e := log.Entry{}
mock := mockAPI{
value: newScalar(10),
}
timeout := int64(-20)
metric := v1alpha1.Metric{
Name: "foo",
Provider: v1alpha1.MetricProvider{
Prometheus: &v1alpha1.PrometheusMetric{
Query: "test",
Timeout: &timeout,
},
},
}
p, err := NewPrometheusProvider(mock, e, metric)
assert.NotNil(t, err)
assert.Nil(t, p)
}
1,017 changes: 510 additions & 507 deletions pkg/apis/rollouts/v1alpha1/generated.pb.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/apis/rollouts/v1alpha1/openapi_generated.go

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

0 comments on commit 44f66e2

Please sign in to comment.