Skip to content

Commit ed35d50

Browse files
author
Andrew Chubatiuk
committed
vmpodscrape/vmservicescrape/vmnodescrape/vmstaticscrape: support scrape_protocols option
1 parent d88157b commit ed35d50

26 files changed

+6191
-5209
lines changed

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ CRD_PRESERVE=x-kubernetes-preserve-unknown-fields true
2626
# Default bundle image tag
2727
BUNDLE_IMG ?= controller-bundle:$(VERSION)
2828
ALPINE_IMAGE=alpine:3.19.0
29+
CONTROLLER_GEN_VERSION=v0.14.0
2930
CHANNEL=beta
3031
DEFAULT_CHANNEL=beta
3132
BUNDLE_CHANNELS := --channels=$(CHANNEL)
@@ -289,14 +290,15 @@ generate: controller-gen
289290

290291
# find or download controller-gen
291292
# download controller-gen if necessary
293+
292294
controller-gen:
293-
ifeq (, $(shell which controller-gen))
295+
ifneq (Version: $(CONTROLLER_GEN_VERSION), $(shell controller-gen --version))
294296
@{ \
295297
set -e ;\
296298
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\
297299
cd $$CONTROLLER_GEN_TMP_DIR ;\
298300
go mod init tmp ;\
299-
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.12.1 ;\
301+
go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_VERSION) ;\
300302
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
301303
}
302304
CONTROLLER_GEN=$(GOBIN)/controller-gen

