ServiceMonitor defines monitoring for a set of services.
Last changed in Prometheus Operator v0.65.0
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Specification of desired Service selection for target discovery by Prometheus.
Attaches node metadata to discovered targets. Requires Prometheus v2.37.0 and above.
When set to true, Prometheus must have permissions to get Nodes.
A list of endpoints allowed as part of this ServiceMonitor.
Authorization section for this endpoint
The secret's key that contains the credentials of the request
The key of the secret to select from. Must be a valid secret key.
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
Specify whether the Secret or its key must be defined
Set the authentication type. Defaults to Bearer, Basic will cause an error
BasicAuth allow an endpoint to authenticate over basic authentication More info: https://prometheus.io/docs/operating/configuration/#endpoints
The secret in the service monitor namespace that contains the password for authentication.
The key of the secret to select from. Must be a valid secret key.
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
Specify whether the Secret or its key must be defined
The secret in the service monitor namespace that contains the username for authentication.
The key of the secret to select from. Must be a valid secret key.
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
Specify whether the Secret or its key must be defined
File to read bearer token for scraping targets.
Secret to mount to read bearer token for scraping targets. The secret needs to be in the same namespace as the service monitor and accessible by the Prometheus Operator.
The key of the secret to select from. Must be a valid secret key.
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
Specify whether the Secret or its key must be defined
Whether to enable HTTP2.
Drop pods that are not running. (Failed, Succeeded). Enabled by default. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase
FollowRedirects configures whether scrape requests follow HTTP 3xx redirects.
HonorLabels chooses the metric's labels on collisions with target labels.
HonorTimestamps controls whether Prometheus respects the timestamps present in scraped data.
Interval at which metrics should be scraped If not specified Prometheus' global scrape interval is used.
MetricRelabelConfigs to apply to samples before ingestion.
Action to perform based on regex matching. Default is 'replace'. uppercase and lowercase actions require Prometheus >= 2.36.
Modulus to take of the hash of the source label values.
Regular expression against which the extracted value is matched. Default is '(.*)'
Replacement value against which a regex replace is performed if the regular expression matches. Regex capture groups are available. Default is '$1'
Separator placed between concatenated source label values. default is ';'.
The source labels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the replace, keep, and drop actions.
Label to which the resulting value is written in a replace action. It is mandatory for replace actions. Regex capture groups are available.
OAuth2 for the URL. Only valid in Prometheus versions 2.27.0 and newer.
The secret or configmap containing the OAuth2 client id
ConfigMap containing data to use for the targets.
The key to select.
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
Specify whether the ConfigMap or its key must be defined
Secret containing data to use for the targets.
The key of the secret to select from. Must be a valid secret key.
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
Specify whether the Secret or its key must be defined
The secret containing the OAuth2 client secret
The key of the secret to select from. Must be a valid secret key.
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
Specify whether the Secret or its key must be defined
Parameters to append to the token URL
OAuth2 scopes used for the token request
The URL to fetch the token from
Optional HTTP URL parameters
HTTP path to scrape for metrics. If empty, Prometheus uses the default value (e.g. `/metrics`).
Name of the service port this endpoint refers to. Mutually exclusive with targetPort.
ProxyURL eg http://proxyserver:2195 Directs scrapes to proxy through this endpoint.
RelabelConfigs to apply to samples before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields. The original scrape job's name is available via the `__tmp_prometheus_job_name` label. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
Action to perform based on regex matching. Default is 'replace'. uppercase and lowercase actions require Prometheus >= 2.36.
Modulus to take of the hash of the source label values.
Regular expression against which the extracted value is matched. Default is '(.*)'
Replacement value against which a regex replace is performed if the regular expression matches. Regex capture groups are available. Default is '$1'
Separator placed between concatenated source label values. default is ';'.
The source labels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the replace, keep, and drop actions.
Label to which the resulting value is written in a replace action. It is mandatory for replace actions. Regex capture groups are available.
HTTP scheme to use for scraping. `http` and `https` are the expected values unless you rewrite the `__scheme__` label via relabeling. If empty, Prometheus uses the default value `http`.
Timeout after which the scrape is ended If not specified, the Prometheus global scrape timeout is used unless it is less than `Interval` in which the latter is used.
Name or number of the target port of the Pod behind the Service, the port must be specified with container port property. Mutually exclusive with port.
TLS configuration to use when scraping the endpoint
Certificate authority used when verifying server certificates.
ConfigMap containing data to use for the targets.
The key to select.
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
Specify whether the ConfigMap or its key must be defined
Secret containing data to use for the targets.
The key of the secret to select from. Must be a valid secret key.
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
Specify whether the Secret or its key must be defined
Path to the CA cert in the Prometheus container to use for the targets.
Client certificate to present when doing client-authentication.
ConfigMap containing data to use for the targets.
The key to select.
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
Specify whether the ConfigMap or its key must be defined
Secret containing data to use for the targets.
The key of the secret to select from. Must be a valid secret key.
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
Specify whether the Secret or its key must be defined
Path to the client cert file in the Prometheus container for the targets.
Disable target certificate validation.
Path to the client key file in the Prometheus container for the targets.
Secret containing the client key file for the targets.
The key of the secret to select from. Must be a valid secret key.
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
Specify whether the Secret or its key must be defined
Used to verify the hostname for the targets.
JobLabel selects the label from the associated Kubernetes service which will be used as the `job` label for all metrics. For example: If in `ServiceMonitor.spec.jobLabel: foo` and in `Service.metadata.labels.foo: bar`, then the `job="bar"` label is added to all metrics. If the value of this field is empty or if the label doesn't exist for the given Service, the `job` label of the metrics defaults to the name of the Kubernetes Service.
Per-scrape limit on number of labels that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
Per-scrape limit on length of labels name that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
Per-scrape limit on length of labels value that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
Selector to select which namespaces the Kubernetes Endpoints objects are discovered from.
Boolean describing whether all namespaces are selected in contrast to a list restricting them.
List of namespace names to select from.
PodTargetLabels transfers labels on the Kubernetes `Pod` onto the created metrics.
SampleLimit defines per-scrape limit on number of scraped samples that will be accepted.
Selector to select Endpoints objects.
matchExpressions is a list of label selector requirements. The requirements are ANDed.
key is the label key that the selector applies to.
operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
TargetLabels transfers labels from the Kubernetes `Service` onto the created metrics.
TargetLimit defines a limit on the number of scraped targets that will be accepted.
Source: bundle.yaml
Changes to ServiceMonitor (monitoring.coreos.com/v1) in each Prometheus Operator version, compared to the version before it.
1 property has changed the description
Released · View ServiceMonitor in v0.65.0
2 properties have been added
2 properties have changed the description
Released · View ServiceMonitor in v0.61.0
1 property has been added
4 properties have changed the description
Released · View ServiceMonitor in v0.58.0
2 properties have changed the description
Released · View ServiceMonitor in v0.56.0
1 property has been added
3 properties have changed the description
Released · View ServiceMonitor in v0.55.0
5 properties have been added
Released · View ServiceMonitor in v0.50.0
4 properties have changed the description
Released · View ServiceMonitor in v0.49.0
1 property has changed the description
Released · View ServiceMonitor in v0.47.0
1 property has been added
1 property has changed the description
Released · View ServiceMonitor in v0.43.0
1 property has changed the description
Released · View ServiceMonitor in v0.42.0
1 property has changed the description
Released · View ServiceMonitor in v0.38.0
5 properties have been added
3 properties have changed type
1 property is now required
The description of ServiceMonitor has changed
17 properties have changed the description
Released · View ServiceMonitor in v0.35.0
5 properties have been added
5 properties have changed the description
Released · View ServiceMonitor in v0.34.0
3 properties have changed the description
Released · View ServiceMonitor in v0.32.0
1 property has changed the description
Released · View ServiceMonitor in v0.29.0
3 properties have been added
Released · View ServiceMonitor in v0.24.0
1 property has changed the description
Released · View ServiceMonitor in v0.23.0
1 property is no longer required
The description of ServiceMonitor has changed
Released · View ServiceMonitor in v0.22.0
1 property has been added
Released · View ServiceMonitor in v0.20.0
1 property has been added
2 properties are no longer required
Released · View ServiceMonitor in v0.18.0
ServiceMonitor was already present in this version of Prometheus Operator, the oldest one on kubespec.dev
Released · View ServiceMonitor in v0.17.0
No examples of ServiceMonitor yet. Contribute one on GitHub.