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

Merge pull request from mxinden/am-log-level

Make AM log level configurable
This commit is contained in:
Frederic Branczyk 2018-04-09 10:20:19 +02:00 committed by GitHub
commit fa10f2751c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 21 additions and 4 deletions
Documentation
example/prometheus-operator-crd
pkg
alertmanager
client/monitoring/v1

View file

@ -92,6 +92,7 @@ Specification of the desired behavior of the Alertmanager cluster. More info: ht
| baseImage | Base image that is used to deploy pods, without tag. | string | false |
| 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 |
| secrets | Secrets is a list of Secrets in the same namespace as the Alertmanager object, which shall be mounted into the Alertmanager Pods. The Secrets are mounted into /etc/alertmanager/secrets/<secret-name>. | []string | false |
| logLevel | Log level for Alertmanager to be configured with. | string | false |
| replicas | Size is the expected size of the alertmanager cluster. The controller will eventually make the size of the running cluster equal to the expected size. | *int32 | false |
| storage | Storage is the definition of how storage will be used by the Alertmanager instances. | *[StorageSpec](#storagespec) | false |
| externalUrl | The external URL the Alertmanager instances will be available under. This is necessary to generate correct URLs. This is necessary if Alertmanager is not served from root of a DNS name. | string | false |
@ -203,7 +204,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 |
| logLevel | Log level for Prometheus to be configured with. | 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 |

View file

@ -1280,6 +1280,9 @@ spec:
so that it does not bind against the Pod IP. Note this is only for
the Alertmanager UI, not the gossip communication.
type: boolean
logLevel:
description: Log level for Alertmanager to be configured with.
type: string
nodeSelector:
description: Define which Nodes the Pods are scheduled on.
type: object

View file

@ -1340,7 +1340,7 @@ spec:
so that it does not bind against the Pod IP.
type: boolean
logLevel:
description: Log level for Prometheus be configured in.
description: Log level for Prometheus to be configured with.
type: string
nodeSelector:
description: Define which Nodes the Pods are scheduled on.

View file

@ -194,6 +194,10 @@ func makeStatefulSetSpec(a *monitoringv1.Alertmanager, config Config) (*appsv1.S
}
amArgs = append(amArgs, fmt.Sprintf("--web.route-prefix=%v", webRoutePrefix))
if a.Spec.LogLevel != "" && a.Spec.LogLevel != "info" {
amArgs = append(amArgs, fmt.Sprintf("--log.level=%s", a.Spec.LogLevel))
}
localReloadURL := &url.URL{
Scheme: "http",
Host: "localhost:9093",

View file

@ -245,6 +245,13 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
},
},
},
"logLevel": {
SchemaProps: spec.SchemaProps{
Description: "Log level for Alertmanager to be configured with.",
Type: []string{"string"},
Format: "",
},
},
"replicas": {
SchemaProps: spec.SchemaProps{
Description: "Size is the expected size of the alertmanager cluster. The controller will eventually make the size of the running cluster equal to the expected size.",
@ -733,7 +740,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
},
"logLevel": {
SchemaProps: spec.SchemaProps{
Description: "Log level for Prometheus be configured in.",
Description: "Log level for Prometheus to be configured with.",
Type: []string{"string"},
Format: "",
},

View file

@ -75,7 +75,7 @@ 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.
// Log level for Prometheus to be configured with.
LogLevel string `json:"logLevel,omitempty"`
// Interval between consecutive scrapes.
ScrapeInterval string `json:"scrapeInterval,omitempty"`
@ -410,6 +410,8 @@ type AlertmanagerSpec struct {
// object, which shall be mounted into the Alertmanager Pods.
// The Secrets are mounted into /etc/alertmanager/secrets/<secret-name>.
Secrets []string `json:"secrets,omitempty"`
// Log level for Alertmanager to be configured with.
LogLevel string `json:"logLevel,omitempty"`
// Size is the expected size of the alertmanager cluster. The controller will
// eventually make the size of the running cluster equal to the expected
// size.