Skip to content

monitoring.v1alpha1.endpoint

Endpoint is a helper to create endpoint configurations in ServiceMonitors. An endpoint defines a scrapeable endpoint serving Prometheus metrics.

Index

Fields

fn withBearerTokenFile

withBearerTokenFile(path)

File to read bearer token for scraping targets.

fn withHonorLabels

withHonorLabels(honor_labels)

HonorLabels chooses the metric’s labels on collisions with target labels.

fn withHonorTimestamps

withHonorTimestamps(honor_timestamps)

HonorTimestamps controls whether Prometheus respects the timestamps present in scraped data.

fn withInterval

withInterval(interval)

Interval at which metrics should be scraped.

fn withMetricRelabelings

withMetricRelabelings(relabelings)

MetricRelabelConfigs to apply to samples before ingestion.

fn withParams

withParams(params)

Optional HTTP URL parameters.

fn withPath

withPath(path)

HTTP path to scrape for metrics.

fn withPort

withPort(port)

Name of the service port this endpoint refers to. Mutually exclusive with withTargetPort.

fn withProxyUrl

withProxyUrl(url)

ProxyURL eg http://proxyserver:2195 Directs scrapes to proxy through this endpoint.

fn withRelabelings

withRelabelings(relabelings)

RelabelConfigs to apply to samples before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields and replaces original scrape job name with __tmp_prometheus_job_name. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config

fn withScheme

withScheme(scheme)

HTTP scheme to use for scraping.

fn withScrapeTimeout

withScrapeTimeout(timeout)

Timeout after which the scrape is ended.

fn withTargetPort

withTargetPort(port)

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 withPort.

obj authorization

Authorization section for this endpoint

fn authorization.withType

withType(type)

Set the authentication type. Defaults to Bearer, Basic will cause an error

obj authorization.credentials

The secret's key that contains the credentials of the request

fn authorization.credentials.withKey

withKey(key)

The key of the secret to select from. Must be a valid secret key.

fn authorization.credentials.withName

withName(name)

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

fn authorization.credentials.withOptional

withOptional(is_optional)

Specify whether the Secret or its key must be defined

obj basicAuth

BasicAuth allow an endpoint to authenticate over basic authentication More info: https://prometheus.io/docs/operating/configuration/#endpoints

obj basicAuth.password

The secret in the service monitor namespace that contains the password for authentication.

fn basicAuth.password.withKey

withKey(key)

The key of the secret to select from. Must be a valid secret key.

fn basicAuth.password.withName

withName(name)

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

fn basicAuth.password.withOptional

withOptional(is_optional)

Specify whether the Secret or its key must be defined

obj basicAuth.username

The secret in the service monitor namespace that contains the username for authentication.

fn basicAuth.username.withKey

withKey(key)

The key of the secret to select from. Must be a valid secret key.

fn basicAuth.username.withName

withName(name)

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

fn basicAuth.username.withOptional

withOptional(is_optional)

Specify whether the Secret or its key must be defined

obj bearerTokenSecret

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.

fn bearerTokenSecret.withKey

withKey(key)

The key of the secret to select from. Must be a valid secret key.

fn bearerTokenSecret.withName

withName(name)

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

fn bearerTokenSecret.withOptional

withOptional(is_optional)

Specify whether the Secret or its key must be defined

obj oauth2

OAuth2 for the URL. Only valid in Prometheus versions 2.27.0 and newer.

fn oauth2.withEndpointParams

withEndpointParams(params)

Parameters to append to the token URL

fn oauth2.withScopes

withScopes(scopes)

OAuth2 scopes used for the token request.

fn oauth2.withTokenUrl

withTokenUrl(url)

The URL to fetch the token from.

obj oauth2.clientId

The secret or configmap containing the OAuth2 client id.

obj oauth2.clientId.configMap

ConfigMap containing data to use for the targets. Mutually exclusive with secret.

fn oauth2.clientId.configMap.withKey

withKey(key)

The key to select.

fn oauth2.clientId.configMap.withName

withName(name)

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

fn oauth2.clientId.configMap.withOptional

withOptional(is_optional)

Specify whether the ConfigMap or its key must be defined.

obj oauth2.clientId.secret

Secret containing data to use for the targets. Mutually exclusive with configMap.

fn oauth2.clientId.secret.withKey

withKey(key)

The key of the secret to select from. Must be a valid secret key.

fn oauth2.clientId.secret.withName

withName(name)

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

fn oauth2.clientId.secret.withOptional

withOptional(is_optional)

Specify whether the Secret or its key must be defined

obj oauth2.clientSecret

The secret containing the OAuth2 client secret.

fn oauth2.clientSecret.withKey

withKey(key)

The key of the secret to select from. Must be a valid secret key.

fn oauth2.clientSecret.withName

withName(name)

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

fn oauth2.clientSecret.withOptional

withOptional(is_optional)

Specify whether the Secret or its key must be defined

obj tlsConfig

TLS configuration to use when scraping the endpoint

fn tlsConfig.withCaFile

withCaFile(path)

Path to the CA cert in the Prometheus container to use for the targets.

fn tlsConfig.withCertFile

withCertFile(path)

Path to the client cert file in the Prometheus container for the targets.

fn tlsConfig.withInsecureSkipVerify

withInsecureSkipVerify(skip_verify)

Disable target certificate validation.

fn tlsConfig.withKeyFile

withKeyFile(path)

Path to the client key file in the Prometheus container for the targets.

fn tlsConfig.withServerName

withServerName(name)

Used to verify the hostname for the targets.

obj tlsConfig.ca

Struct containing the CA cert to use for the targets.

obj tlsConfig.ca.configMap

ConfigMap containing data to use for the targets. Mutually exclusive with secret.

fn tlsConfig.ca.configMap.withKey

withKey(key)

The key to select.

fn tlsConfig.ca.configMap.withName

withName(name)

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

fn tlsConfig.ca.configMap.withOptional

withOptional(is_optional)

Specify whether the ConfigMap or its key must be defined.

obj tlsConfig.ca.secret

Secret containing data to use for the targets. Mutually exclusive with configMap.

fn tlsConfig.ca.secret.withKey

withKey(key)

The key of the secret to select from. Must be a valid secret key.

fn tlsConfig.ca.secret.withName

withName(name)

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

fn tlsConfig.ca.secret.withOptional

withOptional(is_optional)

Specify whether the Secret or its key must be defined

obj tlsConfig.cert

Struct containing the client cert file for the targets.

obj tlsConfig.cert.configMap

ConfigMap containing data to use for the targets. Mutually exclusive with secret.

fn tlsConfig.cert.configMap.withKey

withKey(key)

The key to select.

fn tlsConfig.cert.configMap.withName

withName(name)

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

fn tlsConfig.cert.configMap.withOptional

withOptional(is_optional)

Specify whether the ConfigMap or its key must be defined.

obj tlsConfig.cert.secret

Secret containing data to use for the targets. Mutually exclusive with configMap.

fn tlsConfig.cert.secret.withKey

withKey(key)

The key of the secret to select from. Must be a valid secret key.

fn tlsConfig.cert.secret.withName

withName(name)

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

fn tlsConfig.cert.secret.withOptional

withOptional(is_optional)

Specify whether the Secret or its key must be defined

obj tlsConfig.keySecret

Secret containing the client key file for the targets.

fn tlsConfig.keySecret.withKey

withKey(key)

The key of the secret to select from. Must be a valid secret key.

fn tlsConfig.keySecret.withName

withName(name)

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

fn tlsConfig.keySecret.withOptional

withOptional(is_optional)

Specify whether the Secret or its key must be defined