api/v1beta1/vmnodescrape_types.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@ type VMNodeScrapeSpec struct {
3838
// one of scrape_interval or interval can be used
3939
// +optional
4040
ScrapeInterval string `json:"scrape_interval,omitempty"`
41-
// Timeout after which the scrape is ended
41+
// ScrapeTimeout after which the scrape is ended
4242
// +optional
4343
ScrapeTimeout string `json:"scrapeTimeout,omitempty"`
44+
// ScrapeProtocols defines Prometheus scrape protocol.
45+
// +optional
46+
ScrapeProtocols []string `json:"scrape_protocols,omitempty"`
4447
// OAuth2 defines auth configuration
4548
// +optional
4649
OAuth2 *OAuth2 `json:"oauth2,omitempty"`

api/v1beta1/vmpodscrape_types.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,15 @@ type PodMetricsEndpoint struct {
9090
// one of scrape_interval or interval can be used
9191
// +optional
9292
ScrapeInterval string `json:"scrape_interval,omitempty"`
93-
// Timeout after which the scrape is ended
93+
// ScrapeTimeout after which the scrape is ended
9494
// +optional
9595
ScrapeTimeout string `json:"scrapeTimeout,omitempty"`
9696
// SampleLimit defines per-podEndpoint limit on number of scraped samples that will be accepted.
9797
// +optional
9898
SampleLimit uint64 `json:"sampleLimit,omitempty"`
99+
// ScrapeProtocols defines Prometheus scrape protocol.
100+
// +optional
101+
ScrapeProtocols []string `json:"scrape_protocols,omitempty"`
99102
// HonorLabels chooses the metric's labels on collisions with target labels.
100103
// +optional
101104
HonorLabels bool `json:"honorLabels,omitempty"`

api/v1beta1/vmservicescrape_types.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,15 @@ type Endpoint struct {
133133
// one of scrape_interval or interval can be used
134134
// +optional
135135
ScrapeInterval string `json:"scrape_interval,omitempty"`
136-
// Timeout after which the scrape is ended
136+
// ScrapeTimeout after which the scrape is ended
137137
// +optional
138138
ScrapeTimeout string `json:"scrapeTimeout,omitempty"`
139139
// SampleLimit defines per-endpoint limit on number of scraped samples that will be accepted.
140140
// +optional
141141
SampleLimit uint64 `json:"sampleLimit,omitempty"`
142+
// ScrapeProtocols defines Prometheus scrape protocol.
143+
// +optional
144+
ScrapeProtocols []string `json:"scrape_protocols,omitempty"`
142145
// OAuth2 defines auth configuration
143146
// +optional
144147
OAuth2 *OAuth2 `json:"oauth2,omitempty"`

api/v1beta1/vmstaticscrape_types.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,12 @@ type TargetEndpoint struct {
5252
// one of scrape_interval or interval can be used
5353
// +optional
5454
ScrapeInterval string `json:"scrape_interval,omitempty"`
55-
// Timeout after which the scrape is ended
55+
// ScrapeTimeout after which the scrape is ended
5656
// +optional
5757
ScrapeTimeout string `json:"scrapeTimeout,omitempty"`
58+
// ScrapeProtocols defines Prometheus scrape protocol.
59+
// +optional
60+
ScrapeProtocols []string `json:"scrape_protocols,omitempty"`
5861
// OAuth2 defines auth configuration
5962
// +optional
6063
OAuth2 *OAuth2 `json:"oauth2,omitempty"`

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 32 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/victoriametrics/v1beta1/vmnodescrape_types.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@ type VMNodeScrapeSpec struct {
3838
// one of scrape_interval or interval can be used
3939
// +optional
4040
ScrapeInterval string `json:"scrape_interval,omitempty"`
41-
// Timeout after which the scrape is ended
41+
// ScrapeTimeout after which the scrape is ended
4242
// +optional
4343
ScrapeTimeout string `json:"scrapeTimeout,omitempty"`
44+
// ScrapeProtocols defines Prometheus scrape protocol.
45+
// +optional
46+
ScrapeProtocols []string `json:"scrape_protocols,omitempty"`
4447
// OAuth2 defines auth configuration
4548
// +optional
4649
OAuth2 *OAuth2 `json:"oauth2,omitempty"`

api/victoriametrics/v1beta1/vmpodscrape_types.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,12 @@ type PodMetricsEndpoint struct {
9090
// one of scrape_interval or interval can be used
9191
// +optional
9292
ScrapeInterval string `json:"scrape_interval,omitempty"`
93-
// Timeout after which the scrape is ended
93+
// ScrapeTimeout after which the scrape is ended
9494
// +optional
9595
ScrapeTimeout string `json:"scrapeTimeout,omitempty"`
96+
// ScrapeProtocols defines Prometheus scrape protocol.
97+
// +optional
98+
ScrapeProtocols []string `json:"scrape_protocols,omitempty"`
9699
// SampleLimit defines per-podEndpoint limit on number of scraped samples that will be accepted.
97100
// +optional
98101
SampleLimit uint64 `json:"sampleLimit,omitempty"`

api/victoriametrics/v1beta1/vmservicescrape_types.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,12 @@ type Endpoint struct {
133133
// one of scrape_interval or interval can be used
134134
// +optional
135135
ScrapeInterval string `json:"scrape_interval,omitempty"`
136-
// Timeout after which the scrape is ended
136+
// ScrapeTimeout after which the scrape is ended
137137
// +optional
138138
ScrapeTimeout string `json:"scrapeTimeout,omitempty"`
139+
// ScrapeProtocols defines Prometheus scrape protocol.
140+
// +optional
141+
ScrapeProtocols []string `json:"scrape_protocols,omitempty"`
139142
// SampleLimit defines per-endpoint limit on number of scraped samples that will be accepted.
140143
// +optional
141144
SampleLimit uint64 `json:"sampleLimit,omitempty"`

api/victoriametrics/v1beta1/vmstaticscrape_types.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,12 @@ type TargetEndpoint struct {
5252
// one of scrape_interval or interval can be used
5353
// +optional
5454
ScrapeInterval string `json:"scrape_interval,omitempty"`
55-
// Timeout after which the scrape is ended
55+
// ScrapeTimeout after which the scrape is ended
5656
// +optional
5757
ScrapeTimeout string `json:"scrapeTimeout,omitempty"`
58+
// ScrapeProtocols defines Prometheus scrape protocol.
59+
// +optional
60+
ScrapeProtocols []string `json:"scrape_protocols,omitempty"`
5861
// OAuth2 defines auth configuration
5962
// +optional
6063
OAuth2 *OAuth2 `json:"oauth2,omitempty"`

0 commit comments

Comments
 (0)