mirror of
https://github.com/prometheus-operator/prometheus-operator.git
synced 2025-04-21 11:48:53 +00:00
prometheus: Add ability to specify log level
This commit is contained in:
parent
698aefe37a
commit
02621aad10
3 changed files with 7 additions and 0 deletions
|
@ -191,6 +191,7 @@ Specification of the desired behavior of the Prometheus cluster. More info: http
|
|||
| imagePullSecrets | An optional list of references to secrets in the same namespace to use for pulling prometheus and alertmanager images from registries see http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod | [][v1.LocalObjectReference](https://v1-6.docs.kubernetes.io/docs/api-reference/v1.6/#localobjectreference-v1-core) | false |
|
||||
| replicas | Number of instances to deploy for a Prometheus deployment. | *int32 | false |
|
||||
| retention | Time duration Prometheus shall retain data for. | string | false |
|
||||
| logLevel | Log level for Prometheus be configured in. | string | false |
|
||||
| scrapeInterval | Interval between consecutive scrapes. | string | false |
|
||||
| evaluationInterval | Interval between consecutive evaluations. | string | false |
|
||||
| externalLabels | The labels to add to any time series or alerts when communicating with external systems (federation, remote storage, Alertmanager). | map[string]string | false |
|
||||
|
|
|
@ -71,6 +71,8 @@ type PrometheusSpec struct {
|
|||
Replicas *int32 `json:"replicas,omitempty"`
|
||||
// Time duration Prometheus shall retain data for.
|
||||
Retention string `json:"retention,omitempty"`
|
||||
// Log level for Prometheus be configured in.
|
||||
LogLevel string `json:"logLevel,omitempty"`
|
||||
// Interval between consecutive scrapes.
|
||||
ScrapeInterval string `json:"scrapeInterval,omitempty"`
|
||||
// Interval between consecutive evaluations.
|
||||
|
|
|
@ -374,6 +374,10 @@ func makeStatefulSetSpec(p monitoringv1.Prometheus, c *Config, ruleConfigMaps []
|
|||
}
|
||||
promArgs = append(promArgs, "-web.route-prefix="+webRoutePrefix)
|
||||
|
||||
if p.Spec.LogLevel != "" && p.Spec.LogLevel != "info" {
|
||||
promArgs = append(promArgs, fmt.Sprintf("-log.level=%s", p.Spec.LogLevel))
|
||||
}
|
||||
|
||||
if version.Major == 2 {
|
||||
for i, a := range promArgs {
|
||||
promArgs[i] = "-" + a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue