Skip to content

Commit

Permalink
add PromqlEngine switch
Browse files Browse the repository at this point in the history
Signed-off-by: frezes <[email protected]>
  • Loading branch information
frezes committed Sep 19, 2023
1 parent ef731a0 commit 5c845d8
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/whizard/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ maintainers:
email: [email protected]
- name: junot
email: [email protected]
version: 0.9.3
version: 0.9.4
appVersion: "latest"
2 changes: 2 additions & 0 deletions charts/whizard/crds/monitoring.whizard.io_queries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1008,6 +1008,8 @@ spec:
type: string
description: Define which Nodes the Pods are scheduled on.
type: object
promqlEngine:
type: string
replicaLabelNames:
description: Labels to treat as a replica indicator along which data
is deduplicated.
Expand Down
4 changes: 4 additions & 0 deletions charts/whizard/templates/query/query.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ spec:
{{- end }}
replicas: {{ .Values.query.replicas }}

{{- if .Values.query.promqlEngine }}
promqlEngine: {{ .Values.query.promqlEngine }}
{{- end }}

{{- with .Values.query.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 4 }}
Expand Down
2 changes: 2 additions & 0 deletions charts/whizard/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,8 @@ query:
# repository: thanosio/thanos
# tag: v0.28.0

promqlEngine: thanos

resources: {}
securityContext: {}
nodeSelector: {}
Expand Down
2 changes: 2 additions & 0 deletions config/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3285,6 +3285,8 @@ spec:
type: string
description: Define which Nodes the Pods are scheduled on.
type: object
promqlEngine:
type: string
replicaLabelNames:
description: Labels to treat as a replica indicator along which data is deduplicated.
items:
Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/monitoring.whizard.io_queries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1008,6 +1008,8 @@ spec:
type: string
description: Define which Nodes the Pods are scheduled on.
type: object
promqlEngine:
type: string
replicaLabelNames:
description: Labels to treat as a replica indicator along which data
is deduplicated.
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/monitoring/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ type QuerySpec struct {

HTTPServerTLSConfig *HTTPServerTLSConfig `json:"httpServerTLSConfig,omitempty"`

PromqlEngine string `json:"promqlEngine,omitempty"`

// Additional StoreApi servers from which Query component queries from
Stores []QueryStores `json:"stores,omitempty"`
// Selector labels that will be exposed in info endpoint.
Expand Down
74 changes: 74 additions & 0 deletions pkg/api/monitoring/v1alpha1/zz_generated.deepcopy.go

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

4 changes: 4 additions & 0 deletions pkg/controllers/monitoring/resources/query/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ func (q *Query) deployment() (runtime.Object, resources.Operation, error) {
d.Spec.Template.Spec.Volumes = append(d.Spec.Template.Spec.Volumes, volumes...)
}

if q.query.Spec.PromqlEngine != "" {
queryContainer.Args = append(queryContainer.Args, "--query.promql-engine="+q.query.Spec.PromqlEngine)
}

if q.query.Spec.LogLevel != "" {
queryContainer.Args = append(queryContainer.Args, "--log.level="+q.query.Spec.LogLevel)
}
Expand Down

0 comments on commit 5c845d8

Please sign in to comment.