1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-21 03:38:43 +00:00

Document namespace selector

This commit is contained in:
Fabian Reinartz 2017-01-17 14:24:17 +01:00
parent 9001d9e780
commit 6673422a76
2 changed files with 10 additions and 5 deletions
Documentation
pkg/client/monitoring/v1alpha1

View file

@ -29,6 +29,7 @@ of the service endpoints. This is also made possible by the Prometheus Operator.
| ---- | ----------- | -------- | ------ | ------- |
| jobLabel | Service label of which the value is used to assemble a job name of the form `<label value>-<port>`. If no label is specified, the service name is used. | false | string | |
| selector | Label selector for services the `ServiceMonitor` applies to. | true | [unversioned.LabelSelector](http://kubernetes.io/docs/api-reference/v1/definitions/#_unversioned_labelselector) | |
| namespaceSelector | Namespaces from which services are selected. | false | NamespaceSelector | same namespace only |
| endpoints | The endpoints to be monitored for endpoints of the selected services. | true | Endpoint array | |
### `Endpoint`
@ -41,6 +42,13 @@ of the service endpoints. This is also made possible by the Prometheus Operator.
| scheme | HTTP scheme to use for scraping | false | string | http |
| interval | Interval at which metrics should be scraped | false | duration | 30s |
### `NamespaceSelector`
| Name | Description | Required | Schema | Default |
| ---- | ----------- | -------- | ------ | ------- |
| any | Match any namespace | false | bool | false |
| matchNames | Explicit list of namespace names to select | false | string array | |
## Current state and roadmap

View file

@ -107,10 +107,7 @@ type ServiceMonitorSpec struct {
JobLabel string `json:"jobLabel"`
Endpoints []Endpoint `json:"endpoints"`
Selector metav1.LabelSelector `json:"selector"`
NamespaceSelector Selector `json:"namespaceSelector"`
// AllNamespaces bool `json:"allNamespaces"`
// Namespaces []string `json:"namespaces"`
// NamespaceSelector metav1.LabelSelector `json:"namespaceSelector"`
NamespaceSelector NamespaceSelector `json:"namespaceSelector"`
}
// Endpoint defines a scrapeable endpoint serving Prometheus metrics.
@ -166,7 +163,7 @@ type AlertmanagerList struct {
Items []Alertmanager `json:"items"`
}
type Selector struct {
type NamespaceSelector struct {
Any bool `json:"any,omitempty"`
MatchNames []string `json:"matchNames,omitempty"`