1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-21 11:48:53 +00:00

add log level and format fields to thanos sidecar

This commit is contained in:
Paul Gier 2020-04-02 11:57:57 -05:00
parent 7ebf899f97
commit 9caf7f0e33
2 changed files with 11 additions and 0 deletions
pkg
apis/monitoring/v1
prometheus

View file

@ -429,6 +429,10 @@ type ThanosSpec struct {
// Note: Currently only the CAFile, CertFile, and KeyFile fields are supported.
// Maps to the '--grpc-server-tls-*' CLI args.
GRPCServerTLSConfig *TLSConfig `json:"grpcServerTlsConfig,omitempty"`
// LogLevel for Thanos sidecar to be configured with.
LogLevel string `json:"logLevel,omitempty"`
// LogFormat for Thanos sidecar to be configured with.
LogFormat string `json:"logFormat,omitempty"`
}
// RemoteWriteSpec defines the remote_write configuration for prometheus.

View file

@ -740,6 +740,13 @@ func makeStatefulSetSpec(p monitoringv1.Prometheus, c *Config, ruleConfigMapName
fmt.Sprintf("--http-address=%s:10902", bindAddress),
}
if p.Spec.Thanos.LogLevel != "" {
thanosArgs = append(thanosArgs, "--log.level="+p.Spec.Thanos.LogLevel)
}
if p.Spec.Thanos.LogFormat != "" {
thanosArgs = append(thanosArgs, "--log.format="+p.Spec.Thanos.LogFormat)
}
if p.Spec.Thanos.GRPCServerTLSConfig != nil {
tls := p.Spec.Thanos.GRPCServerTLSConfig
if tls.CertFile != "" {