Skip to content

Commit 438ffbc

Browse files
authored
Change TargetAllocator configmap for ScrapeConfig and Probe CR (#3469)
* 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]>
1 parent 781818b commit 438ffbc

16 files changed

+693
-14
lines changed

.chloggen/scrape_config_probe.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: enhancement
3+
4+
# The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action)
5+
component: collector
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: enables support for pulling scrape config and probe CRDs in the target allocator
9+
10+
# One or more tracking issues related to the change
11+
issues: [1842]
12+
13+
# (Optional) One or more lines of additional information to render under the primary note.
14+
# These lines will be padded with 2 spaces and then inserted directly into the document.
15+
# Use pipe (|) for multiline entries.
16+
subtext:

apis/v1beta1/targetallocator_types.go

+12
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,18 @@ type TargetAllocatorPrometheusCR struct {
4242
// label selector matches no objects.
4343
// +optional
4444
ServiceMonitorSelector *metav1.LabelSelector `json:"serviceMonitorSelector,omitempty"`
45+
// ScrapeConfigs to be selected for target discovery.
46+
// A label selector is a label query over a set of resources. The result of matchLabels and
47+
// matchExpressions are ANDed. An empty label selector matches all objects. A null
48+
// label selector matches no objects.
49+
// +optional
50+
ScrapeConfigSelector *metav1.LabelSelector `json:"scrapeConfigSelector,omitempty"`
51+
// Probes to be selected for target discovery.
52+
// A label selector is a label query over a set of resources. The result of matchLabels and
53+
// matchExpressions are ANDed. An empty label selector matches all objects. A null
54+
// label selector matches no objects.
55+
// +optional
56+
ProbeSelector *metav1.LabelSelector `json:"probeSelector,omitempty"`
4557
}
4658

