mirror of
https://github.com/prometheus-operator/prometheus-operator.git
synced 2025-04-21 11:48:53 +00:00
Revert "Merge pull request #1100 from metalmatze/staticconfigs"
This reverts commit3533e1c22f
, reversing changes made to0ae7f5ddf9
. With the _additional-scrape-config_ feature via Kubernetes secrets, the _static-configs_ feature in Service Monitors is redundant. This patch reverts the latter one.
This commit is contained in:
parent
ab13af9628
commit
433406488f
7 changed files with 0 additions and 62 deletions
Documentation
example/prometheus-operator-crd
pkg
client/monitoring/v1
prometheus
|
@ -152,7 +152,6 @@ Endpoint defines a scrapeable endpoint serving Prometheus metrics.
|
|||
| honorLabels | HonorLabels chooses the metric's labels on collisions with target labels. | bool | false |
|
||||
| basicAuth | BasicAuth allow an endpoint to authenticate over basic authentication More info: https://prometheus.io/docs/operating/configuration/#endpoints | *[BasicAuth](#basicauth) | false |
|
||||
| metricRelabelings | MetricRelabelConfigs to apply to samples before ingestion. | []*[RelabelConfig](#relabelconfig) | false |
|
||||
| staticTargets | StaticTargets with targets to scrape. | []string | false |
|
||||
|
||||
[Back to TOC](#table-of-contents)
|
||||
|
||||
|
|
|
@ -140,11 +140,6 @@ spec:
|
|||
scrapeTimeout:
|
||||
description: Timeout after which the scrape is ended
|
||||
type: string
|
||||
staticTargets:
|
||||
description: StaticTargets with targets to scrape.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
targetPort: {}
|
||||
tlsConfig:
|
||||
description: TLSConfig specifies TLS configuration parameters.
|
||||
|
|
|
@ -539,20 +539,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
|
|||
},
|
||||
},
|
||||
},
|
||||
"staticTargets": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "StaticTargets with targets to scrape.",
|
||||
Type: []string{"array"},
|
||||
Items: &spec.SchemaOrArray{
|
||||
Schema: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -347,8 +347,6 @@ type Endpoint struct {
|
|||
BasicAuth *BasicAuth `json:"basicAuth,omitempty"`
|
||||
// MetricRelabelConfigs to apply to samples before ingestion.
|
||||
MetricRelabelConfigs []*RelabelConfig `json:"metricRelabelings,omitempty"`
|
||||
// StaticTargets with targets to scrape.
|
||||
StaticTargets []string `json:"staticTargets,omitempty"`
|
||||
}
|
||||
|
||||
// BasicAuth allow an endpoint to authenticate over basic authentication
|
||||
|
|
|
@ -333,11 +333,6 @@ func (in *Endpoint) DeepCopyInto(out *Endpoint) {
|
|||
}
|
||||
}
|
||||
}
|
||||
if in.StaticTargets != nil {
|
||||
in, out := &in.StaticTargets, &out.StaticTargets
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -244,16 +244,6 @@ func generateServiceMonitorConfig(version semver.Version, m *v1.ServiceMonitor,
|
|||
|
||||
cfg = addTLStoYaml(cfg, ep.TLSConfig)
|
||||
|
||||
if ep.StaticTargets != nil {
|
||||
cfg = append(cfg, yaml.MapItem{
|
||||
Key: "static_configs",
|
||||
Value: yaml.MapItem{
|
||||
Key: "targets",
|
||||
Value: ep.StaticTargets,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
if ep.BearerTokenFile != "" {
|
||||
cfg = append(cfg, yaml.MapItem{Key: "bearer_token_file", Value: ep.BearerTokenFile})
|
||||
}
|
||||
|
|
|
@ -319,30 +319,5 @@ func makeServiceMonitors() map[string]*monitoringv1.ServiceMonitor {
|
|||
},
|
||||
}
|
||||
|
||||
res["servicemonitor5"] = &monitoringv1.ServiceMonitor{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "testservicemonitor5",
|
||||
Namespace: "default",
|
||||
Labels: map[string]string{
|
||||
"group": "group4",
|
||||
},
|
||||
},
|
||||
Spec: monitoringv1.ServiceMonitorSpec{
|
||||
Endpoints: []monitoringv1.Endpoint{
|
||||
{
|
||||
Port: "web",
|
||||
Interval: "30s",
|
||||
Path: "/federate",
|
||||
Params: map[string][]string{"metrics[]": {"{__name__=~\"job:.*\"}"}},
|
||||
StaticTargets: []string{
|
||||
"source-prometheus-1:9090",
|
||||
"source-prometheus-2:9090",
|
||||
"source-prometheus-3:9090",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue