Skip to content

serviceMonitor

serviceMonitor objects to be generated by the chart. Additional ServiceMonitors can be added by adding a dictionary key similar to the ‘main’ ServiceMonitor.

object

Keys are identifiers for serviceMonitor instances.

serviceMonitor:
main:
enabled: true
# ... configuration
secondary:
enabled: true
# ... configuration

Available properties:

PropertyTypeRequiredDefaultDescription
annotationsobject / nullNo-Annotations to set on the item.
enabledbooleanNotrueSet to false to disable the ServiceMonitor.
endpointsarrayNo-Endpoints allowed as part of this ServiceMonitor.
forceRenamestringNo-Override the default resource name. Mutually exclusive wi…
jobLabelstringNoapp.kubernetes.io/nameThe label to use to retrieve the job name from the target…
labelsobject / nullNo-Labels to set on the item.
prefixstringNoPrefix to prepend to the resource name. Mutually exclusiv…
selectorobjectNo-Selector to select Endpoints objects.
serviceobjectNo-Service to monitor. Either ‘serviceName’ or ’…
serviceNamestringNo-Reference to a Service name to monitor. Helm templates ar…
suffixstringNo-Suffix to append to the resource name. Defaults to the re…
targetLabelsarrayNo-Transfers labels from the Kubernetes Service onto the cre…

Override the default resource name. Mutually exclusive with prefix and suffix.

The label to use to retrieve the job name from the target service’s metadata. Defaults to ‘app.kubernetes.io/name’. Helm templates can be used.

Prefix to prepend to the resource name. Mutually exclusive with forceRename.

Service to monitor. Either ‘serviceName’ or ‘service’ must be specified.

PropertyTypeRequiredDefaultDescription
namestringYes-

Reference to a Service name to monitor. Helm templates are supported. Deprecated in favor of ‘service’.

Suffix to append to the resource name. Defaults to the resource identifier if there are multiple items, otherwise empty. Mutually exclusive with forceRename.

Transfers labels from the Kubernetes Service onto the created metrics. See https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api-reference/api.md#servicemonitorspec for details.