Metrics Template

Due to the integration of the Prometheus Operator, the Metrics Template will no longer be used to provide metrics from default Kubernetes workloads. Instead, we recommend using Service Monitors and Pod Monitors.

For more information on setting up metrics for Kubernetes workloads, see Verrazzano metrics.

MetricsTemplate

Field Type Description Required
apiVersion string app.verrazzano.io/v1alpha1 Yes
kind string MetricsTemplate Yes
metadata ObjectMeta Refer to the Kubernetes API documentation for fields of metadata. No
spec MetricsTemplateSpec The desired state of a metrics trait. Yes

MetricsTemplateSpec

Field Type Description Required
workloadSelector WorkloadSelector Selector for target workloads. No
prometheusConfig PrometheusConfig Prometheus configuration details. No

WorkloadSelector

Field Type Description Required
namespaceSelector LabelSelector Scopes the template to a namespace. No
objectSelector LabelSelector Scopes the template to a specific workload object. No
apiGroups []string Scopes the template to given API Groups. No
apiVersions []string Scopes the template to given API Versions. No
resources []string Scopes the template to given API Resources. No

PrometheusConfig

Field Type Description Required
targetConfigMap TargetConfigMap Identity of the ConfigMap to be updated with the scrape configuration specified in scrapeConfigTemplate. Yes
scrapeConfigTemplate string Scrape configuration template to be added to the Prometheus configuration. Yes

TargetConfigMap

Field Type Description Required
namespace string Namespace of the ConfigMap to be updated with the scrape target configuration. Yes
name string Name of the ConfigMap to be updated with the scrape target configuration. Yes