Skip to content

Commit

Permalink
Change TargetAllocator configmap for ScrapeConfig and Probe CR (#3469)
Browse files Browse the repository at this point in the history
* Enable scrapeConfigSelector and probeSelector option in OpenTelemetryTargetAllocatorPrometheusCR, create right configmap for target allocator

Signed-off-by: qiyang <[email protected]>

* e2e test prometheus operator scrape config and probes

Signed-off-by: qiyang <[email protected]>

* e2e test prometheus operator scrape config and probes

Signed-off-by: qiyang <[email protected]>

* e2e test prometheus operator scrape config and probes

Signed-off-by: qiyang <[email protected]>

* e2e test prometheus operator scrape config and probes

Signed-off-by: qiyang <[email protected]>

* e2e test prometheus operator scrape config and probes

Signed-off-by: qiyang <[email protected]>

* e2e test prometheus operator scrape config and probes

Signed-off-by: qiyang <[email protected]>

---------

Signed-off-by: qiyang <[email protected]>
  • Loading branch information
dominicqi authored Dec 6, 2024
1 parent 781818b commit 438ffbc
Show file tree
Hide file tree
Showing 16 changed files with 693 additions and 14 deletions.
16 changes: 16 additions & 0 deletions .chloggen/scrape_config_probe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action)
component: collector

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: enables support for pulling scrape config and probe CRDs in the target allocator

# One or more tracking issues related to the change
issues: [1842]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
12 changes: 12 additions & 0 deletions apis/v1beta1/targetallocator_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ type TargetAllocatorPrometheusCR struct {
// label selector matches no objects.
// +optional
ServiceMonitorSelector *metav1.LabelSelector `json:"serviceMonitorSelector,omitempty"`
// ScrapeConfigs to be selected for target discovery.
// A label selector is a label query over a set of resources. The result of matchLabels and
// matchExpressions are ANDed. An empty label selector matches all objects. A null
// label selector matches no objects.
// +optional
ScrapeConfigSelector *metav1.LabelSelector `json:"scrapeConfigSelector,omitempty"`
// Probes to be selected for target discovery.
// A label selector is a label query over a set of resources. The result of matchLabels and
// matchExpressions are ANDed. An empty label selector matches all objects. A null
// label selector matches no objects.
// +optional
ProbeSelector *metav1.LabelSelector `json:"probeSelector,omitempty"`
}

type (
Expand Down
10 changes: 10 additions & 0 deletions apis/v1beta1/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -7909,6 +7909,58 @@ spec:
type: object
type: object
x-kubernetes-map-type: atomic
probeSelector:
properties:
matchExpressions:
items:
properties:
key:
type: string
operator:
type: string
values:
items:
type: string
type: array
x-kubernetes-list-type: atomic
required:
- key
- operator
type: object
type: array
x-kubernetes-list-type: atomic
matchLabels:
additionalProperties:
type: string
type: object
type: object
x-kubernetes-map-type: atomic
scrapeConfigSelector:
properties:
matchExpressions:
items:
properties:
key:
type: string
operator:
type: string
values:
items:
type: string
type: array
x-kubernetes-list-type: atomic
required:
- key
- operator
type: object
type: array
x-kubernetes-list-type: atomic
matchLabels:
additionalProperties:
type: string
type: object
type: object
x-kubernetes-map-type: atomic
scrapeInterval:
default: 30s
format: duration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7909,6 +7909,58 @@ spec:
type: object
type: object
x-kubernetes-map-type: atomic
probeSelector:
properties:
matchExpressions:
items:
properties:
key:
type: string
operator:
type: string
values:
items:
type: string
type: array
x-kubernetes-list-type: atomic
required:
- key
- operator
type: object
type: array
x-kubernetes-list-type: atomic
matchLabels:
additionalProperties:
type: string
type: object
type: object
x-kubernetes-map-type: atomic
scrapeConfigSelector:
properties:
matchExpressions:
items:
properties:
key:
type: string
operator:
type: string
values:
items:
type: string
type: array
x-kubernetes-list-type: atomic
required:
- key
- operator
type: object
type: array
x-kubernetes-list-type: atomic
matchLabels:
additionalProperties:
type: string
type: object
type: object
x-kubernetes-map-type: atomic
scrapeInterval:
default: 30s
format: duration
Expand Down
52 changes: 52 additions & 0 deletions config/crd/bases/opentelemetry.io_opentelemetrycollectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7895,6 +7895,58 @@ spec:
type: object
type: object
x-kubernetes-map-type: atomic
probeSelector:
properties:
matchExpressions:
items:
properties:
key:
type: string
operator:
type: string
values:
items:
type: string
type: array
x-kubernetes-list-type: atomic
required:
- key
- operator
type: object
type: array
x-kubernetes-list-type: atomic
matchLabels:
additionalProperties:
type: string
type: object
type: object
x-kubernetes-map-type: atomic
scrapeConfigSelector:
properties:
matchExpressions:
items:
properties:
key:
type: string
operator:
type: string
values:
items:
type: string
type: array
x-kubernetes-list-type: atomic
required:
- key
- operator
type: object
type: array
x-kubernetes-list-type: atomic
matchLabels:
additionalProperties:
type: string
type: object
type: object
x-kubernetes-map-type: atomic
scrapeInterval:
default: 30s
format: duration
Expand Down
52 changes: 52 additions & 0 deletions config/crd/bases/opentelemetry.io_targetallocators.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2269,6 +2269,58 @@ spec:
type: object
type: object
x-kubernetes-map-type: atomic
probeSelector:
properties:
matchExpressions:
items:
properties:
key:
type: string
operator:
type: string
values:
items:
type: string
type: array
x-kubernetes-list-type: atomic
required:
- key
- operator
type: object
type: array
x-kubernetes-list-type: atomic
matchLabels:
additionalProperties:
type: string
type: object
type: object
x-kubernetes-map-type: atomic
scrapeConfigSelector:
properties:
matchExpressions:
items:
properties:
key:
type: string
operator:
type: string
values:
items:
type: string
type: array
x-kubernetes-list-type: atomic
required:
- key
- operator
type: object
type: array
x-kubernetes-list-type: atomic
matchLabels:
additionalProperties:
type: string
type: object
type: object
x-kubernetes-map-type: atomic
scrapeInterval:
default: 30s
format: duration
Expand Down
Loading

0 comments on commit 438ffbc

Please sign in to comment.