Skip to content

Commit

Permalink
vmpodscrape/vmservicescrape/vmnodescrape/vmstaticscrape: support scra…
Browse files Browse the repository at this point in the history
…pe_protocols option
  • Loading branch information
Andrew Chubatiuk committed Feb 26, 2024
1 parent d88157b commit 3219e02
Show file tree
Hide file tree
Showing 26 changed files with 6,188 additions and 5,209 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ CRD_PRESERVE=x-kubernetes-preserve-unknown-fields true
# Default bundle image tag
BUNDLE_IMG ?= controller-bundle:$(VERSION)
ALPINE_IMAGE=alpine:3.19.0
CONTROLLER_GEN_VERSION=v0.14.0
CHANNEL=beta
DEFAULT_CHANNEL=beta
BUNDLE_CHANNELS := --channels=$(CHANNEL)
Expand Down Expand Up @@ -289,14 +290,15 @@ generate: controller-gen

# find or download controller-gen
# download controller-gen if necessary

controller-gen:
ifeq (, $(shell which controller-gen))
ifneq (Version: $(CONTROLLER_GEN_VERSION), $(shell controller-gen --version))
@{ \
set -e ;\
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\
cd $$CONTROLLER_GEN_TMP_DIR ;\
go mod init tmp ;\
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.12.1 ;\
go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_VERSION) ;\
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
}
CONTROLLER_GEN=$(GOBIN)/controller-gen
Expand Down
5 changes: 4 additions & 1 deletion api/v1beta1/vmnodescrape_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ type VMNodeScrapeSpec struct {
// one of scrape_interval or interval can be used
// +optional
ScrapeInterval string `json:"scrape_interval,omitempty"`
// Timeout after which the scrape is ended
// ScrapeTimeout after which the scrape is ended
// +optional
ScrapeTimeout string `json:"scrapeTimeout,omitempty"`
// ScrapeProtocols defines Prometheus scrape protocol.
// +optional
ScrapeProtocols []string `json:"scrape_protocols,omitempty"`
// OAuth2 defines auth configuration
// +optional
OAuth2 *OAuth2 `json:"oauth2,omitempty"`
Expand Down
5 changes: 4 additions & 1 deletion api/v1beta1/vmpodscrape_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,15 @@ type PodMetricsEndpoint struct {
// one of scrape_interval or interval can be used
// +optional
ScrapeInterval string `json:"scrape_interval,omitempty"`
// Timeout after which the scrape is ended
// ScrapeTimeout after which the scrape is ended
// +optional
ScrapeTimeout string `json:"scrapeTimeout,omitempty"`
// SampleLimit defines per-podEndpoint limit on number of scraped samples that will be accepted.
// +optional
SampleLimit uint64 `json:"sampleLimit,omitempty"`
// ScrapeProtocols defines Prometheus scrape protocol.
// +optional
ScrapeProtocols []string `json:"scrape_protocols,omitempty"`
// HonorLabels chooses the metric's labels on collisions with target labels.
// +optional
HonorLabels bool `json:"honorLabels,omitempty"`
Expand Down
5 changes: 4 additions & 1 deletion api/v1beta1/vmservicescrape_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,15 @@ type Endpoint struct {
// one of scrape_interval or interval can be used
// +optional
ScrapeInterval string `json:"scrape_interval,omitempty"`
// Timeout after which the scrape is ended
// ScrapeTimeout after which the scrape is ended
// +optional
ScrapeTimeout string `json:"scrapeTimeout,omitempty"`
// SampleLimit defines per-endpoint limit on number of scraped samples that will be accepted.
// +optional
SampleLimit uint64 `json:"sampleLimit,omitempty"`
// ScrapeProtocols defines Prometheus scrape protocol.
// +optional
ScrapeProtocols []string `json:"scrape_protocols,omitempty"`
// OAuth2 defines auth configuration
// +optional
OAuth2 *OAuth2 `json:"oauth2,omitempty"`
Expand Down
5 changes: 4 additions & 1 deletion api/v1beta1/vmstaticscrape_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ type TargetEndpoint struct {
// one of scrape_interval or interval can be used
// +optional
ScrapeInterval string `json:"scrape_interval,omitempty"`
// Timeout after which the scrape is ended
// ScrapeTimeout after which the scrape is ended
// +optional
ScrapeTimeout string `json:"scrapeTimeout,omitempty"`
// ScrapeProtocols defines Prometheus scrape protocol.
// +optional
ScrapeProtocols []string `json:"scrape_protocols,omitempty"`
// OAuth2 defines auth configuration
// +optional
OAuth2 *OAuth2 `json:"oauth2,omitempty"`
Expand Down
39 changes: 32 additions & 7 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion api/victoriametrics/v1beta1/vmnodescrape_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ type VMNodeScrapeSpec struct {
// one of scrape_interval or interval can be used
// +optional
ScrapeInterval string `json:"scrape_interval,omitempty"`
// Timeout after which the scrape is ended
// ScrapeTimeout after which the scrape is ended
// +optional
ScrapeTimeout string `json:"scrapeTimeout,omitempty"`
// ScrapeProtocols defines Prometheus scrape protocol.
// +optional
ScrapeProtocols []string `json:"scrape_protocols,omitempty"`
// OAuth2 defines auth configuration
// +optional
OAuth2 *OAuth2 `json:"oauth2,omitempty"`
Expand Down
5 changes: 4 additions & 1 deletion api/victoriametrics/v1beta1/vmpodscrape_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,12 @@ type PodMetricsEndpoint struct {
// one of scrape_interval or interval can be used
// +optional
ScrapeInterval string `json:"scrape_interval,omitempty"`
// Timeout after which the scrape is ended
// ScrapeTimeout after which the scrape is ended
// +optional
ScrapeTimeout string `json:"scrapeTimeout,omitempty"`
// ScrapeProtocols defines Prometheus scrape protocol.
// +optional
ScrapeProtocols []string `json:"scrape_protocols,omitempty"`
// SampleLimit defines per-podEndpoint limit on number of scraped samples that will be accepted.
// +optional
SampleLimit uint64 `json:"sampleLimit,omitempty"`
Expand Down
5 changes: 4 additions & 1 deletion api/victoriametrics/v1beta1/vmservicescrape_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,12 @@ type Endpoint struct {
// one of scrape_interval or interval can be used
// +optional
ScrapeInterval string `json:"scrape_interval,omitempty"`
// Timeout after which the scrape is ended
// ScrapeTimeout after which the scrape is ended
// +optional
ScrapeTimeout string `json:"scrapeTimeout,omitempty"`
// ScrapeProtocols defines Prometheus scrape protocol.
// +optional
ScrapeProtocols []string `json:"scrape_protocols,omitempty"`
// SampleLimit defines per-endpoint limit on number of scraped samples that will be accepted.
// +optional
SampleLimit uint64 `json:"sampleLimit,omitempty"`
Expand Down
5 changes: 4 additions & 1 deletion api/victoriametrics/v1beta1/vmstaticscrape_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ type TargetEndpoint struct {
// one of scrape_interval or interval can be used
// +optional
ScrapeInterval string `json:"scrape_interval,omitempty"`
// Timeout after which the scrape is ended
// ScrapeTimeout after which the scrape is ended
// +optional
ScrapeTimeout string `json:"scrapeTimeout,omitempty"`
// ScrapeProtocols defines Prometheus scrape protocol.
// +optional
ScrapeProtocols []string `json:"scrape_protocols,omitempty"`
// OAuth2 defines auth configuration
// +optional
OAuth2 *OAuth2 `json:"oauth2,omitempty"`
Expand Down
Loading

0 comments on commit 3219e02

Please sign in to comment.