endpoints defines the list of endpoints part of this ServiceMonitor.
Defines how to scrape metrics from Kubernetes [Endpoints](https://kubernetes.io/docs/concepts/services-networking/service/#endpoints) objects.
In most cases, an Endpoints object is backed by a Kubernetes [Service](https://kubernetes.io/docs/concepts/services-networking/service/) object with the same name and labels.
authorization
object
authorization configures the Authorization header credentials used by
the client.
Cannot be set at the same time as `basicAuth`, `bearerTokenSecret` or `oauth2`.
credentials
object
credentials defines a key of a Secret in the namespace that contains the credentials for authentication.
key
string required
The key of the secret to select from. Must be a valid secret key.
name
string
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
optional
boolean
Specify whether the Secret or its key must be defined
type
string
type defines the authentication type. The value is case-insensitive.
"Basic" is not a supported value.
Default: "Bearer"
basicAuth
object
basicAuth defines the Basic Authentication credentials used by the
client.
Cannot be set at the same time as `authorization`, `bearerTokenSecret` or `oauth2`.
password
object
password defines a key of a Secret containing the password for
authentication.
key
string required
The key of the secret to select from. Must be a valid secret key.
name
string
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
optional
boolean
Specify whether the Secret or its key must be defined
username
object
username defines a key of a Secret containing the username for
authentication.
key
string required
The key of the secret to select from. Must be a valid secret key.
name
string
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
optional
boolean
Specify whether the Secret or its key must be defined
bearerTokenFile
string
bearerTokenFile defines the file to read bearer token for scraping the target.
Deprecated: use `authorization` instead.
bearerTokenSecret
object
bearerTokenSecret defines a key of a Secret containing the bearer token
used by the client for authentication. The secret needs to be in the
same namespace as the custom resource and readable by the Prometheus
Operator.
Cannot be set at the same time as `authorization`, `basicAuth` or `oauth2`.
Deprecated: use `authorization` instead.
key
string required
The key of the secret to select from. Must be a valid secret key.
name
string
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
optional
boolean
Specify whether the Secret or its key must be defined
enableHttp2
boolean
enableHttp2 can be used to disable HTTP2.
filterRunning
boolean
filterRunning when true, the pods which are not running (e.g. either in Failed or
Succeeded state) are dropped during the target discovery.
If unset, the filtering is enabled.
More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase
followRedirects
boolean
followRedirects defines whether the client should follow HTTP 3xx
redirects.
honorLabels
boolean
honorLabels defines when true the metric's labels when they collide
with the target's labels.
honorTimestamps
boolean
honorTimestamps defines whether Prometheus preserves the timestamps
when exposed by the target.
interval
string
interval at which Prometheus scrapes the metrics from the target.
If empty, Prometheus uses the global scrape interval.
pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$
metricRelabelings
[]object
metricRelabelings defines the relabeling rules to apply to the
samples before ingestion.
action
string
action to perform based on the regex matching.
`Uppercase` and `Lowercase` actions require Prometheus >= v2.36.0.
`DropEqual` and `KeepEqual` actions require Prometheus >= v2.41.0.
Default: "Replace"
enum: replace, Replace, keep, Keep, drop, Drop, hashmod, HashMod, labelmap, LabelMap, labeldrop, LabelDrop, labelkeep, LabelKeep, lowercase, Lowercase, uppercase, Uppercase, keepequal, KeepEqual, dropequal, DropEqual
modulus
integer
modulus to take of the hash of the source label values.
Only applicable when the action is `HashMod`.
format: int64
regex
string
regex defines the regular expression against which the extracted value is matched.
replacement
string
replacement value against which a Replace action is performed if the
regular expression matches.
Regex capture groups are available.
separator
string
separator defines the string between concatenated SourceLabels.
sourceLabels
[]string
sourceLabels defines the source labels select values from existing labels. Their content is
concatenated using the configured Separator and matched against the
configured regular expression.
targetLabel
string
targetLabel defines the label to which the resulting string is written in a replacement.
It is mandatory for `Replace`, `HashMod`, `Lowercase`, `Uppercase`,
`KeepEqual` and `DropEqual` actions.
Regex capture groups are available.
noProxy
string
noProxy defines a comma-separated string that can contain IPs, CIDR notation, domain names
that should be excluded from proxying. IP and domain names can
contain port numbers.
It requires Prometheus >= v2.43.0, Alertmanager >= v0.25.0 or Thanos >= v0.32.0.
oauth2
object
oauth2 defines the OAuth2 settings used by the client.
It requires Prometheus >= 2.27.0.
Cannot be set at the same time as `authorization`, `basicAuth` or `bearerTokenSecret`.
clientId
object required
clientId defines a key of a Secret or ConfigMap containing the
OAuth2 client's ID.
configMap
object
configMap defines the ConfigMap containing data to use for the targets.
key
string required
The key to select.
name
string
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
optional
boolean
Specify whether the ConfigMap or its key must be defined
secret
object
secret defines the Secret containing data to use for the targets.
key
string required
The key of the secret to select from. Must be a valid secret key.
name
string
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
optional
boolean
Specify whether the Secret or its key must be defined
clientSecret
object required
clientSecret defines a key of a Secret containing the OAuth2
client's secret.
key
string required
The key of the secret to select from. Must be a valid secret key.
name
string
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
optional
boolean
Specify whether the Secret or its key must be defined
endpointParams
object
endpointParams configures the HTTP parameters to append to the token
URL.
noProxy
string
noProxy defines a comma-separated string that can contain IPs, CIDR notation, domain names
that should be excluded from proxying. IP and domain names can
contain port numbers.
It requires Prometheus >= v2.43.0, Alertmanager >= v0.25.0 or Thanos >= v0.32.0.
proxyConnectHeader
object
proxyConnectHeader optionally specifies headers to send to
proxies during CONNECT requests.
It requires Prometheus >= v2.43.0, Alertmanager >= v0.25.0 or Thanos >= v0.32.0.
proxyFromEnvironment
boolean
proxyFromEnvironment defines whether to use the proxy configuration defined by environment variables (HTTP_PROXY, HTTPS_PROXY, and NO_PROXY).
It requires Prometheus >= v2.43.0, Alertmanager >= v0.25.0 or Thanos >= v0.32.0.
proxyUrl
string
proxyUrl defines the HTTP proxy server to use.
pattern: ^(http|https|socks5)://.+$
scopes
[]string
scopes defines the OAuth2 scopes used for the token request.
tlsConfig
object
tlsConfig defines the TLS configuration to use when connecting to the OAuth2 server.
It requires Prometheus >= v2.43.0.
ca
object
ca defines the Certificate authority used when verifying server certificates.
configMap
object
configMap defines the ConfigMap containing data to use for the targets.
key
string required
The key to select.
name
string
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
optional
boolean
Specify whether the ConfigMap or its key must be defined
secret
object
secret defines the Secret containing data to use for the targets.
key
string required
The key of the secret to select from. Must be a valid secret key.
name
string
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
optional
boolean
Specify whether the Secret or its key must be defined
cert
object
cert defines the Client certificate to present when doing client-authentication.
configMap
object
configMap defines the ConfigMap containing data to use for the targets.
key
string required
The key to select.
name
string
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
optional
boolean
Specify whether the ConfigMap or its key must be defined
secret
object
secret defines the Secret containing data to use for the targets.
key
string required
The key of the secret to select from. Must be a valid secret key.
name
string
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
optional
boolean
Specify whether the Secret or its key must be defined
insecureSkipVerify
boolean
insecureSkipVerify defines how to disable target certificate validation.
keySecret
object
keySecret defines the Secret containing the client key file for the targets.
key
string required
The key of the secret to select from. Must be a valid secret key.
name
string
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
optional
boolean
Specify whether the Secret or its key must be defined
maxVersion
string
maxVersion defines the maximum acceptable TLS version.
It requires Prometheus >= v2.41.0 or Thanos >= v0.31.0.
enum: TLS10, TLS11, TLS12, TLS13
minVersion
string
minVersion defines the minimum acceptable TLS version.
It requires Prometheus >= v2.35.0 or Thanos >= v0.28.0.
enum: TLS10, TLS11, TLS12, TLS13
serverName
string
serverName is used to verify the hostname for the targets.
tokenUrl
string required
tokenUrl defines the URL to fetch the token from.
minLength: 1
params
object
params define optional HTTP URL parameters.
path
string
path defines the HTTP path from which to scrape for metrics.
If empty, Prometheus uses the default value (e.g. `/metrics`).
port
string
port defines the name of the Service port which this endpoint refers to.
It takes precedence over `targetPort`.
proxyConnectHeader
object
proxyConnectHeader optionally specifies headers to send to
proxies during CONNECT requests.
It requires Prometheus >= v2.43.0, Alertmanager >= v0.25.0 or Thanos >= v0.32.0.
proxyFromEnvironment
boolean
proxyFromEnvironment defines whether to use the proxy configuration defined by environment variables (HTTP_PROXY, HTTPS_PROXY, and NO_PROXY).
It requires Prometheus >= v2.43.0, Alertmanager >= v0.25.0 or Thanos >= v0.32.0.
proxyUrl
string
proxyUrl defines the HTTP proxy server to use.
pattern: ^(http|https|socks5)://.+$
relabelings
[]object
relabelings defines the relabeling rules to apply the target's
metadata labels.
The 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
string
action to perform based on the regex matching.
`Uppercase` and `Lowercase` actions require Prometheus >= v2.36.0.
`DropEqual` and `KeepEqual` actions require Prometheus >= v2.41.0.
Default: "Replace"
enum: replace, Replace, keep, Keep, drop, Drop, hashmod, HashMod, labelmap, LabelMap, labeldrop, LabelDrop, labelkeep, LabelKeep, lowercase, Lowercase, uppercase, Uppercase, keepequal, KeepEqual, dropequal, DropEqual
modulus
integer
modulus to take of the hash of the source label values.
Only applicable when the action is `HashMod`.
format: int64
regex
string
regex defines the regular expression against which the extracted value is matched.
replacement
string
replacement value against which a Replace action is performed if the
regular expression matches.
Regex capture groups are available.
separator
string
separator defines the string between concatenated SourceLabels.
sourceLabels
[]string
sourceLabels defines the source labels select values from existing labels. Their content is
concatenated using the configured Separator and matched against the
configured regular expression.
targetLabel
string
targetLabel defines the label to which the resulting string is written in a replacement.
It is mandatory for `Replace`, `HashMod`, `Lowercase`, `Uppercase`,
`KeepEqual` and `DropEqual` actions.
Regex capture groups are available.
scheme
string
scheme defines the HTTP scheme to use when scraping the metrics.
enum: http, https, HTTP, HTTPS
scrapeTimeout
string
scrapeTimeout defines the timeout after which Prometheus considers the scrape to be failed.
If empty, Prometheus uses the global scrape timeout unless it is less
than the target's scrape interval value in which the latter is used.
The value cannot be greater than the scrape interval otherwise the operator will reject the resource.
pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$
targetPort
object
targetPort defines the name or number of the target port of the `Pod` object behind the
Service. The port must be specified with the container's port property.
tlsConfig
object
tlsConfig defines TLS configuration used by the client.
ca
object
ca defines the Certificate authority used when verifying server certificates.
configMap
object
configMap defines the ConfigMap containing data to use for the targets.
key
string required
The key to select.
name
string
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
optional
boolean
Specify whether the ConfigMap or its key must be defined
secret
object
secret defines the Secret containing data to use for the targets.
key
string required
The key of the secret to select from. Must be a valid secret key.
name
string
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
optional
boolean
Specify whether the Secret or its key must be defined
caFile
string
caFile defines the path to the CA cert in the Prometheus container to use for the targets.
cert
object
cert defines the Client certificate to present when doing client-authentication.
configMap
object
configMap defines the ConfigMap containing data to use for the targets.
key
string required
The key to select.
name
string
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
optional
boolean
Specify whether the ConfigMap or its key must be defined
secret
object
secret defines the Secret containing data to use for the targets.
key
string required
The key of the secret to select from. Must be a valid secret key.
name
string
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
optional
boolean
Specify whether the Secret or its key must be defined
certFile
string
certFile defines the path to the client cert file in the Prometheus container for the targets.
insecureSkipVerify
boolean
insecureSkipVerify defines how to disable target certificate validation.
keyFile
string
keyFile defines the path to the client key file in the Prometheus container for the targets.
keySecret
object
keySecret defines the Secret containing the client key file for the targets.
key
string required
The key of the secret to select from. Must be a valid secret key.
name
string
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
optional
boolean
Specify whether the Secret or its key must be defined
maxVersion
string
maxVersion defines the maximum acceptable TLS version.
It requires Prometheus >= v2.41.0 or Thanos >= v0.31.0.
enum: TLS10, TLS11, TLS12, TLS13
minVersion
string
minVersion defines the minimum acceptable TLS version.
It requires Prometheus >= v2.35.0 or Thanos >= v0.28.0.
enum: TLS10, TLS11, TLS12, TLS13
serverName
string
serverName is used to verify the hostname for the targets.
trackTimestampsStaleness
boolean
trackTimestampsStaleness defines whether Prometheus tracks staleness of
the metrics that have an explicit timestamp present in scraped data.
Has no effect if `honorTimestamps` is false.
It requires Prometheus >= v2.48.0.