Skip to content

Bug 1897252: Add Thanos query log level #995

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

Merged
merged 5 commits into from
Nov 30, 2020
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [#970](https://github.com/openshift/cluster-monitoring-operator/pull/970) Bump prometheus-operator v0.43.0.
- [#971](https://github.com/openshift/cluster-monitoring-operator/pull/971) Enable `hwmon` in node-exporter for hardware sensor data collection
- [#983](https://github.com/openshift/cluster-monitoring-operator/pull/983) Remove deprecated user workload configuration
- [#995](https://github.com/openshift/cluster-monitoring-operator/pull/995) Add logLevel config field to Thanos Query.

## 4.6

Expand Down
1 change: 0 additions & 1 deletion assets/thanos-querier/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ spec:
containers:
- args:
- query
- --log.level=info
- --grpc-address=127.0.0.1:10901
- --http-address=127.0.0.1:9090
- --query.replica-label=prometheus_replica
Expand Down
2 changes: 1 addition & 1 deletion jsonnet/thanos-querier.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ local thanosQuerierRules =
if std.startsWith(a, '--grpc-address=') then '--grpc-address=127.0.0.1:10901'
else if std.startsWith(a, '--http-address=') then '--http-address=127.0.0.1:9090'
else a,
super.args
std.filter(function(a) !std.startsWith(a, "--log.level="), super.args)
) + [
'--grpc-client-tls-secure',
'--grpc-client-tls-cert=/etc/tls/grpc/client.crt',
Expand Down
4 changes: 2 additions & 2 deletions pkg/manifests/bindata.go

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

5 changes: 4 additions & 1 deletion pkg/manifests/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ type ThanosRulerConfig struct {
}

type ThanosQuerierConfig struct {
LogLevel string `json:"logLevel"`
NodeSelector map[string]string `json:"nodeSelector"`
Tolerations []v1.Toleration `json:"tolerations"`
Resources *v1.ResourceRequirements `json:"resources"`
Expand Down Expand Up @@ -428,6 +429,8 @@ func (c *Config) IsUserWorkloadEnabled() bool {
// and depracted from 4.7 onwards.
// Instead warn user in the logs.
func (c *UserWorkloadConfig) isEnabled() bool {
klog.Warning("DEPRECATED: Migrate to new user workload monitoring configuration, this tech preview was removed.")
if c.Enabled != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

klog.Warning("DEPRECATED: Migrate to new user workload monitoring configuration, this tech preview was removed.")
}
return false
}
3 changes: 3 additions & 0 deletions pkg/manifests/manifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -2645,6 +2645,9 @@ func (f *Factory) ThanosQuerierDeployment(grpcTLS *v1.Secret, enableUserWorkload
if f.config.ClusterMonitoringConfiguration.ThanosQuerierConfig.Resources != nil {
d.Spec.Template.Spec.Containers[i].Resources = *f.config.ClusterMonitoringConfiguration.ThanosQuerierConfig.Resources
}
if f.config.ClusterMonitoringConfiguration.ThanosQuerierConfig.LogLevel != "" {
d.Spec.Template.Spec.Containers[i].Args = append(d.Spec.Template.Spec.Containers[i].Args, fmt.Sprintf("--log.level=%s", f.config.ClusterMonitoringConfiguration.ThanosQuerierConfig.LogLevel))
}

case "prom-label-proxy":
d.Spec.Template.Spec.Containers[i].Image = f.config.Images.PromLabelProxy
Expand Down