mirror of
https://github.com/prometheus-operator/prometheus-operator.git
synced 2025-04-21 11:48:53 +00:00
feat: support scrape protocol 'PrometheusText1.0.0'
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
This commit is contained in:
parent
e3e8847d92
commit
95d4e4e725
27 changed files with 182 additions and 52 deletions
CHANGELOG.md
Documentation
bundle.yamlexample
prometheus-operator-crd-full
monitoring.coreos.com_podmonitors.yamlmonitoring.coreos.com_probes.yamlmonitoring.coreos.com_prometheusagents.yamlmonitoring.coreos.com_prometheuses.yamlmonitoring.coreos.com_scrapeconfigs.yamlmonitoring.coreos.com_servicemonitors.yaml
prometheus-operator-crd
jsonnet/prometheus-operator
podmonitors-crd.jsonprobes-crd.jsonprometheusagents-crd.jsonprometheuses-crd.jsonscrapeconfigs-crd.jsonservicemonitors-crd.json
pkg
|
@ -1,5 +1,6 @@
|
|||
## Unreleased
|
||||
|
||||
* [ENHANCEMENT] Add support for the `PrometheusText1.0.0` scrape protocol. #7085
|
||||
* [BUGFIX] Add `goGC` field to `PrometheusAgent` CRD. #6667
|
||||
|
||||
## 0.78.1 / 2024-10-30
|
||||
|
|
27
Documentation/api.md
generated
27
Documentation/api.md
generated
|
@ -1959,6 +1959,7 @@ Duration
|
|||
protocols supported by Prometheus in order of preference (from most to least preferred).</p>
|
||||
<p>If unset, Prometheus uses its default value.</p>
|
||||
<p>It requires Prometheus >= v2.49.0.</p>
|
||||
<p><code>PrometheusText1.0.0</code> requires Prometheus >= v3.0.0.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -6882,6 +6883,7 @@ Duration
|
|||
protocols supported by Prometheus in order of preference (from most to least preferred).</p>
|
||||
<p>If unset, Prometheus uses its default value.</p>
|
||||
<p>It requires Prometheus >= v2.49.0.</p>
|
||||
<p><code>PrometheusText1.0.0</code> requires Prometheus >= v3.0.0.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -11589,6 +11591,7 @@ Duration
|
|||
protocols supported by Prometheus in order of preference (from most to least preferred).</p>
|
||||
<p>If unset, Prometheus uses its default value.</p>
|
||||
<p>It requires Prometheus >= v2.49.0.</p>
|
||||
<p><code>PrometheusText1.0.0</code> requires Prometheus >= v3.0.0.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -14966,8 +14969,28 @@ Supported values are:
|
|||
* <code>OpenMetricsText0.0.1</code>
|
||||
* <code>OpenMetricsText1.0.0</code>
|
||||
* <code>PrometheusProto</code>
|
||||
* <code>PrometheusText0.0.4</code></p>
|
||||
* <code>PrometheusText0.0.4</code>
|
||||
* <code>PrometheusText1.0.0</code></p>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Value</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr><td><p>"OpenMetricsText0.0.1"</p></td>
|
||||
<td></td>
|
||||
</tr><tr><td><p>"OpenMetricsText1.0.0"</p></td>
|
||||
<td></td>
|
||||
</tr><tr><td><p>"PrometheusProto"</p></td>
|
||||
<td></td>
|
||||
</tr><tr><td><p>"PrometheusText0.0.4"</p></td>
|
||||
<td></td>
|
||||
</tr><tr><td><p>"PrometheusText1.0.0"</p></td>
|
||||
<td></td>
|
||||
</tr></tbody>
|
||||
</table>
|
||||
<h3 id="monitoring.coreos.com/v1.SecretOrConfigMap">SecretOrConfigMap
|
||||
</h3>
|
||||
<p>
|
||||
|
@ -18127,6 +18150,7 @@ Duration
|
|||
protocols supported by Prometheus in order of preference (from most to least preferred).</p>
|
||||
<p>If unset, Prometheus uses its default value.</p>
|
||||
<p>It requires Prometheus >= v2.49.0.</p>
|
||||
<p><code>PrometheusText1.0.0</code> requires Prometheus >= v3.0.0.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -25954,6 +25978,7 @@ Duration
|
|||
protocols supported by Prometheus in order of preference (from most to least preferred).</p>
|
||||
<p>If unset, Prometheus uses its default value.</p>
|
||||
<p>It requires Prometheus >= v2.49.0.</p>
|
||||
<p><code>PrometheusText1.0.0</code> requires Prometheus >= v3.0.0.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
16
bundle.yaml
generated
16
bundle.yaml
generated
|
@ -19706,11 +19706,13 @@ spec:
|
|||
* `OpenMetricsText1.0.0`
|
||||
* `PrometheusProto`
|
||||
* `PrometheusText0.0.4`
|
||||
* `PrometheusText1.0.0`
|
||||
enum:
|
||||
- PrometheusProto
|
||||
- OpenMetricsText0.0.1
|
||||
- OpenMetricsText1.0.0
|
||||
- PrometheusText0.0.4
|
||||
- PrometheusText1.0.0
|
||||
type: string
|
||||
type: array
|
||||
x-kubernetes-list-type: set
|
||||
|
@ -20476,11 +20478,13 @@ spec:
|
|||
* `OpenMetricsText1.0.0`
|
||||
* `PrometheusProto`
|
||||
* `PrometheusText0.0.4`
|
||||
* `PrometheusText1.0.0`
|
||||
enum:
|
||||
- PrometheusProto
|
||||
- OpenMetricsText0.0.1
|
||||
- OpenMetricsText1.0.0
|
||||
- PrometheusText0.0.4
|
||||
- PrometheusText1.0.0
|
||||
type: string
|
||||
type: array
|
||||
x-kubernetes-list-type: set
|
||||
|
@ -27733,6 +27737,8 @@ spec:
|
|||
If unset, Prometheus uses its default value.
|
||||
|
||||
It requires Prometheus >= v2.49.0.
|
||||
|
||||
`PrometheusText1.0.0` requires Prometheus >= v3.0.0.
|
||||
items:
|
||||
description: |-
|
||||
ScrapeProtocol represents a protocol used by Prometheus for scraping metrics.
|
||||
|
@ -27741,11 +27747,13 @@ spec:
|
|||
* `OpenMetricsText1.0.0`
|
||||
* `PrometheusProto`
|
||||
* `PrometheusText0.0.4`
|
||||
* `PrometheusText1.0.0`
|
||||
enum:
|
||||
- PrometheusProto
|
||||
- OpenMetricsText0.0.1
|
||||
- OpenMetricsText1.0.0
|
||||
- PrometheusText0.0.4
|
||||
- PrometheusText1.0.0
|
||||
type: string
|
||||
type: array
|
||||
x-kubernetes-list-type: set
|
||||
|
@ -39998,6 +40006,8 @@ spec:
|
|||
If unset, Prometheus uses its default value.
|
||||
|
||||
It requires Prometheus >= v2.49.0.
|
||||
|
||||
`PrometheusText1.0.0` requires Prometheus >= v3.0.0.
|
||||
items:
|
||||
description: |-
|
||||
ScrapeProtocol represents a protocol used by Prometheus for scraping metrics.
|
||||
|
@ -40006,11 +40016,13 @@ spec:
|
|||
* `OpenMetricsText1.0.0`
|
||||
* `PrometheusProto`
|
||||
* `PrometheusText0.0.4`
|
||||
* `PrometheusText1.0.0`
|
||||
enum:
|
||||
- PrometheusProto
|
||||
- OpenMetricsText0.0.1
|
||||
- OpenMetricsText1.0.0
|
||||
- PrometheusText0.0.4
|
||||
- PrometheusText1.0.0
|
||||
type: string
|
||||
type: array
|
||||
x-kubernetes-list-type: set
|
||||
|
@ -55738,11 +55750,13 @@ spec:
|
|||
* `OpenMetricsText1.0.0`
|
||||
* `PrometheusProto`
|
||||
* `PrometheusText0.0.4`
|
||||
* `PrometheusText1.0.0`
|
||||
enum:
|
||||
- PrometheusProto
|
||||
- OpenMetricsText0.0.1
|
||||
- OpenMetricsText1.0.0
|
||||
- PrometheusText0.0.4
|
||||
- PrometheusText1.0.0
|
||||
type: string
|
||||
minItems: 1
|
||||
type: array
|
||||
|
@ -57084,11 +57098,13 @@ spec:
|
|||
* `OpenMetricsText1.0.0`
|
||||
* `PrometheusProto`
|
||||
* `PrometheusText0.0.4`
|
||||
* `PrometheusText1.0.0`
|
||||
enum:
|
||||
- PrometheusProto
|
||||
- OpenMetricsText0.0.1
|
||||
- OpenMetricsText1.0.0
|
||||
- PrometheusText0.0.4
|
||||
- PrometheusText1.0.0
|
||||
type: string
|
||||
type: array
|
||||
x-kubernetes-list-type: set
|
||||
|
|
|
@ -1102,11 +1102,13 @@ spec:
|
|||
* `OpenMetricsText1.0.0`
|
||||
* `PrometheusProto`
|
||||
* `PrometheusText0.0.4`
|
||||
* `PrometheusText1.0.0`
|
||||
enum:
|
||||
- PrometheusProto
|
||||
- OpenMetricsText0.0.1
|
||||
- OpenMetricsText1.0.0
|
||||
- PrometheusText0.0.4
|
||||
- PrometheusText1.0.0
|
||||
type: string
|
||||
type: array
|
||||
x-kubernetes-list-type: set
|
||||
|
|
|
@ -697,11 +697,13 @@ spec:
|
|||
* `OpenMetricsText1.0.0`
|
||||
* `PrometheusProto`
|
||||
* `PrometheusText0.0.4`
|
||||
* `PrometheusText1.0.0`
|
||||
enum:
|
||||
- PrometheusProto
|
||||
- OpenMetricsText0.0.1
|
||||
- OpenMetricsText1.0.0
|
||||
- PrometheusText0.0.4
|
||||
- PrometheusText1.0.0
|
||||
type: string
|
||||
type: array
|
||||
x-kubernetes-list-type: set
|
||||
|
|
|
@ -6794,6 +6794,8 @@ spec:
|
|||
If unset, Prometheus uses its default value.
|
||||
|
||||
It requires Prometheus >= v2.49.0.
|
||||
|
||||
`PrometheusText1.0.0` requires Prometheus >= v3.0.0.
|
||||
items:
|
||||
description: |-
|
||||
ScrapeProtocol represents a protocol used by Prometheus for scraping metrics.
|
||||
|
@ -6802,11 +6804,13 @@ spec:
|
|||
* `OpenMetricsText1.0.0`
|
||||
* `PrometheusProto`
|
||||
* `PrometheusText0.0.4`
|
||||
* `PrometheusText1.0.0`
|
||||
enum:
|
||||
- PrometheusProto
|
||||
- OpenMetricsText0.0.1
|
||||
- OpenMetricsText1.0.0
|
||||
- PrometheusText0.0.4
|
||||
- PrometheusText1.0.0
|
||||
type: string
|
||||
type: array
|
||||
x-kubernetes-list-type: set
|
||||
|
|
|
@ -8440,6 +8440,8 @@ spec:
|
|||
If unset, Prometheus uses its default value.
|
||||
|
||||
It requires Prometheus >= v2.49.0.
|
||||
|
||||
`PrometheusText1.0.0` requires Prometheus >= v3.0.0.
|
||||
items:
|
||||
description: |-
|
||||
ScrapeProtocol represents a protocol used by Prometheus for scraping metrics.
|
||||
|
@ -8448,11 +8450,13 @@ spec:
|
|||
* `OpenMetricsText1.0.0`
|
||||
* `PrometheusProto`
|
||||
* `PrometheusText0.0.4`
|
||||
* `PrometheusText1.0.0`
|
||||
enum:
|
||||
- PrometheusProto
|
||||
- OpenMetricsText0.0.1
|
||||
- OpenMetricsText1.0.0
|
||||
- PrometheusText0.0.4
|
||||
- PrometheusText1.0.0
|
||||
type: string
|
||||
type: array
|
||||
x-kubernetes-list-type: set
|
||||
|
|
|
@ -11244,11 +11244,13 @@ spec:
|
|||
* `OpenMetricsText1.0.0`
|
||||
* `PrometheusProto`
|
||||
* `PrometheusText0.0.4`
|
||||
* `PrometheusText1.0.0`
|
||||
enum:
|
||||
- PrometheusProto
|
||||
- OpenMetricsText0.0.1
|
||||
- OpenMetricsText1.0.0
|
||||
- PrometheusText0.0.4
|
||||
- PrometheusText1.0.0
|
||||
type: string
|
||||
minItems: 1
|
||||
type: array
|
||||
|
|
|
@ -1122,11 +1122,13 @@ spec:
|
|||
* `OpenMetricsText1.0.0`
|
||||
* `PrometheusProto`
|
||||
* `PrometheusText0.0.4`
|
||||
* `PrometheusText1.0.0`
|
||||
enum:
|
||||
- PrometheusProto
|
||||
- OpenMetricsText0.0.1
|
||||
- OpenMetricsText1.0.0
|
||||
- PrometheusText0.0.4
|
||||
- PrometheusText1.0.0
|
||||
type: string
|
||||
type: array
|
||||
x-kubernetes-list-type: set
|
||||
|
|
|
@ -1103,11 +1103,13 @@ spec:
|
|||
* `OpenMetricsText1.0.0`
|
||||
* `PrometheusProto`
|
||||
* `PrometheusText0.0.4`
|
||||
* `PrometheusText1.0.0`
|
||||
enum:
|
||||
- PrometheusProto
|
||||
- OpenMetricsText0.0.1
|
||||
- OpenMetricsText1.0.0
|
||||
- PrometheusText0.0.4
|
||||
- PrometheusText1.0.0
|
||||
type: string
|
||||
type: array
|
||||
x-kubernetes-list-type: set
|
||||
|
|
|
@ -698,11 +698,13 @@ spec:
|
|||
* `OpenMetricsText1.0.0`
|
||||
* `PrometheusProto`
|
||||
* `PrometheusText0.0.4`
|
||||
* `PrometheusText1.0.0`
|
||||
enum:
|
||||
- PrometheusProto
|
||||
- OpenMetricsText0.0.1
|
||||
- OpenMetricsText1.0.0
|
||||
- PrometheusText0.0.4
|
||||
- PrometheusText1.0.0
|
||||
type: string
|
||||
type: array
|
||||
x-kubernetes-list-type: set
|
||||
|
|
|
@ -6795,6 +6795,8 @@ spec:
|
|||
If unset, Prometheus uses its default value.
|
||||
|
||||
It requires Prometheus >= v2.49.0.
|
||||
|
||||
`PrometheusText1.0.0` requires Prometheus >= v3.0.0.
|
||||
items:
|
||||
description: |-
|
||||
ScrapeProtocol represents a protocol used by Prometheus for scraping metrics.
|
||||
|
@ -6803,11 +6805,13 @@ spec:
|
|||
* `OpenMetricsText1.0.0`
|
||||
* `PrometheusProto`
|
||||
* `PrometheusText0.0.4`
|
||||
* `PrometheusText1.0.0`
|
||||
enum:
|
||||
- PrometheusProto
|
||||
- OpenMetricsText0.0.1
|
||||
- OpenMetricsText1.0.0
|
||||
- PrometheusText0.0.4
|
||||
- PrometheusText1.0.0
|
||||
type: string
|
||||
type: array
|
||||
x-kubernetes-list-type: set
|
||||
|
|
|
@ -8441,6 +8441,8 @@ spec:
|
|||
If unset, Prometheus uses its default value.
|
||||
|
||||
It requires Prometheus >= v2.49.0.
|
||||
|
||||
`PrometheusText1.0.0` requires Prometheus >= v3.0.0.
|
||||
items:
|
||||
description: |-
|
||||
ScrapeProtocol represents a protocol used by Prometheus for scraping metrics.
|
||||
|
@ -8449,11 +8451,13 @@ spec:
|
|||
* `OpenMetricsText1.0.0`
|
||||
* `PrometheusProto`
|
||||
* `PrometheusText0.0.4`
|
||||
* `PrometheusText1.0.0`
|
||||
enum:
|
||||
- PrometheusProto
|
||||
- OpenMetricsText0.0.1
|
||||
- OpenMetricsText1.0.0
|
||||
- PrometheusText0.0.4
|
||||
- PrometheusText1.0.0
|
||||
type: string
|
||||
type: array
|
||||
x-kubernetes-list-type: set
|
||||
|
|
|
@ -11245,11 +11245,13 @@ spec:
|
|||
* `OpenMetricsText1.0.0`
|
||||
* `PrometheusProto`
|
||||
* `PrometheusText0.0.4`
|
||||
* `PrometheusText1.0.0`
|
||||
enum:
|
||||
- PrometheusProto
|
||||
- OpenMetricsText0.0.1
|
||||
- OpenMetricsText1.0.0
|
||||
- PrometheusText0.0.4
|
||||
- PrometheusText1.0.0
|
||||
type: string
|
||||
minItems: 1
|
||||
type: array
|
||||
|
|
|
@ -1123,11 +1123,13 @@ spec:
|
|||
* `OpenMetricsText1.0.0`
|
||||
* `PrometheusProto`
|
||||
* `PrometheusText0.0.4`
|
||||
* `PrometheusText1.0.0`
|
||||
enum:
|
||||
- PrometheusProto
|
||||
- OpenMetricsText0.0.1
|
||||
- OpenMetricsText1.0.0
|
||||
- PrometheusText0.0.4
|
||||
- PrometheusText1.0.0
|
||||
type: string
|
||||
type: array
|
||||
x-kubernetes-list-type: set
|
||||
|
|
|
@ -945,12 +945,13 @@
|
|||
"scrapeProtocols": {
|
||||
"description": "`scrapeProtocols` defines the protocols to negotiate during a scrape. It tells clients the\nprotocols supported by Prometheus in order of preference (from most to least preferred).\n\nIf unset, Prometheus uses its default value.\n\nIt requires Prometheus >= v2.49.0.",
|
||||
"items": {
|
||||
"description": "ScrapeProtocol represents a protocol used by Prometheus for scraping metrics.\nSupported values are:\n* `OpenMetricsText0.0.1`\n* `OpenMetricsText1.0.0`\n* `PrometheusProto`\n* `PrometheusText0.0.4`",
|
||||
"description": "ScrapeProtocol represents a protocol used by Prometheus for scraping metrics.\nSupported values are:\n* `OpenMetricsText0.0.1`\n* `OpenMetricsText1.0.0`\n* `PrometheusProto`\n* `PrometheusText0.0.4`\n* `PrometheusText1.0.0`",
|
||||
"enum": [
|
||||
"PrometheusProto",
|
||||
"OpenMetricsText0.0.1",
|
||||
"OpenMetricsText1.0.0",
|
||||
"PrometheusText0.0.4"
|
||||
"PrometheusText0.0.4",
|
||||
"PrometheusText1.0.0"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
|
|
|
@ -629,12 +629,13 @@
|
|||
"scrapeProtocols": {
|
||||
"description": "`scrapeProtocols` defines the protocols to negotiate during a scrape. It tells clients the\nprotocols supported by Prometheus in order of preference (from most to least preferred).\n\nIf unset, Prometheus uses its default value.\n\nIt requires Prometheus >= v2.49.0.",
|
||||
"items": {
|
||||
"description": "ScrapeProtocol represents a protocol used by Prometheus for scraping metrics.\nSupported values are:\n* `OpenMetricsText0.0.1`\n* `OpenMetricsText1.0.0`\n* `PrometheusProto`\n* `PrometheusText0.0.4`",
|
||||
"description": "ScrapeProtocol represents a protocol used by Prometheus for scraping metrics.\nSupported values are:\n* `OpenMetricsText0.0.1`\n* `OpenMetricsText1.0.0`\n* `PrometheusProto`\n* `PrometheusText0.0.4`\n* `PrometheusText1.0.0`",
|
||||
"enum": [
|
||||
"PrometheusProto",
|
||||
"OpenMetricsText0.0.1",
|
||||
"OpenMetricsText1.0.0",
|
||||
"PrometheusText0.0.4"
|
||||
"PrometheusText0.0.4",
|
||||
"PrometheusText1.0.0"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
|
|
|
@ -5813,14 +5813,15 @@
|
|||
"type": "string"
|
||||
},
|
||||
"scrapeProtocols": {
|
||||
"description": "The protocols to negotiate during a scrape. It tells clients the\nprotocols supported by Prometheus in order of preference (from most to least preferred).\n\nIf unset, Prometheus uses its default value.\n\nIt requires Prometheus >= v2.49.0.",
|
||||
"description": "The protocols to negotiate during a scrape. It tells clients the\nprotocols supported by Prometheus in order of preference (from most to least preferred).\n\nIf unset, Prometheus uses its default value.\n\nIt requires Prometheus >= v2.49.0.\n\n`PrometheusText1.0.0` requires Prometheus >= v3.0.0.",
|
||||
"items": {
|
||||
"description": "ScrapeProtocol represents a protocol used by Prometheus for scraping metrics.\nSupported values are:\n* `OpenMetricsText0.0.1`\n* `OpenMetricsText1.0.0`\n* `PrometheusProto`\n* `PrometheusText0.0.4`",
|
||||
"description": "ScrapeProtocol represents a protocol used by Prometheus for scraping metrics.\nSupported values are:\n* `OpenMetricsText0.0.1`\n* `OpenMetricsText1.0.0`\n* `PrometheusProto`\n* `PrometheusText0.0.4`\n* `PrometheusText1.0.0`",
|
||||
"enum": [
|
||||
"PrometheusProto",
|
||||
"OpenMetricsText0.0.1",
|
||||
"OpenMetricsText1.0.0",
|
||||
"PrometheusText0.0.4"
|
||||
"PrometheusText0.0.4",
|
||||
"PrometheusText1.0.0"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
|
|
|
@ -7271,14 +7271,15 @@
|
|||
"type": "string"
|
||||
},
|
||||
"scrapeProtocols": {
|
||||
"description": "The protocols to negotiate during a scrape. It tells clients the\nprotocols supported by Prometheus in order of preference (from most to least preferred).\n\nIf unset, Prometheus uses its default value.\n\nIt requires Prometheus >= v2.49.0.",
|
||||
"description": "The protocols to negotiate during a scrape. It tells clients the\nprotocols supported by Prometheus in order of preference (from most to least preferred).\n\nIf unset, Prometheus uses its default value.\n\nIt requires Prometheus >= v2.49.0.\n\n`PrometheusText1.0.0` requires Prometheus >= v3.0.0.",
|
||||
"items": {
|
||||
"description": "ScrapeProtocol represents a protocol used by Prometheus for scraping metrics.\nSupported values are:\n* `OpenMetricsText0.0.1`\n* `OpenMetricsText1.0.0`\n* `PrometheusProto`\n* `PrometheusText0.0.4`",
|
||||
"description": "ScrapeProtocol represents a protocol used by Prometheus for scraping metrics.\nSupported values are:\n* `OpenMetricsText0.0.1`\n* `OpenMetricsText1.0.0`\n* `PrometheusProto`\n* `PrometheusText0.0.4`\n* `PrometheusText1.0.0`",
|
||||
"enum": [
|
||||
"PrometheusProto",
|
||||
"OpenMetricsText0.0.1",
|
||||
"OpenMetricsText1.0.0",
|
||||
"PrometheusText0.0.4"
|
||||
"PrometheusText0.0.4",
|
||||
"PrometheusText1.0.0"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
|
|
|
@ -10667,12 +10667,13 @@
|
|||
"scrapeProtocols": {
|
||||
"description": "The protocols to negotiate during a scrape. It tells clients the\nprotocols supported by Prometheus in order of preference (from most to least preferred).\n\nIf unset, Prometheus uses its default value.\n\nIt requires Prometheus >= v2.49.0.",
|
||||
"items": {
|
||||
"description": "ScrapeProtocol represents a protocol used by Prometheus for scraping metrics.\nSupported values are:\n* `OpenMetricsText0.0.1`\n* `OpenMetricsText1.0.0`\n* `PrometheusProto`\n* `PrometheusText0.0.4`",
|
||||
"description": "ScrapeProtocol represents a protocol used by Prometheus for scraping metrics.\nSupported values are:\n* `OpenMetricsText0.0.1`\n* `OpenMetricsText1.0.0`\n* `PrometheusProto`\n* `PrometheusText0.0.4`\n* `PrometheusText1.0.0`",
|
||||
"enum": [
|
||||
"PrometheusProto",
|
||||
"OpenMetricsText0.0.1",
|
||||
"OpenMetricsText1.0.0",
|
||||
"PrometheusText0.0.4"
|
||||
"PrometheusText0.0.4",
|
||||
"PrometheusText1.0.0"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
|
|
|
@ -961,12 +961,13 @@
|
|||
"scrapeProtocols": {
|
||||
"description": "`scrapeProtocols` defines the protocols to negotiate during a scrape. It tells clients the\nprotocols supported by Prometheus in order of preference (from most to least preferred).\n\nIf unset, Prometheus uses its default value.\n\nIt requires Prometheus >= v2.49.0.",
|
||||
"items": {
|
||||
"description": "ScrapeProtocol represents a protocol used by Prometheus for scraping metrics.\nSupported values are:\n* `OpenMetricsText0.0.1`\n* `OpenMetricsText1.0.0`\n* `PrometheusProto`\n* `PrometheusText0.0.4`",
|
||||
"description": "ScrapeProtocol represents a protocol used by Prometheus for scraping metrics.\nSupported values are:\n* `OpenMetricsText0.0.1`\n* `OpenMetricsText1.0.0`\n* `PrometheusProto`\n* `PrometheusText0.0.4`\n* `PrometheusText1.0.0`",
|
||||
"enum": [
|
||||
"PrometheusProto",
|
||||
"OpenMetricsText0.0.1",
|
||||
"OpenMetricsText1.0.0",
|
||||
"PrometheusText0.0.4"
|
||||
"PrometheusText0.0.4",
|
||||
"PrometheusText1.0.0"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
|
|
|
@ -38,9 +38,18 @@ const (
|
|||
// * `OpenMetricsText1.0.0`
|
||||
// * `PrometheusProto`
|
||||
// * `PrometheusText0.0.4`
|
||||
// +kubebuilder:validation:Enum=PrometheusProto;OpenMetricsText0.0.1;OpenMetricsText1.0.0;PrometheusText0.0.4
|
||||
// * `PrometheusText1.0.0`
|
||||
// +kubebuilder:validation:Enum=PrometheusProto;OpenMetricsText0.0.1;OpenMetricsText1.0.0;PrometheusText0.0.4;PrometheusText1.0.0
|
||||
type ScrapeProtocol string
|
||||
|
||||
const (
|
||||
PrometheusProto ScrapeProtocol = "PrometheusProto"
|
||||
PrometheusText0_0_4 ScrapeProtocol = "PrometheusText0.0.4"
|
||||
PrometheusText1_0_0 ScrapeProtocol = "PrometheusText1.0.0"
|
||||
OpenMetricsText0_0_1 ScrapeProtocol = "OpenMetricsText0.0.1"
|
||||
OpenMetricsText1_0_0 ScrapeProtocol = "OpenMetricsText1.0.0"
|
||||
)
|
||||
|
||||
// RuntimeConfig configures the values for the process behavior.
|
||||
type RuntimeConfig struct {
|
||||
// The Go garbage collection target percentage. Lowering this number may increase the CPU usage.
|
||||
|
@ -285,6 +294,8 @@ type CommonPrometheusFields struct {
|
|||
//
|
||||
// It requires Prometheus >= v2.49.0.
|
||||
//
|
||||
// `PrometheusText1.0.0` requires Prometheus >= v3.0.0.
|
||||
//
|
||||
// +listType=set
|
||||
// +optional
|
||||
ScrapeProtocols []ScrapeProtocol `json:"scrapeProtocols,omitempty"`
|
||||
|
|
|
@ -365,14 +365,24 @@ func (cg *ConfigGenerator) AddTrackTimestampsStaleness(cfg yaml.MapSlice, trackT
|
|||
return cg.WithMinimumVersion("2.48.0").AppendMapItem(cfg, "track_timestamps_staleness", *trackTimestampsStaleness)
|
||||
}
|
||||
|
||||
// AddScrapeProtocols adds the scrape_protocols field into scrape configurations.
|
||||
// For backwards compatibility with Prometheus <2.49.0 we don't set scrape_protocols.
|
||||
func (cg *ConfigGenerator) AddScrapeProtocols(cfg yaml.MapSlice, scrapeProtocols []monitoringv1.ScrapeProtocol) yaml.MapSlice {
|
||||
// addScrapeProtocols adds the scrape_protocols field into the configuration.
|
||||
func (cg *ConfigGenerator) addScrapeProtocols(cfg yaml.MapSlice, scrapeProtocols []monitoringv1.ScrapeProtocol) yaml.MapSlice {
|
||||
if len(scrapeProtocols) == 0 {
|
||||
return cfg
|
||||
}
|
||||
|
||||
return cg.WithMinimumVersion("2.49.0").AppendMapItem(cfg, "scrape_protocols", scrapeProtocols)
|
||||
sps := make([]string, 0, len(scrapeProtocols))
|
||||
for _, sp := range scrapeProtocols {
|
||||
// PrometheusText1.0.0 requires Prometheus v3.0.0 at least.
|
||||
if sp == monitoringv1.PrometheusText1_0_0 && !cg.WithMinimumVersion("3.0.0-rc.0").IsCompatible() {
|
||||
cg.Warn(fmt.Sprintf("scrapeProtocol=%s", monitoringv1.PrometheusText1_0_0))
|
||||
continue
|
||||
}
|
||||
|
||||
sps = append(sps, string(sp))
|
||||
}
|
||||
|
||||
return cg.WithMinimumVersion("2.49.0").AppendMapItem(cfg, "scrape_protocols", sps)
|
||||
}
|
||||
|
||||
// AddHonorLabels adds the honor_labels field into scrape configurations.
|
||||
|
@ -1347,7 +1357,7 @@ func (cg *ConfigGenerator) generatePodMonitorConfig(
|
|||
cfg = cg.AddLimitsToYAML(cfg, labelValueLengthLimitKey, m.Spec.LabelValueLengthLimit, cpf.EnforcedLabelValueLengthLimit)
|
||||
cfg = cg.AddLimitsToYAML(cfg, keepDroppedTargetsKey, m.Spec.KeepDroppedTargets, cpf.EnforcedKeepDroppedTargets)
|
||||
cfg = cg.addNativeHistogramConfig(cfg, m.Spec.NativeHistogramConfig)
|
||||
cfg = cg.AddScrapeProtocols(cfg, m.Spec.ScrapeProtocols)
|
||||
cfg = cg.addScrapeProtocols(cfg, m.Spec.ScrapeProtocols)
|
||||
|
||||
if bodySizeLimit := getLowerByteSize(m.Spec.BodySizeLimit, &cpf); !isByteSizeEmpty(bodySizeLimit) {
|
||||
cfg = cg.WithMinimumVersion("2.28.0").AppendMapItem(cfg, "body_size_limit", bodySizeLimit)
|
||||
|
@ -1415,7 +1425,7 @@ func (cg *ConfigGenerator) generateProbeConfig(
|
|||
cfg = cg.AddLimitsToYAML(cfg, labelValueLengthLimitKey, m.Spec.LabelValueLengthLimit, cpf.EnforcedLabelValueLengthLimit)
|
||||
cfg = cg.AddLimitsToYAML(cfg, keepDroppedTargetsKey, m.Spec.KeepDroppedTargets, cpf.EnforcedKeepDroppedTargets)
|
||||
cfg = cg.addNativeHistogramConfig(cfg, m.Spec.NativeHistogramConfig)
|
||||
cfg = cg.AddScrapeProtocols(cfg, m.Spec.ScrapeProtocols)
|
||||
cfg = cg.addScrapeProtocols(cfg, m.Spec.ScrapeProtocols)
|
||||
|
||||
if cpf.EnforcedBodySizeLimit != "" {
|
||||
cfg = cg.WithMinimumVersion("2.28.0").AppendMapItem(cfg, "body_size_limit", cpf.EnforcedBodySizeLimit)
|
||||
|
@ -1864,7 +1874,7 @@ func (cg *ConfigGenerator) generateServiceMonitorConfig(
|
|||
cfg = cg.AddLimitsToYAML(cfg, labelValueLengthLimitKey, m.Spec.LabelValueLengthLimit, cpf.EnforcedLabelValueLengthLimit)
|
||||
cfg = cg.AddLimitsToYAML(cfg, keepDroppedTargetsKey, m.Spec.KeepDroppedTargets, cpf.EnforcedKeepDroppedTargets)
|
||||
cfg = cg.addNativeHistogramConfig(cfg, m.Spec.NativeHistogramConfig)
|
||||
cfg = cg.AddScrapeProtocols(cfg, m.Spec.ScrapeProtocols)
|
||||
cfg = cg.addScrapeProtocols(cfg, m.Spec.ScrapeProtocols)
|
||||
|
||||
if bodySizeLimit := getLowerByteSize(m.Spec.BodySizeLimit, &cpf); !isByteSizeEmpty(bodySizeLimit) {
|
||||
cfg = cg.WithMinimumVersion("2.28.0").AppendMapItem(cfg, "body_size_limit", bodySizeLimit)
|
||||
|
@ -2573,16 +2583,6 @@ func (cg *ConfigGenerator) appendScrapeIntervals(slice yaml.MapSlice) yaml.MapSl
|
|||
return slice
|
||||
}
|
||||
|
||||
func (cg *ConfigGenerator) appendScrapeProtocols(slice yaml.MapSlice) yaml.MapSlice {
|
||||
cpf := cg.prom.GetCommonPrometheusFields()
|
||||
|
||||
if len(cpf.ScrapeProtocols) == 0 {
|
||||
return slice
|
||||
}
|
||||
|
||||
return cg.WithMinimumVersion("2.49.0").AppendMapItem(slice, "scrape_protocols", cpf.ScrapeProtocols)
|
||||
}
|
||||
|
||||
func (cg *ConfigGenerator) appendRuntime(slice yaml.MapSlice) yaml.MapSlice {
|
||||
runtime := cg.prom.GetCommonPrometheusFields().Runtime
|
||||
if runtime == nil {
|
||||
|
@ -2925,9 +2925,7 @@ func (cg *ConfigGenerator) generateScrapeConfig(
|
|||
cfg = append(cfg, yaml.MapItem{Key: "scrape_timeout", Value: *sc.Spec.ScrapeTimeout})
|
||||
}
|
||||
|
||||
if len(sc.Spec.ScrapeProtocols) > 0 {
|
||||
cfg = cg.WithMinimumVersion("2.49.0").AppendMapItem(cfg, "scrape_protocols", sc.Spec.ScrapeProtocols)
|
||||
}
|
||||
cfg = cg.addScrapeProtocols(cfg, sc.Spec.ScrapeProtocols)
|
||||
|
||||
if sc.Spec.Scheme != nil {
|
||||
cfg = append(cfg, yaml.MapItem{Key: "scheme", Value: strings.ToLower(*sc.Spec.Scheme)})
|
||||
|
@ -4631,7 +4629,7 @@ func (cg *ConfigGenerator) addFiltersToYaml(cfg yaml.MapSlice, filters []monitor
|
|||
func (cg *ConfigGenerator) buildGlobalConfig() yaml.MapSlice {
|
||||
cfg := yaml.MapSlice{}
|
||||
cfg = cg.appendScrapeIntervals(cfg)
|
||||
cfg = cg.appendScrapeProtocols(cfg)
|
||||
cfg = cg.addScrapeProtocols(cfg, cg.prom.GetCommonPrometheusFields().ScrapeProtocols)
|
||||
cfg = cg.appendExternalLabels(cfg)
|
||||
cfg = cg.appendScrapeLimits(cfg)
|
||||
|
||||
|
|
|
@ -108,19 +108,14 @@ func TestConfigGeneration(t *testing.T) {
|
|||
|
||||
func TestGlobalSettings(t *testing.T) {
|
||||
var (
|
||||
expectedBodySizeLimit monitoringv1.ByteSize = "1000MB"
|
||||
expectedRuleQueryOffset monitoringv1.Duration = "30s"
|
||||
expectedSampleLimit uint64 = 10000
|
||||
expectedTargetLimit uint64 = 1000
|
||||
expectedLabelLimit uint64 = 50
|
||||
expectedLabelNameLengthLimit uint64 = 40
|
||||
expectedLabelValueLengthLimit uint64 = 30
|
||||
expectedkeepDroppedTargets uint64 = 50
|
||||
expectedscrapeProtocols []monitoringv1.ScrapeProtocol = []monitoringv1.ScrapeProtocol{
|
||||
"OpenMetricsText1.0.0",
|
||||
"OpenMetricsText0.0.1",
|
||||
"PrometheusText0.0.4",
|
||||
}
|
||||
expectedBodySizeLimit monitoringv1.ByteSize = "1000MB"
|
||||
expectedRuleQueryOffset monitoringv1.Duration = "30s"
|
||||
expectedSampleLimit uint64 = 10000
|
||||
expectedTargetLimit uint64 = 1000
|
||||
expectedLabelLimit uint64 = 50
|
||||
expectedLabelNameLengthLimit uint64 = 40
|
||||
expectedLabelValueLengthLimit uint64 = 30
|
||||
expectedkeepDroppedTargets uint64 = 50
|
||||
)
|
||||
|
||||
for _, tc := range []struct {
|
||||
|
@ -237,8 +232,37 @@ func TestGlobalSettings(t *testing.T) {
|
|||
Version: "v2.49.0",
|
||||
ScrapeInterval: "30s",
|
||||
EvaluationInterval: "30s",
|
||||
ScrapeProtocols: expectedscrapeProtocols,
|
||||
Golden: "valid_global_config_with_scrape_protocols.golden",
|
||||
ScrapeProtocols: []monitoringv1.ScrapeProtocol{
|
||||
monitoringv1.OpenMetricsText1_0_0,
|
||||
monitoringv1.OpenMetricsText0_0_1,
|
||||
monitoringv1.PrometheusProto,
|
||||
monitoringv1.PrometheusText0_0_4,
|
||||
monitoringv1.PrometheusText1_0_0,
|
||||
},
|
||||
Golden: "valid_global_config_with_scrape_protocols.golden",
|
||||
},
|
||||
{
|
||||
Scenario: "valid global config with new scrape protocol",
|
||||
Version: "v3.0.0-rc.0",
|
||||
ScrapeInterval: "30s",
|
||||
EvaluationInterval: "30s",
|
||||
ScrapeProtocols: []monitoringv1.ScrapeProtocol{
|
||||
monitoringv1.PrometheusText1_0_0,
|
||||
},
|
||||
Golden: "valid_global_config_with_new_scrape_protocol.golden",
|
||||
},
|
||||
{
|
||||
Scenario: "valid global config with unsupported scrape protocols",
|
||||
Version: "v2.48.0",
|
||||
ScrapeInterval: "30s",
|
||||
EvaluationInterval: "30s",
|
||||
ScrapeProtocols: []monitoringv1.ScrapeProtocol{
|
||||
monitoringv1.PrometheusProto,
|
||||
monitoringv1.PrometheusText0_0_4,
|
||||
monitoringv1.OpenMetricsText0_0_1,
|
||||
monitoringv1.OpenMetricsText1_0_0,
|
||||
},
|
||||
Golden: "valid_global_config_with_unsupported_scrape_protocols.golden",
|
||||
},
|
||||
{
|
||||
Scenario: "valid global config without rule query offset if prometheus version less required",
|
||||
|
|
9
pkg/prometheus/testdata/valid_global_config_with_new_scrape_protocol.golden
generated
vendored
Normal file
9
pkg/prometheus/testdata/valid_global_config_with_new_scrape_protocol.golden
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
global:
|
||||
scrape_interval: 30s
|
||||
scrape_protocols:
|
||||
- PrometheusText1.0.0
|
||||
external_labels:
|
||||
prometheus: test/example
|
||||
prometheus_replica: $(POD_NAME)
|
||||
evaluation_interval: 30s
|
||||
scrape_configs: []
|
1
pkg/prometheus/testdata/valid_global_config_with_scrape_protocols.golden
generated
vendored
1
pkg/prometheus/testdata/valid_global_config_with_scrape_protocols.golden
generated
vendored
|
@ -3,6 +3,7 @@ global:
|
|||
scrape_protocols:
|
||||
- OpenMetricsText1.0.0
|
||||
- OpenMetricsText0.0.1
|
||||
- PrometheusProto
|
||||
- PrometheusText0.0.4
|
||||
external_labels:
|
||||
prometheus: test/example
|
||||
|
|
7
pkg/prometheus/testdata/valid_global_config_with_unsupported_scrape_protocols.golden
generated
vendored
Normal file
7
pkg/prometheus/testdata/valid_global_config_with_unsupported_scrape_protocols.golden
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
global:
|
||||
scrape_interval: 30s
|
||||
external_labels:
|
||||
prometheus: test/example
|
||||
prometheus_replica: $(POD_NAME)
|
||||
evaluation_interval: 30s
|
||||
scrape_configs: []
|
Loading…
Add table
Add a link
Reference in a new issue