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

prometheus: Make relabeling fields optional

This commit is contained in:
Frederic Branczyk 2018-04-03 11:26:18 +02:00
parent 71c6c5da4c
commit cc7ecdd8c7
No known key found for this signature in database
GPG key ID: 7741A52782A90069
5 changed files with 4 additions and 11 deletions
Documentation
example/prometheus-operator-crd
pkg/client/monitoring/v1

View file

@ -245,12 +245,12 @@ RelabelConfig allows dynamic rewriting of the label set, being applied to sample
| Field | Description | Scheme | Required |
| ----- | ----------- | ------ | -------- |
| sourceLabels | The source labels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the replace, keep, and drop actions. | []string | true |
| sourceLabels | The source labels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the replace, keep, and drop actions. | []string | false |
| separator | Separator placed between concatenated source label values. default is ';'. | string | false |
| targetLabel | Label to which the resulting value is written in a replace action. It is mandatory for replace actions. Regex capture groups are available. | string | false |
| regex | Regular expression against which the extracted value is matched. defailt is '(.*)' | string | false |
| modulus | Modulus to take of the hash of the source label values. | uint64 | false |
| replacement | Replacement value against which a regex replace is performed if the regular expression matches. Regex capture groups are available. Default is '$1' | string | true |
| replacement | Replacement value against which a regex replace is performed if the regular expression matches. Regex capture groups are available. Default is '$1' | string | false |
| action | Action to perform based on regex matching. Default is 'replace' | string | false |
[Back to TOC](#table-of-contents)

View file

@ -1832,9 +1832,6 @@ spec:
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string
required:
- sourceLabels
- replacement
type: array
required:
- url

View file

@ -123,9 +123,6 @@ spec:
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string
required:
- sourceLabels
- replacement
type: array
params:
description: Optional HTTP URL parameters

View file

@ -1010,7 +1010,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
},
},
},
Required: []string{"sourceLabels", "replacement"},
},
},
Dependencies: []string{},

View file

@ -238,7 +238,7 @@ type RelabelConfig struct {
//The source labels select values from existing labels. Their content is concatenated
//using the configured separator and matched against the configured regular expression
//for the replace, keep, and drop actions.
SourceLabels []string `json:"sourceLabels"`
SourceLabels []string `json:"sourceLabels,omitempty"`
//Separator placed between concatenated source label values. default is ';'.
Separator string `json:"separator,omitempty"`
//Label to which the resulting value is written in a replace action.
@ -250,7 +250,7 @@ type RelabelConfig struct {
Modulus uint64 `json:"modulus,omitempty"`
//Replacement value against which a regex replace is performed if the
//regular expression matches. Regex capture groups are available. Default is '$1'
Replacement string `json:"replacement"`
Replacement string `json:"replacement,omitempty"`
// Action to perform based on regex matching. Default is 'replace'
Action string `json:"action,omitempty"`
}