4759
type (

apis/v1beta1/zz_generated.deepcopy.go

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundle/community/manifests/opentelemetry.io_opentelemetrycollectors.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -7909,6 +7909,58 @@ spec:
79097909
type: object
79107910
type: object
79117911
x-kubernetes-map-type: atomic
7912+
probeSelector:
7913+
properties:
7914+
matchExpressions:
7915+
items:
7916+
properties:
7917+
key:
7918+
type: string
7919+
operator:
7920+
type: string
7921+
values:
7922+
items:
7923+
type: string
7924+
type: array
7925+
x-kubernetes-list-type: atomic
7926+
required:
7927+
- key
7928+
- operator
7929+
type: object
7930+
type: array
7931+
x-kubernetes-list-type: atomic
7932+
matchLabels:
7933+
additionalProperties:
7934+
type: string
7935+
type: object
7936+
type: object
7937+
x-kubernetes-map-type: atomic
7938+
scrapeConfigSelector:
7939+
properties:
7940+
matchExpressions:
7941+
items:
7942+
properties:
7943+
key:
7944+
type: string
7945+
operator:
7946+
type: string
7947+
values:
7948+
items:
7949+
type: string
7950+
type: array
7951+
x-kubernetes-list-type: atomic
7952+
required:
7953+
- key
7954+
- operator
7955+
type: object
7956+
type: array
7957+
x-kubernetes-list-type: atomic
7958+
matchLabels:
7959+
additionalProperties:
7960+
type: string
7961+
type: object
7962+
type: object
7963+
x-kubernetes-map-type: atomic
79127964
scrapeInterval:
79137965
default: 30s
79147966
format: duration

bundle/openshift/manifests/opentelemetry.io_opentelemetrycollectors.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -7909,6 +7909,58 @@ spec:
79097909
type: object
79107910
type: object
79117911
x-kubernetes-map-type: atomic
7912+
probeSelector:
7913+
properties:
7914+
matchExpressions:
7915+
items:
7916+
properties:
7917+
key:
7918+
type: string
7919+
operator:
7920+
type: string
7921+
values:
7922+
items:
7923+
type: string
7924+
type: array
7925+
x-kubernetes-list-type: atomic
7926+
required:
7927+
- key
7928+
- operator
7929+
type: object
7930+
type: array
7931+
x-kubernetes-list-type: atomic
7932+
matchLabels:
7933+
additionalProperties:
7934+
type: string
7935+
type: object
7936+
type: object
7937+
x-kubernetes-map-type: atomic
7938+
scrapeConfigSelector:
7939+
properties:
7940+
matchExpressions:
7941+
items:
7942+
properties:
7943+
key:
7944+
type: string
7945+
operator:
7946+
type: string
7947+
values:
7948+
items:
7949+
type: string
7950+
type: array
7951+
x-kubernetes-list-type: atomic
7952+
required:
7953+
- key
7954+
- operator
7955+
type: object
7956+
type: array
7957+
x-kubernetes-list-type: atomic
7958+
matchLabels:
7959+
additionalProperties:
7960+
type: string
7961+
type: object
7962+
type: object
7963+
x-kubernetes-map-type: atomic
79127964
scrapeInterval:
79137965
default: 30s
79147966
format: duration

config/crd/bases/opentelemetry.io_opentelemetrycollectors.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -7895,6 +7895,58 @@ spec:
78957895
type: object
78967896
type: object
78977897
x-kubernetes-map-type: atomic
7898+
probeSelector:
7899+
properties:
7900+
matchExpressions:
7901+
items:
7902+
properties:
7903+
key:
7904+
type: string
7905+
operator:
7906+
type: string
7907+
values:
7908+
items:
7909+
type: string
7910+
type: array
7911+
x-kubernetes-list-type: atomic
7912+
required:
7913+
- key
7914+
- operator
7915+
type: object
7916+
type: array
7917+
x-kubernetes-list-type: atomic
7918+
matchLabels:
7919+
additionalProperties:
7920+
type: string
7921+
type: object
7922+
type: object
7923+
x-kubernetes-map-type: atomic
7924+
scrapeConfigSelector:
7925+
properties:
7926+
matchExpressions:
7927+
items:
7928+
properties:
7929+
key:
7930+
type: string
7931+
operator:
7932+
type: string
7933+
values:
7934+
items:
7935+
type: string
7936+
type: array
7937+
x-kubernetes-list-type: atomic
7938+
required:
7939+
- key
7940+
- operator
7941+
type: object
7942+
type: array
7943+
x-kubernetes-list-type: atomic
7944+
matchLabels:
7945+
additionalProperties:
7946+
type: string
7947+
type: object
7948+
type: object
7949+
x-kubernetes-map-type: atomic
78987950
scrapeInterval:
78997951
default: 30s
79007952
format: duration

config/crd/bases/opentelemetry.io_targetallocators.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -2269,6 +2269,58 @@ spec:
22692269
type: object
22702270
type: object
22712271
x-kubernetes-map-type: atomic
2272+
probeSelector:
2273+
properties:
2274+
matchExpressions:
2275+
items:
2276+
properties:
2277+
key:
2278+
type: string
2279+
operator:
2280+
type: string
2281+
values:
2282+
items:
2283+
type: string
2284+
type: array
2285+
x-kubernetes-list-type: atomic
2286+
required:
2287+
- key
2288+
- operator
2289+
type: object
2290+
type: array
2291+
x-kubernetes-list-type: atomic
2292+
matchLabels:
2293+
additionalProperties:
2294+
type: string
2295+
type: object
2296+
type: object
2297+
x-kubernetes-map-type: atomic
2298+
scrapeConfigSelector:
2299+
properties:
2300+
matchExpressions:
2301+
items:
2302+
properties:
2303+
key:
2304+
type: string
2305+
operator:
2306+
type: string
2307+
values:
2308+
items:
2309+
type: string
2310+
type: array
2311+
x-kubernetes-list-type: atomic
2312+
required:
2313+
- key
2314+
- operator
2315+
type: object
2316+
type: array
2317+
x-kubernetes-list-type: atomic
2318+
matchLabels:
2319+
additionalProperties:
2320+
type: string
2321+
type: object
2322+
type: object
2323+
x-kubernetes-map-type: atomic
22722324
scrapeInterval:
22732325
default: 30s
22742326
format: duration

0 commit comments

Comments
 (0)