Reference: manifest files Stay organized with collections Save and categorize content based on your preferences.
This document shows the contents of the manifests used in theManaged Service for Prometheus documentation.
setup.yaml
# Copyright 2022 Google LLC## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## https://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.# NOTE: This file is autogenerated.apiVersion:apiextensions.k8s.io/v1kind:CustomResourceDefinitionmetadata:annotations:controller-gen.kubebuilder.io/version:v0.17.1-0.20250103184936-50893dee96daname:clusternodemonitorings.monitoring.googleapis.comspec:group:monitoring.googleapis.comnames:kind:ClusterNodeMonitoringlistKind:ClusterNodeMonitoringListplural:clusternodemonitoringssingular:clusternodemonitoringscope:Clusterversions:-name:v1schema:openAPIV3Schema:description:ClusterNodeMonitoring defines monitoring for a set of nodes.properties:apiVersion:description:|-APIVersion defines the versioned schema of this representation of an object.Servers should convert recognized schemas to the latest internal value, andmay reject unrecognized values.More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resourcestype:stringkind:description:|-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-kindstype:stringmetadata:type:objectspec:description:|-Specification of desired node selection for target discovery byPrometheus.properties:endpoints:description:The endpoints to scrape on the selected nodes.items:description:|-ScrapeNodeEndpoint specifies a Prometheus metrics endpoint on a node to scrape.It contains all the fields used in the ScrapeEndpoint except for port and HTTPClientConfig.properties:interval:default:1mdescription:Interval at which to scrape metrics. Must be a valid Prometheus duration.format:durationtype:stringmetricRelabeling:description:|-Relabeling rules for metrics scraped from this endpoint. Relabeling rules thatoverride protected target labels (project_id, location, cluster, namespace, job,instance, or __address__) are not permitted. The labelmap action is not permittedin general.items:description:RelabelingRule defines a single Prometheus relabeling rule.properties:action:description:Action to perform based on regex matching. Defaults to 'replace'.enum:-replace-lowercase-uppercase-keep-drop-keepequal-dropequal-hashmod-labeldrop-labelkeeptype:stringmodulus:description:Modulus to take of the hash of the source label values.format:int64type:integerregex:description:Regular expression against which the extracted value is matched. Defaults to '(.*)'.maxLength:10000type:stringreplacement:description:|-Replacement value against which a regex replace is performed if theregular expression matches. Regex capture groups are available. Defaults to '$1'.type:stringseparator:description:Separator placed between concatenated source label values. Defaults to ';'.type:stringsourceLabels:description:|-The source labels select values from existing labels. Their content is concatenatedusing the configured separator and matched against the configured regular expressionfor the replace, keep, and drop actions.items:pattern:^[a-zA-Z_][a-zA-Z0-9_]*$type:stringmaxItems:100type:arraytargetLabel:description:|-Label to which the resulting value is written in a replace action.It is mandatory for replace actions. Regex capture groups are available.pattern:^[a-zA-Z_][a-zA-Z0-9_]*$type:stringx-kubernetes-validations:-messageExpression:'''cannotrelabelontoprotectedlabel"%s"''.format([self])'rule:self != 'project_id' && self != 'location' && self != 'cluster' && self != 'namespace' && self != 'job' && self != 'instance' && self != 'top_level_controller' && self != 'top_level_controller_type' && self != '__address__'type:objectx-kubernetes-validations:-rule:'!has(self.action)||self.action!=''labeldrop''||has(self.regex)'maxItems:250type:arrayparams:additionalProperties:items:type:stringtype:arraydescription:HTTP GET params to use when scraping.type:objectpath:description:HTTP path to scrape metrics from. Defaults to "/metrics".type:stringscheme:description:Protocol scheme to use to scrape.enum:-http-httpstype:stringtimeout:description:|-Timeout for metrics scrapes. Must be a valid Prometheus duration.Must not be larger then the scrape interval.format:durationtype:stringtls:description:TLS configures the scrape request's TLS settings.properties:insecureSkipVerify:description:InsecureSkipVerify disables target certificate validation.type:booleantype:objectrequired:-intervaltype:objectx-kubernetes-validations:-messageExpression:'''scrapetimeout(%s)mustnotbegreaterthanscrapeinterval(%s)''.format([self.timeout,self.interval])'rule:'!has(self.timeout)||self.timeout<=self.interval'maxItems:10minItems:1type:arraylimits:description:Limits to apply at scrape time.properties:labelNameLength:description:|-Maximum label name length.Uses Prometheus default if left unspecified.format:int64type:integerlabelValueLength:description:|-Maximum label value length.Uses Prometheus default if left unspecified.format:int64type:integerlabels:description:|-Maximum number of labels accepted for a single sample.Uses Prometheus default if left unspecified.format:int64type:integersamples:description:|-Maximum number of samples accepted within a single scrape.Uses Prometheus default if left unspecified.format:int64type:integertype:objectselector:description:|-Label selector that specifies which nodes are selected for this monitoringconfiguration. If left empty all nodes are selected.properties:matchExpressions:description:matchExpressions is a list of label selector requirements. The requirements are ANDed.items:description:|-A label selector requirement is a selector that contains values, a key, and an operator thatrelates the key and values.properties:key:description:key is the label key that the selector applies to.type:stringoperator:description:|-operator represents a key's relationship to a set of values.Valid operators are In, NotIn, Exists and DoesNotExist.type:stringvalues:description:|-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 strategicmerge patch.items:type:stringtype:arrayx-kubernetes-list-type:atomicrequired:-key-operatortype:objecttype:arrayx-kubernetes-list-type:atomicmatchLabels:additionalProperties:type:stringdescription:|-matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabelsmap is equivalent to an element of matchExpressions, whose key field is "key", theoperator is "In", and the values array contains only "value". The requirements are ANDed.type:objecttype:objectx-kubernetes-map-type:atomicrequired:-endpointstype:objectstatus:description:Most recently observed status of the resource.properties:conditions:description:Represents the latest available observations of a podmonitor's current state.items:description:MonitoringCondition describes the condition of a PodMonitoring.properties:lastTransitionTime:description:Last time the condition transitioned from one status to another.format:date-timetype:stringlastUpdateTime:description:The last time this condition was updated.format:date-timetype:stringmessage:description:A human-readable message indicating details about the transition.type:stringreason:description:The reason for the condition's last transition.type:stringstatus:description:Status of the condition, one of True, False, Unknown.type:stringtype:description:MonitoringConditionType is the type of MonitoringCondition.type:stringrequired:-status-typetype:objecttype:arrayobservedGeneration:description:The generation observed by the controller.format:int64type:integertype:objectrequired:-spectype:objectserved:truestorage:truesubresources:status:{}---apiVersion:apiextensions.k8s.io/v1kind:CustomResourceDefinitionmetadata:annotations:controller-gen.kubebuilder.io/version:v0.17.1-0.20250103184936-50893dee96daname:clusterpodmonitorings.monitoring.googleapis.comspec:group:monitoring.googleapis.comnames:kind:ClusterPodMonitoringlistKind:ClusterPodMonitoringListplural:clusterpodmonitoringssingular:clusterpodmonitoringscope:Clusterversions:-name:v1schema:openAPIV3Schema:description:|-ClusterPodMonitoring defines monitoring for a set of pods, scoped to allpods within the cluster.properties:apiVersion:description:|-APIVersion defines the versioned schema of this representation of an object.Servers should convert recognized schemas to the latest internal value, andmay reject unrecognized values.More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resourcestype:stringkind:description:|-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-kindstype:stringmetadata:type:objectspec:description:|-Specification of desired Pod selection for target discovery byPrometheus.properties:endpoints:description:The endpoints to scrape on the selected pods.items:description:ScrapeEndpoint specifies a Prometheus metrics endpoint to scrape.properties:authorization:description:Authorization is the HTTP authorization credentials for the targets.properties:credentials:description:Credentials uses the secret as the credentials (token) for the authentication header.properties:secret:description:Secret represents reference to a given key from certain Secret in a given namespace.properties:key:description:Key of the secret to select from. Must be a valid secret key.type:stringname:description:Name of the secret to select from.type:stringnamespace:description:|-Namespace of the secret to select from.If empty the parent resource namespace will be chosen.type:stringrequired:-key-nametype:objecttype:objecttype:description:|-Type is the authentication type. Defaults to Bearer.Basic will cause an error, as the BasicAuth object should be used instead.type:stringx-kubernetes-validations:-message:authorization type cannot be set to "basic", use "basic_auth" insteadrule:self != 'Basic'type:objectbasicAuth:description:BasicAuth is the HTTP basic authentication credentials for the targets.properties:password:description:Password uses the secret as the BasicAuth password.properties:secret:description:Secret represents reference to a given key from certain Secret in a given namespace.properties:key:description:Key of the secret to select from. Must be a valid secret key.type:stringname:description:Name of the secret to select from.type:stringnamespace:description:|-Namespace of the secret to select from.If empty the parent resource namespace will be chosen.type:stringrequired:-key-nametype:objecttype:objectusername:description:Username is the BasicAuth username.type:stringtype:objectinterval:description:Interval at which to scrape metrics. Must be a valid Prometheus duration.format:durationtype:stringmetricRelabeling:description:|-Relabeling rules for metrics scraped from this endpoint. Relabeling rules thatoverride protected target labels (project_id, location, cluster, namespace, job,instance, top_level_controller, top_level_controller_type, or __address__) arenot permitted. The labelmap action is not permitted in general.items:description:RelabelingRule defines a single Prometheus relabeling rule.properties:action:description:Action to perform based on regex matching. Defaults to 'replace'.enum:-replace-lowercase-uppercase-keep-drop-keepequal-dropequal-hashmod-labeldrop-labelkeeptype:stringmodulus:description:Modulus to take of the hash of the source label values.format:int64type:integerregex:description:Regular expression against which the extracted value is matched. Defaults to '(.*)'.maxLength:10000type:stringreplacement:description:|-Replacement value against which a regex replace is performed if theregular expression matches. Regex capture groups are available. Defaults to '$1'.type:stringseparator:description:Separator placed between concatenated source label values. Defaults to ';'.type:stringsourceLabels:description:|-The source labels select values from existing labels. Their content is concatenatedusing the configured separator and matched against the configured regular expressionfor the replace, keep, and drop actions.items:pattern:^[a-zA-Z_][a-zA-Z0-9_]*$type:stringmaxItems:100type:arraytargetLabel:description:|-Label to which the resulting value is written in a replace action.It is mandatory for replace actions. Regex capture groups are available.pattern:^[a-zA-Z_][a-zA-Z0-9_]*$type:stringx-kubernetes-validations:-messageExpression:'''cannotrelabelontoprotectedlabel"%s"''.format([self])'rule:self != 'project_id' && self != 'location' && self != 'cluster' && self != 'namespace' && self != 'job' && self != 'instance' && self != 'top_level_controller' && self != 'top_level_controller_type' && self != '__address__'type:objectx-kubernetes-validations:-rule:'!has(self.action)||self.action!=''labeldrop''||has(self.regex)'maxItems:250type:arrayoauth2:description:OAuth2 is the OAuth2 client credentials used to fetch a token for the targets.properties:clientID:description:ClientID is the public identifier for the client.type:stringclientSecret:description:ClientSecret uses the secret as the client secret token.properties:secret:description:Secret represents reference to a given key from certain Secret in a given namespace.properties:key:description:Key of the secret to select from. Must be a valid secret key.type:stringname:description:Name of the secret to select from.type:stringnamespace:description:|-Namespace of the secret to select from.If empty the parent resource namespace will be chosen.type:stringrequired:-key-nametype:objecttype:objectendpointParams:additionalProperties:type:stringdescription:EndpointParams are additional parameters to append to the token URL.type:objectproxyUrl:description:|-ProxyURL is the HTTP proxy server to use to connect to the targets.Encoded passwords are not supported.maxLength:2000type:stringx-kubernetes-validations:-rule:isURL(self) && !self.matches('@')scopes:description:Scopes represents the scopes for the token request.items:type:stringtype:arraytlsConfig:description:TLS configures the token request's TLS settings.properties:ca:description:|-SecretSelector references a secret from a secret provider e.g. Kubernetes Secret. Only oneprovider can be used at a time.properties:secret:description:Secret represents reference to a given key from certain Secret in a given namespace.properties:key:description:Key of the secret to select from. Must be a valid secret key.type:stringname:description:Name of the secret to select from.type:stringnamespace:description:|-Namespace of the secret to select from.If empty the parent resource namespace will be chosen.type:stringrequired:-key-nametype:objecttype:objectcert:description:Cert uses the secret as the certificate for client authentication to the server.properties:secret:description:Secret represents reference to a given key from certain Secret in a given namespace.properties:key:description:Key of the secret to select from. Must be a valid secret key.type:stringname:description:Name of the secret to select from.type:stringnamespace:description:|-Namespace of the secret to select from.If empty the parent resource namespace will be chosen.type:stringrequired:-key-nametype:objecttype:objectinsecureSkipVerify:description:InsecureSkipVerify disables target certificate validation.type:booleankey:description:Key uses the secret as the private key for client authentication to the server.properties:secret:description:Secret represents reference to a given key from certain Secret in a given namespace.properties:key:description:Key of the secret to select from. Must be a valid secret key.type:stringname:description:Name of the secret to select from.type:stringnamespace:description:|-Namespace of the secret to select from.If empty the parent resource namespace will be chosen.type:stringrequired:-key-nametype:objecttype:objectmaxVersion:description:|-MaxVersion is the maximum TLS version. Accepted values: TLS10 (TLS 1.0), TLS11 (TLS 1.1),TLS12 (TLS 1.2), TLS13 (TLS 1.3).If unset, Prometheus will use Go default minimum version, which is TLS 1.2.See MinVersion in https://pkg.go.dev/crypto/tls#Config.enum:-TLS10-TLS11-TLS12-TLS13type:stringminVersion:description:|-MinVersion is the minimum TLS version. Accepted values: TLS10 (TLS 1.0), TLS11 (TLS 1.1),TLS12 (TLS 1.2), TLS13 (TLS 1.3).If unset, Prometheus will use Go default minimum version, which is TLS 1.2.See MinVersion in https://pkg.go.dev/crypto/tls#Config.enum:-TLS10-TLS11-TLS12-TLS13type:stringserverName:description:ServerName is used to verify the hostname for the targets.type:stringtype:objectx-kubernetes-validations:-message:client cert and client key must be provided together, when either is providedrule:has(self.cert) == has(self.key)tokenURL:description:TokenURL is the URL to fetch the token from.type:stringtype:objectparams:additionalProperties:items:type:stringtype:arraydescription:HTTP GET params to use when scraping.type:objectpath:description:HTTP path to scrape metrics from. Defaults to "/metrics".type:stringport:anyOf:-type:integer-type:stringdescription:|-Name or number of the port to scrape.The container metadata label is only populated if the port is referenced by namebecause port numbers are not unique across containers.maxLength:253minLength:1x-kubernetes-int-or-string:truex-kubernetes-validations:-message:Port is requiredrule:self != 0proxyUrl:description:|-ProxyURL is the HTTP proxy server to use to connect to the targets.Encoded passwords are not supported.maxLength:2000type:stringx-kubernetes-validations:-rule:isURL(self) && !self.matches('@')scheme:description:Protocol scheme to use to scrape.enum:-http-httpstype:stringtimeout:description:|-Timeout for metrics scrapes. Must be a valid Prometheus duration.Must not be larger than the scrape interval.format:durationtype:stringtls:description:TLS configures the scrape request's TLS settings.properties:ca:description:|-SecretSelector references a secret from a secret provider e.g. Kubernetes Secret. Only oneprovider can be used at a time.properties:secret:description:Secret represents reference to a given key from certain Secret in a given namespace.properties:key:description:Key of the secret to select from. Must be a valid secret key.type:stringname:description:Name of the secret to select from.type:stringnamespace:description:|-Namespace of the secret to select from.If empty the parent resource namespace will be chosen.type:stringrequired:-key-nametype:objecttype:objectcert:description:Cert uses the secret as the certificate for client authentication to the server.properties:secret:description:Secret represents reference to a given key from certain Secret in a given namespace.properties:key:description:Key of the secret to select from. Must be a valid secret key.type:stringname:description:Name of the secret to select from.type:stringnamespace:description:|-Namespace of the secret to select from.If empty the parent resource namespace will be chosen.type:stringrequired:-key-nametype:objecttype:objectinsecureSkipVerify:description:InsecureSkipVerify disables target certificate validation.type:booleankey:description:Key uses the secret as the private key for client authentication to the server.properties:secret:description:Secret represents reference to a given key from certain Secret in a given namespace.properties:key:description:Key of the secret to select from. Must be a valid secret key.type:stringname:description:Name of the secret to select from.type:stringnamespace:description:|-Namespace of the secret to select from.If empty the parent resource namespace will be chosen.type:stringrequired:-key-nametype:objecttype:objectmaxVersion:description:|-MaxVersion is the maximum TLS version. Accepted values: TLS10 (TLS 1.0), TLS11 (TLS 1.1),TLS12 (TLS 1.2), TLS13 (TLS 1.3).If unset, Prometheus will use Go default minimum version, which is TLS 1.2.See MinVersion in https://pkg.go.dev/crypto/tls#Config.enum:-TLS10-TLS11-TLS12-TLS13type:stringminVersion:description:|-MinVersion is the minimum TLS version. Accepted values: TLS10 (TLS 1.0), TLS11 (TLS 1.1),TLS12 (TLS 1.2), TLS13 (TLS 1.3).If unset, Prometheus will use Go default minimum version, which is TLS 1.2.See MinVersion in https://pkg.go.dev/crypto/tls#Config.enum:-TLS10-TLS11-TLS12-TLS13type:stringserverName:description:ServerName is used to verify the hostname for the targets.type:stringtype:objectx-kubernetes-validations:-message:client cert and client key must be provided together, when either is providedrule:has(self.cert) == has(self.key)required:-interval-porttype:objectx-kubernetes-validations:-messageExpression:'''scrapetimeout(%s)mustnotbegreaterthanscrapeinterval(%s)''.format([self.timeout,self.interval])'rule:'!has(self.timeout)||self.timeout<=self.interval'-rule:'((has(self.authorization)?1:0)+(has(self.basicAuth)?1:0)+(has(self.oauth2)?1:0))<=1'maxItems:10minItems:1type:arrayfilterRunning:description:|-FilterRunning will drop any pods that are in the "Failed" or "Succeeded"pod lifecycle.See: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phaseSpecifically, this prevents scraping Succeeded pods from K8s jobs, whichcould contribute to noisy logs or irrelevant metrics.Additionally, it can mitigate issues with reusing stale targetlabels in cases where Pod IPs are reused (e.g. spot containers).See: https://github.com/GoogleCloudPlatform/prometheus-engine/issues/145type:booleanlimits:description:Limits to apply at scrape time.properties:labelNameLength:description:|-Maximum label name length.Uses Prometheus default if left unspecified.format:int64type:integerlabelValueLength:description:|-Maximum label value length.Uses Prometheus default if left unspecified.format:int64type:integerlabels:description:|-Maximum number of labels accepted for a single sample.Uses Prometheus default if left unspecified.format:int64type:integersamples:description:|-Maximum number of samples accepted within a single scrape.Uses Prometheus default if left unspecified.format:int64type:integertype:objectselector:description:|-Label selector that specifies which pods are selected for this monitoringconfiguration.properties:matchExpressions:description:matchExpressions is a list of label selector requirements. The requirements are ANDed.items:description:|-A label selector requirement is a selector that contains values, a key, and an operator thatrelates the key and values.properties:key:description:key is the label key that the selector applies to.type:stringoperator:description:|-operator represents a key's relationship to a set of values.Valid operators are In, NotIn, Exists and DoesNotExist.type:stringvalues:description:|-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 strategicmerge patch.items:type:stringtype:arrayx-kubernetes-list-type:atomicrequired:-key-operatortype:objecttype:arrayx-kubernetes-list-type:atomicmatchLabels:additionalProperties:type:stringdescription:|-matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabelsmap is equivalent to an element of matchExpressions, whose key field is "key", theoperator is "In", and the values array contains only "value". The requirements are ANDed.type:objecttype:objectx-kubernetes-map-type:atomictargetLabels:description:|-Labels to add to the Prometheus target for discovered endpoints.The `instance` label is always set to `<pod_name>:<port>` or `<node_name>:<port>`if the scraped pod is controlled by a DaemonSet.properties:fromPod:description:|-Labels to transfer from the Kubernetes Pod to Prometheus target labels.Mappings are applied in order.items:description:|-LabelMapping specifies how to transfer a label from a Kubernetes resourceonto a Prometheus target.properties:from:description:Kubernetes resource label to remap.type:stringto:description:|-Remapped Prometheus target label.Defaults to the same name as `From`.pattern:^[a-zA-Z_][a-zA-Z0-9_]*$type:stringx-kubernetes-validations:-messageExpression:'''cannotrelabelontoprotectedlabel"%s"''.format([self])'rule:self != 'project_id' && self != 'location' && self != 'cluster' && self != 'namespace' && self != 'job' && self != 'instance' && self != 'top_level_controller' && self != 'top_level_controller_type' && self != '__address__'required:-fromtype:objectmaxItems:100type:arraymetadata:default:-container-namespace-pod-top_level_controller_name-top_level_controller_typedescription:|-Pod metadata labels that are set on all scraped targets.Permitted keys are `container`, `namespace`, `node`, `pod`,`top_level_controller_name` and `top_level_controller_type`. The `container`label is only populated if the scrape port is referenced by name.Defaults to [container, namespace, pod, top_level_controller_name, top_level_controller_type].If set to null, it will be interpreted as [namespace]. This is for backwards-compatibilityonly.items:enum:-container-namespace-node-pod-top_level_controller_name-top_level_controller_typetype:stringtype:arrayx-kubernetes-list-type:settype:objectrequired:-endpoints-selectortype:objectstatus:description:Most recently observed status of the resource.properties:conditions:description:Represents the latest available observations of a podmonitor's current state.items:description:MonitoringCondition describes the condition of a PodMonitoring.properties:lastTransitionTime:description:Last time the condition transitioned from one status to another.format:date-timetype:stringlastUpdateTime:description:The last time this condition was updated.format:date-timetype:stringmessage:description:A human-readable message indicating details about the transition.type:stringreason:description:The reason for the condition's last transition.type:stringstatus:description:Status of the condition, one of True, False, Unknown.type:stringtype:description:MonitoringConditionType is the type of MonitoringCondition.type:stringrequired:-status-typetype:objecttype:arrayendpointStatuses:description:Represents the latest available observations of target state for each ScrapeEndpoint.items:properties:activeTargets:description:Total number of active targets.format:int64type:integercollectorsFraction:description:|-Fraction of collectors included in status, bounded [0,1].Ideally, this should always be 1. Anything less canbe considered a problem and should be investigated.type:stringlastUpdateTime:description:Last time this status was updated.format:date-timetype:stringname:description:The name of the ScrapeEndpoint.type:stringsampleGroups:description:A fixed sample of targets grouped by error type.items:properties:count:description:Total count of similar errors.format:int32type:integersampleTargets:description:Targets emitting the error message.items:properties:health:description:Health status.type:stringlabels:additionalProperties:description:A LabelValue is an associated value for a LabelName.type:stringdescription:The label set, keys and values, of the target.type:objectlastError:description:Error message.type:stringlastScrapeDurationSeconds:description:Scrape duration in seconds.type:stringtype:objecttype:arraytype:objecttype:arrayunhealthyTargets:description:Total number of active, unhealthy targets.format:int64type:integerrequired:-nametype:objecttype:arrayobservedGeneration:description:The generation observed by the controller.format:int64type:integertype:objectrequired:-spectype:objectserved:truestorage:truesubresources:status:{}-deprecated:truename:v1alpha1schema:openAPIV3Schema:description:ClusterPodMonitoring defines monitoring for a set of pods.properties:apiVersion:description:|-APIVersion defines the versioned schema of this representation of an object.Servers should convert recognized schemas to the latest internal value, andmay reject unrecognized values.More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resourcestype:stringkind:description:|-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-kindstype:stringmetadata:type:objectspec:description:|-Specification of desired Pod selection for target discovery byPrometheus.properties:endpoints:description:The endpoints to scrape on the selected pods.items:description:ScrapeEndpoint specifies a Prometheus metrics endpoint to scrape.properties:interval:description:Interval at which to scrape metrics. Must be a valid Prometheus duration.type:stringmetricRelabeling:description:|-Relabeling rules for metrics scraped from this endpoint. Relabeling rules thatoverride protected target labels (project_id, location, cluster, namespace, job,instance, or __address__) are not permitted. The labelmap action is not permittedin general.items:description:RelabelingRule defines a single Prometheus relabeling rule.properties:action:description:Action to perform based on regex matching. Defaults to 'replace'.type:stringmodulus:description:Modulus to take of the hash of the source label values.format:int64type:integerregex:description:Regular expression against which the extracted value is matched. Defaults to '(.*)'.type:stringreplacement:description:|-Replacement value against which a regex replace is performed if theregular expression matches. Regex capture groups are available. Defaults to '$1'.type:stringseparator:description:Separator placed between concatenated source label values. Defaults to ';'.type:stringsourceLabels:description:|-The source labels select values from existing labels. Their content is concatenatedusing the configured separator and matched against the configured regular expressionfor the replace, keep, and drop actions.items:type:stringtype:arraytargetLabel:description:|-Label to which the resulting value is written in a replace action.It is mandatory for replace actions. Regex capture groups are available.type:stringtype:objecttype:arrayparams:additionalProperties:items:type:stringtype:arraydescription:HTTP GET params to use when scraping.type:objectpath:description:HTTP path to scrape metrics from. Defaults to "/metrics".type:stringport:anyOf:-type:integer-type:stringdescription:Name or number of the port to scrape.x-kubernetes-int-or-string:trueproxyUrl:description:Proxy URL to scrape through. Encoded passwords are not supported.type:stringscheme:description:Protocol scheme to use to scrape.type:stringtimeout:description:|-Timeout for metrics scrapes. Must be a valid Prometheus duration.Must not be larger then the scrape interval.type:stringrequired:-porttype:objecttype:arraylimits:description:Limits to apply at scrape time.properties:labelNameLength:description:|-Maximum label name length.Uses Prometheus default if left unspecified.format:int64type:integerlabelValueLength:description:|-Maximum label value length.Uses Prometheus default if left unspecified.format:int64type:integerlabels:description:|-Maximum number of labels accepted for a single sample.Uses Prometheus default if left unspecified.format:int64type:integersamples:description:|-Maximum number of samples accepted within a single scrape.Uses Prometheus default if left unspecified.format:int64type:integertype:objectselector:description:|-Label selector that specifies which pods are selected for this monitoringconfiguration.properties:matchExpressions:description:matchExpressions is a list of label selector requirements. The requirements are ANDed.items:description:|-A label selector requirement is a selector that contains values, a key, and an operator thatrelates the key and values.properties:key:description:key is the label key that the selector applies to.type:stringoperator:description:|-operator represents a key's relationship to a set of values.Valid operators are In, NotIn, Exists and DoesNotExist.type:stringvalues:description:|-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 strategicmerge patch.items:type:stringtype:arrayx-kubernetes-list-type:atomicrequired:-key-operatortype:objecttype:arrayx-kubernetes-list-type:atomicmatchLabels:additionalProperties:type:stringdescription:|-matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabelsmap is equivalent to an element of matchExpressions, whose key field is "key", theoperator is "In", and the values array contains only "value". The requirements are ANDed.type:objecttype:objectx-kubernetes-map-type:atomictargetLabels:description:Labels to add to the Prometheus target for discovered endpointsproperties:fromPod:description:|-Labels to transfer from the Kubernetes Pod to Prometheus target labels.Mappings are applied in order.items:description:|-LabelMapping specifies how to transfer a label from a Kubernetes resourceonto a Prometheus target.properties:from:description:Kubenetes resource label to remap.type:stringto:description:|-Remapped Prometheus target label.Defaults to the same name as `From`.type:stringrequired:-fromtype:objecttype:arraymetadata:description:|-Pod metadata labels that are set on all scraped targets.Permitted keys are `pod`, `container`, and `node` for PodMonitoring and`pod`, `container`, `node`, and `namespace` for ClusterPodMonitoring.Defaults to [pod, container] for PodMonitoring and [namespace, pod, container]for ClusterPodMonitoring.If set to null, it will be interpreted as the empty list for PodMonitoringand to [namespace] for ClusterPodMonitoring. This is for backwards-compatibilityonly.items:type:stringtype:arraytype:objectrequired:-endpoints-selectortype:objectstatus:description:Most recently observed status of the resource.properties:conditions:description:Represents the latest available observations of a podmonitor's current state.items:description:MonitoringCondition describes a condition of a PodMonitoring.properties:lastTransitionTime:description:Last time the condition transitioned from one status to another.format:date-timetype:stringlastUpdateTime:description:The last time this condition was updated.format:date-timetype:stringmessage:description:A human-readable message indicating details about the transition.type:stringreason:description:The reason for the condition's last transition.type:stringstatus:description:Status of the condition, one of True, False, Unknown.type:stringtype:description:MonitoringConditionType is the type of MonitoringCondition.type:stringrequired:-status-typetype:objecttype:arrayobservedGeneration:description:The generation observed by the controller.format:int64type:integertype:objectrequired:-spectype:objectserved:truestorage:falsesubresources:status:{}---apiVersion:apiextensions.k8s.io/v1kind:CustomResourceDefinitionmetadata:annotations:controller-gen.kubebuilder.io/version:v0.17.1-0.20250103184936-50893dee96daname:clusterrules.monitoring.googleapis.comspec:group:monitoring.googleapis.comnames:kind:ClusterRuleslistKind:ClusterRulesListplural:clusterrulessingular:clusterrulesscope:Clusterversions:-name:v1schema:openAPIV3Schema:description:|-ClusterRules defines Prometheus alerting and recording rules that are scopedto the current cluster. Only metric data from the current cluster is processedand all rule results have their project_id and cluster label preservedfor query processing.If the location label is not preserved by the rule, it defaults to the cluster's location.properties:apiVersion:description:|-APIVersion defines the versioned schema of this representation of an object.Servers should convert recognized schemas to the latest internal value, andmay reject unrecognized values.More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resourcestype:stringkind:description:|-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-kindstype:stringmetadata:type:objectspec:description:Specification of rules to record and alert on.properties:groups:description:A list of Prometheus rule groups.items:description:|-RuleGroup declares rules in the Prometheus format:https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/properties:interval:default:1mdescription:The interval at which to evaluate the rules. Must be a valid Prometheus duration.format:durationtype:stringname:description:The name of the rule group.type:stringrules:description:A list of rules that are executed sequentially as part of this group.items:description:|-Rule is a single rule in the Prometheus format:https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/properties:alert:description:|-Name of the alert to evaluate the expression as.Only one of `record` and `alert` must be set.type:stringannotations:additionalProperties:type:stringdescription:|-A set of annotations to attach to alerts produced by the query expression.Only valid if `alert` is set.type:objectexpr:description:The PromQL expression to evaluate.type:stringfor:description:|-The duration to wait before a firing alert produced by this rule is sent to Alertmanager.Only valid if `alert` is set.format:durationtype:stringlabels:additionalProperties:type:stringdescription:A set of labels to attach to the result of the query expression.type:objectrecord:description:|-Record the result of the expression to this metric name.Only one of `record` and `alert` must be set.pattern:^[a-zA-Z_:][a-zA-Z0-9_:]*$type:stringrequired:-exprtype:objectx-kubernetes-validations:-message:Must set exactly one of Record or Alertrule:'(has(self.record)?1:0)+(has(self.alert)?1:0)==1'-message:Annotations are only allowed for alerting rulesrule:'!has(self.annotations)||has(self.alert)'minItems:1type:arrayrequired:-name-rulestype:objecttype:arrayrequired:-groupstype:objectstatus:description:Most recently observed status of the resource.properties:conditions:description:Represents the latest available observations of a podmonitor's current state.items:description:MonitoringCondition describes the condition of a PodMonitoring.properties:lastTransitionTime:description:Last time the condition transitioned from one status to another.format:date-timetype:stringlastUpdateTime:description:The last time this condition was updated.format:date-timetype:stringmessage:description:A human-readable message indicating details about the transition.type:stringreason:description:The reason for the condition's last transition.type:stringstatus:description:Status of the condition, one of True, False, Unknown.type:stringtype:description:MonitoringConditionType is the type of MonitoringCondition.type:stringrequired:-status-typetype:objecttype:arrayobservedGeneration:description:The generation observed by the controller.format:int64type:integertype:objectrequired:-spectype:objectserved:truestorage:truesubresources:status:{}-deprecated:truename:v1alpha1schema:openAPIV3Schema:description:|-ClusterRules defines Prometheus alerting and recording rules that are scopedto the current cluster. Only metric data from the current cluster is processedand all rule results have their project_id and cluster label preservedfor query processing.If the location label is not preserved by the rule, it defaults to the cluster's location.properties:apiVersion:description:|-APIVersion defines the versioned schema of this representation of an object.Servers should convert recognized schemas to the latest internal value, andmay reject unrecognized values.More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resourcestype:stringkind:description:|-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-kindstype:stringmetadata:type:objectspec:description:Specification of rules to record and alert on.properties:groups:description:A list of Prometheus rule groups.items:description:|-RuleGroup declares rules in the Prometheus format:https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/properties:interval:description:The interval at which to evaluate the rules. Must be a valid Prometheus duration.type:stringname:description:The name of the rule group.type:stringrules:description:A list of rules that are executed sequentially as part of this group.items:description:|-Rule is a single rule in the Prometheus format:https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/properties:alert:description:|-Name of the alert to evaluate the expression as.Only one of `record` and `alert` must be set.type:stringannotations:additionalProperties:type:stringdescription:|-A set of annotations to attach to alerts produced by the query expression.Only valid if `alert` is set.type:objectexpr:description:The PromQL expression to evaluate.type:stringfor:description:|-The duration to wait before a firing alert produced by this rule is sent to Alertmanager.Only valid if `alert` is set.type:stringlabels:additionalProperties:type:stringdescription:A set of labels to attach to the result of the query expression.type:objectrecord:description:|-Record the result of the expression to this metric name.Only one of `record` and `alert` must be set.type:stringrequired:-exprtype:objecttype:arrayrequired:-interval-name-rulestype:objecttype:arrayrequired:-groupstype:objectstatus:description:Most recently observed status of the resource.type:objectrequired:-spectype:objectserved:truestorage:falsesubresources:status:{}---apiVersion:apiextensions.k8s.io/v1kind:CustomResourceDefinitionmetadata:annotations:controller-gen.kubebuilder.io/version:v0.17.1-0.20250103184936-50893dee96daname:globalrules.monitoring.googleapis.comspec:group:monitoring.googleapis.comnames:kind:GlobalRuleslistKind:GlobalRulesListplural:globalrulessingular:globalrulesscope:Clusterversions:-name:v1schema:openAPIV3Schema:description:|-GlobalRules defines Prometheus alerting and recording rules that are scopedto all data in the queried project.If the project_id or location labels are not preserved by the rule, they default tothe values of the cluster.properties:apiVersion:description:|-APIVersion defines the versioned schema of this representation of an object.Servers should convert recognized schemas to the latest internal value, andmay reject unrecognized values.More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resourcestype:stringkind:description:|-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-kindstype:stringmetadata:type:objectspec:description:Specification of rules to record and alert on.properties:groups:description:A list of Prometheus rule groups.items:description:|-RuleGroup declares rules in the Prometheus format:https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/properties:interval:default:1mdescription:The interval at which to evaluate the rules. Must be a valid Prometheus duration.format:durationtype:stringname:description:The name of the rule group.type:stringrules:description:A list of rules that are executed sequentially as part of this group.items:description:|-Rule is a single rule in the Prometheus format:https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/properties:alert:description:|-Name of the alert to evaluate the expression as.Only one of `record` and `alert` must be set.type:stringannotations:additionalProperties:type:stringdescription:|-A set of annotations to attach to alerts produced by the query expression.Only valid if `alert` is set.type:objectexpr:description:The PromQL expression to evaluate.type:stringfor:description:|-The duration to wait before a firing alert produced by this rule is sent to Alertmanager.Only valid if `alert` is set.format:durationtype:stringlabels:additionalProperties:type:stringdescription:A set of labels to attach to the result of the query expression.type:objectrecord:description:|-Record the result of the expression to this metric name.Only one of `record` and `alert` must be set.pattern:^[a-zA-Z_:][a-zA-Z0-9_:]*$type:stringrequired:-exprtype:objectx-kubernetes-validations:-message:Must set exactly one of Record or Alertrule:'(has(self.record)?1:0)+(has(self.alert)?1:0)==1'-message:Annotations are only allowed for alerting rulesrule:'!has(self.annotations)||has(self.alert)'minItems:1type:arrayrequired:-name-rulestype:objecttype:arrayrequired:-groupstype:objectstatus:description:Most recently observed status of the resource.properties:conditions:description:Represents the latest available observations of a podmonitor's current state.items:description:MonitoringCondition describes the condition of a PodMonitoring.properties:lastTransitionTime:description:Last time the condition transitioned from one status to another.format:date-timetype:stringlastUpdateTime:description:The last time this condition was updated.format:date-timetype:stringmessage:description:A human-readable message indicating details about the transition.type:stringreason:description:The reason for the condition's last transition.type:stringstatus:description:Status of the condition, one of True, False, Unknown.type:stringtype:description:MonitoringConditionType is the type of MonitoringCondition.type:stringrequired:-status-typetype:objecttype:arrayobservedGeneration:description:The generation observed by the controller.format:int64type:integertype:objectrequired:-spectype:objectserved:truestorage:truesubresources:status:{}-deprecated:truename:v1alpha1schema:openAPIV3Schema:description:|-GlobalRules defines Prometheus alerting and recording rules that are scopedto all data in the queried project.If the project_id or location labels are not preserved by the rule, they default tothe values of the cluster.properties:apiVersion:description:|-APIVersion defines the versioned schema of this representation of an object.Servers should convert recognized schemas to the latest internal value, andmay reject unrecognized values.More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resourcestype:stringkind:description:|-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-kindstype:stringmetadata:type:objectspec:description:Specification of rules to record and alert on.properties:groups:description:A list of Prometheus rule groups.items:description:|-RuleGroup declares rules in the Prometheus format:https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/properties:interval:description:The interval at which to evaluate the rules. Must be a valid Prometheus duration.type:stringname:description:The name of the rule group.type:stringrules:description:A list of rules that are executed sequentially as part of this group.items:description:|-Rule is a single rule in the Prometheus format:https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/properties:alert:description:|-Name of the alert to evaluate the expression as.Only one of `record` and `alert` must be set.type:stringannotations:additionalProperties:type:stringdescription:|-A set of annotations to attach to alerts produced by the query expression.Only valid if `alert` is set.type:objectexpr:description:The PromQL expression to evaluate.type:stringfor:description:|-The duration to wait before a firing alert produced by this rule is sent to Alertmanager.Only valid if `alert` is set.type:stringlabels:additionalProperties:type:stringdescription:A set of labels to attach to the result of the query expression.type:objectrecord:description:|-Record the result of the expression to this metric name.Only one of `record` and `alert` must be set.type:stringrequired:-exprtype:objecttype:arrayrequired:-interval-name-rulestype:objecttype:arrayrequired:-groupstype:objectstatus:description:Most recently observed status of the resource.type:objectrequired:-spectype:objectserved:truestorage:falsesubresources:status:{}---apiVersion:apiextensions.k8s.io/v1kind:CustomResourceDefinitionmetadata:annotations:controller-gen.kubebuilder.io/version:v0.17.1-0.20250103184936-50893dee96daname:operatorconfigs.monitoring.googleapis.comspec:group:monitoring.googleapis.comnames:kind:OperatorConfiglistKind:OperatorConfigListplural:operatorconfigssingular:operatorconfigscope:Namespacedversions:-name:v1schema:openAPIV3Schema:description:OperatorConfig defines configuration of the gmp-operator.properties:apiVersion:description:|-APIVersion defines the versioned schema of this representation of an object.Servers should convert recognized schemas to the latest internal value, andmay reject unrecognized values.More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resourcestype:stringcollection:description:|-Collection specifies how the operator configures collection, includingscraping and an integrated export to Google Cloud Monitoring.properties:compression:description:Compression enables compression of metrics collection dataenum:-none-gziptype:stringcredentials:description:|-A reference to GCP service account credentials with which Prometheus collectorsare run. It needs to have metric write permissions for all project IDs to whichdata is written.Within GKE, this can typically be left empty if the compute defaultservice account has the required permissions.properties:key:description:The key of the secret to select from. Must be a valid secret key.type:stringname:default:""description:|-Name of the referent.This field is effectively required, but due to backwards compatibility isallowed to be empty. Instances of this type with an empty value here arealmost certainly wrong.More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namestype:stringoptional:description:Specify whether the Secret or its key must be definedtype:booleanrequired:-keytype:objectx-kubernetes-map-type:atomicexternalLabels:additionalProperties:type:stringdescription:|-ExternalLabels specifies external labels that are attached to all scrapeddata before being written to Google Cloud Monitoring or any other additional exportsspecified in the OperatorConfig. The precedence behavior matches that of Prometheus.type:objectfilter:description:Filter limits which metric data is sent to Cloud Monitoring (it doesn't apply to additional exports).properties:matchOneOf:description:|-A list of Prometheus time series matchers. Every time series must match at least oneof the matchers to be exported. This field can be used equivalently to the match[]parameter of the Prometheus federation endpoint to selectively export data.Example: `["{job!='foobar'}", "{__name__!~'container_foo.*|container_bar.*'}"]`items:type:stringtype:arraytype:objectkubeletScraping:description:Configuration to scrape the metric endpoints of the Kubelets.properties:interval:description:The interval at which the metric endpoints are scraped.type:stringtlsInsecureSkipVerify:description:|-TLSInsecureSkipVerify disables verifying the target cert.This can be useful for clusters provisioned with kubeadm.type:booleanrequired:-intervaltype:objecttype:objectexports:description:|-Exports is an EXPERIMENTAL feature that specifies additional, optional endpoints to export to,on top of Google Cloud Monitoring collection.Note: To disable integrated export to Google Cloud Monitoring specify a non-matching filter in the "collection.filter" field.items:properties:url:description:The URL of the endpoint that supports Prometheus Remote Write to export samples to.type:stringrequired:-urltype:objecttype:arrayfeatures:description:Features holds configuration for optional managed-collection features.properties:config:description:Settings for the collector configuration propagation.properties:compression:description:|-Compression enables compression of the config data propagated by the operator to collectorsand the rule-evaluator. It is recommended to use the gzip option when using a large number ofClusterPodMonitoring, PodMonitoring, GlobalRules, ClusterRules, and/or Rules.enum:-none-gziptype:stringtype:objecttargetStatus:description:Configuration of target status reporting.properties:enabled:description:Enable target status reporting.type:booleantype:objecttype:objectkind:description:|-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-kindstype:stringmanagedAlertmanager:default:configSecret:key:alertmanager.yamlname:alertmanagerdescription:ManagedAlertmanager holds information for configuring the managed instance of Alertmanager.properties:configSecret:description:|-ConfigSecret refers to the name of a single-key Secret in the public namespace thatholds the managed Alertmanager config file.properties:key:description:The key of the secret to select from. Must be a valid secret key.type:stringname:default:""description:|-Name of the referent.This field is effectively required, but due to backwards compatibility isallowed to be empty. Instances of this type with an empty value here arealmost certainly wrong.More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namestype:stringoptional:description:Specify whether the Secret or its key must be definedtype:booleanrequired:-keytype:objectx-kubernetes-map-type:atomicexternalURL:description:|-ExternalURL is the URL under which Alertmanager is externally reachable (for example, ifAlertmanager is served via a reverse proxy). Used for generating relative and absolutelinks back to Alertmanager itself. If the URL has a path portion, it will be used toprefix all HTTP endpoints served by Alertmanager, otherwise relevant URL components willbe derived automatically.If no URL is provided, Alertmanager will point to the Google Cloud Metric Explorer page.type:stringtype:objectmetadata:type:objectrules:description:Rules specifies how the operator configures and deploys rule-evaluator.properties:alerting:description:Alerting contains how the rule-evaluator configures alerting.properties:alertmanagers:description:Alertmanagers contains endpoint configuration for designated Alertmanagers.items:description:|-AlertmanagerEndpoints defines a selection of a single Endpoints objectcontaining alertmanager IPs to fire alerts against.properties:apiVersion:description:|-Version of the Alertmanager API that rule-evaluator uses to send alerts. Itcan be "v1" or "v2".type:stringauthorization:description:Authorization section for this alertmanager endpointproperties:credentials:description:The secret's key that contains the credentials of the requestproperties:key:description:The key of the secret to select from. Must be a valid secret key.type:stringname:default:""description:|-Name of the referent.This field is effectively required, but due to backwards compatibility isallowed to be empty. Instances of this type with an empty value here arealmost certainly wrong.More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namestype:stringoptional:description:Specify whether the Secret or its key must be definedtype:booleanrequired:-keytype:objectx-kubernetes-map-type:atomictype:description:|-Set the authentication type. Defaults to Bearer, Basic will cause anerrortype:stringtype:objectname:description:Name of Endpoints object in Namespace.type:stringnamespace:description:Namespace of Endpoints object.type:stringpathPrefix:description:Prefix for the HTTP path alerts are pushed to.type:stringport:anyOf:-type:integer-type:stringdescription:Port the Alertmanager API is exposed on.x-kubernetes-int-or-string:truescheme:description:Scheme to use when firing alerts.type:stringtimeout:description:Timeout is a per-target Alertmanager timeout when pushing alerts.type:stringtls:description:TLS Config to use for alertmanager connection.properties:ca:description:Struct containing the CA cert to use for the targets.properties:configMap:description:ConfigMap containing data to use for the targets.properties:key:description:The key to select.type:stringname:default:""description:|-Name of the referent.This field is effectively required, but due to backwards compatibility isallowed to be empty. Instances of this type with an empty value here arealmost certainly wrong.More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namestype:stringoptional:description:Specify whether the ConfigMap or its key must be definedtype:booleanrequired:-keytype:objectx-kubernetes-map-type:atomicsecret:description:Secret containing data to use for the targets.properties:key:description:The key of the secret to select from. Must be a valid secret key.type:stringname:default:""description:|-Name of the referent.This field is effectively required, but due to backwards compatibility isallowed to be empty. Instances of this type with an empty value here arealmost certainly wrong.More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namestype:stringoptional:description:Specify whether the Secret or its key must be definedtype:booleanrequired:-keytype:objectx-kubernetes-map-type:atomictype:objectcert:description:Struct containing the client cert file for the targets.properties:configMap:description:ConfigMap containing data to use for the targets.properties:key:description:The key to select.type:stringname:default:""description:|-Name of the referent.This field is effectively required, but due to backwards compatibility isallowed to be empty. Instances of this type with an empty value here arealmost certainly wrong.More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namestype:stringoptional:description:Specify whether the ConfigMap or its key must be definedtype:booleanrequired:-keytype:objectx-kubernetes-map-type:atomicsecret:description:Secret containing data to use for the targets.properties:key:description:The key of the secret to select from. Must be a valid secret key.type:stringname:default:""description:|-Name of the referent.This field is effectively required, but due to backwards compatibility isallowed to be empty. Instances of this type with an empty value here arealmost certainly wrong.More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namestype:stringoptional:description:Specify whether the Secret or its key must be definedtype:booleanrequired:-keytype:objectx-kubernetes-map-type:atomictype:objectinsecureSkipVerify:description:Disable target certificate validation.type:booleankeySecret:description:Secret containing the client key file for the targets.properties:key:description:The key of the secret to select from. Must be a valid secret key.type:stringname:default:""description:|-Name of the referent.This field is effectively required, but due to backwards compatibility isallowed to be empty. Instances of this type with an empty value here arealmost certainly wrong.More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namestype:stringoptional:description:Specify whether the Secret or its key must be definedtype:booleanrequired:-keytype:objectx-kubernetes-map-type:atomicmaxVersion:description:|-Maximum TLS version. Accepted values: TLS10 (TLS 1.0), TLS11 (TLS 1.1), TLS12 (TLS 1.2), TLS13 (TLS 1.3).If unset, Prometheus will use Go default minimum version, which is TLS 1.2.See MinVersion in https://pkg.go.dev/crypto/tls#Config.type:stringminVersion:description:|-Minimum TLS version. Accepted values: TLS10 (TLS 1.0), TLS11 (TLS 1.1), TLS12 (TLS 1.2), TLS13 (TLS 1.3).If unset, Prometheus will use Go default minimum version, which is TLS 1.2.See MinVersion in https://pkg.go.dev/crypto/tls#Config.type:stringserverName:description:Used to verify the hostname for the targets.type:stringtype:objectrequired:-name-namespace-porttype:objecttype:arraytype:objectcredentials:description:|-A reference to GCP service account credentials with which the ruleevaluator container is run. It needs to have metric read permissionsagainst queryProjectId and metric write permissions against all projectsto which rule results are written.Within GKE, this can typically be left empty if the compute defaultservice account has the required permissions.properties:key:description:The key of the secret to select from. Must be a valid secret key.type:stringname:default:""description:|-Name of the referent.This field is effectively required, but due to backwards compatibility isallowed to be empty. Instances of this type with an empty value here arealmost certainly wrong.More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namestype:stringoptional:description:Specify whether the Secret or its key must be definedtype:booleanrequired:-keytype:objectx-kubernetes-map-type:atomicexternalLabels:additionalProperties:type:stringdescription:|-ExternalLabels specifies external labels that are attached to any ruleresults and alerts produced by rules. The precedence behavior matches thatof Prometheus.type:objectgeneratorUrl:description:|-The base URL used for the generator URL in the alert notification payload.Should point to an instance of a query frontend that gives access to queryProjectID.type:stringqueryProjectID:description:|-QueryProjectID is the GCP project ID to evaluate rules against.If left blank, the rule-evaluator will try attempt to infer the Project IDfrom the environment.type:stringtype:objectscaling:description:Scaling contains configuration options for scaling GMP.properties:vpa:description:VPASpec defines configuration options for vertical pod autoscaling.properties:enabled:description:|-Enabled configures whether the operator configures Vertical Pod Autoscaling for GMP workloads.In GKE, installing Vertical Pod Autoscaling requires a cluster restart, and therefore it also results in an operator restart.In other environments, the operator may need to be restarted to enable VPA to run the following check again and watch for the objects.type:booleantype:objecttype:objecttype:objectserved:truestorage:true-deprecated:truename:v1alpha1schema:openAPIV3Schema:description:OperatorConfig defines configuration of the gmp-operator.properties:apiVersion:description:|-APIVersion defines the versioned schema of this representation of an object.Servers should convert recognized schemas to the latest internal value, andmay reject unrecognized values.More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resourcestype:stringcollection:description:Collection specifies how the operator configures collection.properties:credentials:description:|-A reference to GCP service account credentials with which Prometheus collectorsare run. It needs to have metric write permissions for all project IDs to whichdata is written.Within GKE, this can typically be left empty if the compute defaultservice account has the required permissions.properties:key:description:The key of the secret to select from. Must be a valid secret key.type:stringname:default:""description:|-Name of the referent.This field is effectively required, but due to backwards compatibility isallowed to be empty. Instances of this type with an empty value here arealmost certainly wrong.More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namestype:stringoptional:description:Specify whether the Secret or its key must be definedtype:booleanrequired:-keytype:objectx-kubernetes-map-type:atomicexternalLabels:additionalProperties:type:stringdescription:|-ExternalLabels specifies external labels that are attached to all scrapeddata before being written to Cloud Monitoring. The precedence behavior matches thatof Prometheus.type:objectfilter:description:Filter limits which metric data is sent to Cloud Monitoring.properties:matchOneOf:description:|-A list Prometheus time series matchers. Every time series must match at least oneof the matchers to be exported. This field can be used equivalently to the match[]parameter of the Prometheus federation endpoint to selectively export data.Example: `["{job='prometheus'}", "{__name__=~'job:.*'}"]`items:type:stringtype:arraytype:objecttype:objectkind:description:|-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-kindstype:stringmetadata:type:objectrules:description:Rules specifies how the operator configures and deployes rule-evaluator.properties:alerting:description:Alerting contains how the rule-evaluator configures alerting.properties:alertmanagers:description:Alertmanagers contains endpoint configuration for designated Alertmanagers.items:description:|-AlertmanagerEndpoints defines a selection of a single Endpoints objectcontaining alertmanager IPs to fire alerts against.properties:apiVersion:description:|-Version of the Alertmanager API that rule-evaluator uses to send alerts. Itcan be "v1" or "v2".type:stringauthorization:description:Authorization section for this alertmanager endpointproperties:credentials:description:The secret's key that contains the credentials of the requestproperties:key:description:The key of the secret to select from. Must be a valid secret key.type:stringname:default:""description:|-Name of the referent.This field is effectively required, but due to backwards compatibility isallowed to be empty. Instances of this type with an empty value here arealmost certainly wrong.More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namestype:stringoptional:description:Specify whether the Secret or its key must be definedtype:booleanrequired:-keytype:objectx-kubernetes-map-type:atomictype:description:|-Set the authentication type. Defaults to Bearer, Basic will cause anerrortype:stringtype:objectname:description:Name of Endpoints object in Namespace.type:stringnamespace:description:Namespace of Endpoints object.type:stringpathPrefix:description:Prefix for the HTTP path alerts are pushed to.type:stringport:anyOf:-type:integer-type:stringdescription:Port the Alertmanager API is exposed on.x-kubernetes-int-or-string:truescheme:description:Scheme to use when firing alerts.type:stringtimeout:description:Timeout is a per-target Alertmanager timeout when pushing alerts.type:stringtls:description:TLS Config to use for alertmanager connection.properties:ca:description:Struct containing the CA cert to use for the targets.properties:configMap:description:ConfigMap containing data to use for the targets.properties:key:description:The key to select.type:stringname:default:""description:|-Name of the referent.This field is effectively required, but due to backwards compatibility isallowed to be empty. Instances of this type with an empty value here arealmost certainly wrong.More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namestype:stringoptional:description:Specify whether the ConfigMap or its key must be definedtype:booleanrequired:-keytype:objectx-kubernetes-map-type:atomicsecret:description:Secret containing data to use for the targets.properties:key:description:The key of the secret to select from. Must be a valid secret key.type:stringname:default:""description:|-Name of the referent.This field is effectively required, but due to backwards compatibility isallowed to be empty. Instances of this type with an empty value here arealmost certainly wrong.More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namestype:stringoptional:description:Specify whether the Secret or its key must be definedtype:booleanrequired:-keytype:objectx-kubernetes-map-type:atomictype:objectcert:description:Struct containing the client cert file for the targets.properties:configMap:description:ConfigMap containing data to use for the targets.properties:key:description:The key to select.type:stringname:default:""description:|-Name of the referent.This field is effectively required, but due to backwards compatibility isallowed to be empty. Instances of this type with an empty value here arealmost certainly wrong.More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namestype:stringoptional:description:Specify whether the ConfigMap or its key must be definedtype:booleanrequired:-keytype:objectx-kubernetes-map-type:atomicsecret:description:Secret containing data to use for the targets.properties:key:description:The key of the secret to select from. Must be a valid secret key.type:stringname:default:""description:|-Name of the referent.This field is effectively required, but due to backwards compatibility isallowed to be empty. Instances of this type with an empty value here arealmost certainly wrong.More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namestype:stringoptional:description:Specify whether the Secret or its key must be definedtype:booleanrequired:-keytype:objectx-kubernetes-map-type:atomictype:objectinsecureSkipVerify:description:Disable target certificate validation.type:booleankeySecret:description:Secret containing the client key file for the targets.properties:key:description:The key of the secret to select from. Must be a valid secret key.type:stringname:default:""description:|-Name of the referent.This field is effectively required, but due to backwards compatibility isallowed to be empty. Instances of this type with an empty value here arealmost certainly wrong.More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namestype:stringoptional:description:Specify whether the Secret or its key must be definedtype:booleanrequired:-keytype:objectx-kubernetes-map-type:atomicserverName:description:Used to verify the hostname for the targets.type:stringtype:objectrequired:-name-namespace-porttype:objecttype:arraytype:objectcredentials:description:|-A reference to GCP service account credentials with which the ruleevaluator container is run. It needs to have metric read permissionsagainst queryProjectId and metric write permissions against all projectsto which rule results are written.Within GKE, this can typically be left empty if the compute defaultservice account has the required permissions.properties:key:description:The key of the secret to select from. Must be a valid secret key.type:stringname:default:""description:|-Name of the referent.This field is effectively required, but due to backwards compatibility isallowed to be empty. Instances of this type with an empty value here arealmost certainly wrong.More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#namestype:stringoptional:description:Specify whether the Secret or its key must be definedtype:booleanrequired:-keytype:objectx-kubernetes-map-type:atomicexternalLabels:additionalProperties:type:stringdescription:|-ExternalLabels specifies external labels that are attached to any ruleresults and alerts produced by rules. The precedence behavior matches thatof Prometheus.type:objectqueryProjectID:description:|-QueryProjectID is the GCP project ID to evaluate rules against.If left blank, the rule-evaluator will try attempt to infer the Project IDfrom the environment.type:stringtype:objecttype:objectserved:truestorage:false---apiVersion:apiextensions.k8s.io/v1kind:CustomResourceDefinitionmetadata:annotations:controller-gen.kubebuilder.io/version:v0.17.1-0.20250103184936-50893dee96daname:podmonitorings.monitoring.googleapis.comspec:group:monitoring.googleapis.comnames:kind:PodMonitoringlistKind:PodMonitoringListplural:podmonitoringssingular:podmonitoringscope:Namespacedversions:-name:v1schema:openAPIV3Schema:description:|-PodMonitoring defines monitoring for a set of pods, scoped to podswithin the PodMonitoring's namespace.properties:apiVersion:description:|-APIVersion defines the versioned schema of this representation of an object.Servers should convert recognized schemas to the latest internal value, andmay reject unrecognized values.More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resourcestype:stringkind:description:|-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-kindstype:stringmetadata:type:objectspec:description:|-Specification of desired Pod selection for target discovery byPrometheus.properties:endpoints:description:The endpoints to scrape on the selected pods.items:description:ScrapeEndpoint specifies a Prometheus metrics endpoint to scrape.properties:authorization:description:Authorization is the HTTP authorization credentials for the targets.properties:credentials:description:Credentials uses the secret as the credentials (token) for the authentication header.properties:secret:description:Secret represents reference to a given key from certain Secret in a given namespace.properties:key:description:Key of the secret to select from. Must be a valid secret key.type:stringname:description:Name of the secret to select from.type:stringnamespace:description:|-Namespace of the secret to select from.If empty the parent resource namespace will be chosen.type:stringrequired:-key-nametype:objecttype:objecttype:description:|-Type is the authentication type. Defaults to Bearer.Basic will cause an error, as the BasicAuth object should be used instead.type:stringx-kubernetes-validations:-message:authorization type cannot be set to "basic", use "basic_auth" insteadrule:self != 'Basic'type:objectbasicAuth:description:BasicAuth is the HTTP basic authentication credentials for the targets.properties:password:description:Password uses the secret as the BasicAuth password.properties:secret:description:Secret represents reference to a given key from certain Secret in a given namespace.properties:key:description:Key of the secret to select from. Must be a valid secret key.type:stringname:description:Name of the secret to select from.type:stringnamespace:description:|-Namespace of the secret to select from.If empty the parent resource namespace will be chosen.type:stringrequired:-key-nametype:objecttype:objectusername:description:Username is the BasicAuth username.type:stringtype:objectinterval:description:Interval at which to scrape metrics. Must be a valid Prometheus duration.format:durationtype:stringmetricRelabeling:description:|-Relabeling rules for metrics scraped from this endpoint. Relabeling rules thatoverride protected target labels (project_id, location, cluster, namespace, job,instance, top_level_controller, top_level_controller_type, or __address__) arenot permitted. The labelmap action is not permitted in general.items:description:RelabelingRule defines a single Prometheus relabeling rule.properties:action:description:Action to perform based on regex matching. Defaults to 'replace'.enum:-replace-lowercase-uppercase-keep-drop-keepequal-dropequal-hashmod-labeldrop-labelkeeptype:stringmodulus:description:Modulus to take of the hash of the source label values.format:int64type:integerregex:description:Regular expression against which the extracted value is matched. Defaults to '(.*)'.maxLength:10000type:stringreplacement:description:|-Replacement value against which a regex replace is performed if theregular expression matches. Regex capture groups are available. Defaults to '$1'.type:stringseparator:description:Separator placed between concatenated source label values. Defaults to ';'.type:stringsourceLabels:description:|-The source labels select values from existing labels. Their content is concatenatedusing the configured separator and matched against the configured regular expressionfor the replace, keep, and drop actions.items:pattern:^[a-zA-Z_][a-zA-Z0-9_]*$type:stringmaxItems:100type:arraytargetLabel:description:|-Label to which the resulting value is written in a replace action.It is mandatory for replace actions. Regex capture groups are available.pattern:^[a-zA-Z_][a-zA-Z0-9_]*$type:stringx-kubernetes-validations:-messageExpression:'''cannotrelabelontoprotectedlabel"%s"''.format([self])'rule:self != 'project_id' && self != 'location' && self != 'cluster' && self != 'namespace' && self != 'job' && self != 'instance' && self != 'top_level_controller' && self != 'top_level_controller_type' && self != '__address__'type:objectx-kubernetes-validations:-rule:'!has(self.action)||self.action!=''labeldrop''||has(self.regex)'maxItems:250type:arrayoauth2:description:OAuth2 is the OAuth2 client credentials used to fetch a token for the targets.properties:clientID:description:ClientID is the public identifier for the client.type:stringclientSecret:description:ClientSecret uses the secret as the client secret token.properties:secret:description:Secret represents reference to a given key from certain Secret in a given namespace.properties:key:description:Key of the secret to select from. Must be a valid secret key.type:stringname:description:Name of the secret to select from.type:stringnamespace:description:|-Namespace of the secret to select from.If empty the parent resource namespace will be chosen.type:stringrequired:-key-nametype:objecttype:objectendpointParams:additionalProperties:type:stringdescription:EndpointParams are additional parameters to append to the token URL.type:objectproxyUrl:description:|-ProxyURL is the HTTP proxy server to use to connect to the targets.Encoded passwords are not supported.maxLength:2000type:stringx-kubernetes-validations:-rule:isURL(self) && !self.matches('@')scopes:description:Scopes represents the scopes for the token request.items:type:stringtype:arraytlsConfig:description:TLS configures the token request's TLS settings.properties:ca:description:|-SecretSelector references a secret from a secret provider e.g. Kubernetes Secret. Only oneprovider can be used at a time.properties:secret:description:Secret represents reference to a given key from certain Secret in a given namespace.properties:key:description:Key of the secret to select from. Must be a valid secret key.type:stringname:description:Name of the secret to select from.type:stringnamespace:description:|-Namespace of the secret to select from.If empty the parent resource namespace will be chosen.type:stringrequired:-key-nametype:objecttype:objectcert:description:Cert uses the secret as the certificate for client authentication to the server.properties:secret:description:Secret represents reference to a given key from certain Secret in a given namespace.properties:key:description:Key of the secret to select from. Must be a valid secret key.type:stringname:description:Name of the secret to select from.type:stringnamespace:description:|-Namespace of the secret to select from.If empty the parent resource namespace will be chosen.type:stringrequired:-key-nametype:objecttype:objectinsecureSkipVerify:description:InsecureSkipVerify disables target certificate validation.type:booleankey:description:Key uses the secret as the private key for client authentication to the server.properties:secret:description:Secret represents reference to a given key from certain Secret in a given namespace.properties:key:description:Key of the secret to select from. Must be a valid secret key.type:stringname:description:Name of the secret to select from.type:stringnamespace:description:|-Namespace of the secret to select from.If empty the parent resource namespace will be chosen.type:stringrequired:-key-nametype:objecttype:objectmaxVersion:description:|-MaxVersion is the maximum TLS version. Accepted values: TLS10 (TLS 1.0), TLS11 (TLS 1.1),TLS12 (TLS 1.2), TLS13 (TLS 1.3).If unset, Prometheus will use Go default minimum version, which is TLS 1.2.See MinVersion in https://pkg.go.dev/crypto/tls#Config.enum:-TLS10-TLS11-TLS12-TLS13type:stringminVersion:description:|-MinVersion is the minimum TLS version. Accepted values: TLS10 (TLS 1.0), TLS11 (TLS 1.1),TLS12 (TLS 1.2), TLS13 (TLS 1.3).If unset, Prometheus will use Go default minimum version, which is TLS 1.2.See MinVersion in https://pkg.go.dev/crypto/tls#Config.enum:-TLS10-TLS11-TLS12-TLS13type:stringserverName:description:ServerName is used to verify the hostname for the targets.type:stringtype:objectx-kubernetes-validations:-message:client cert and client key must be provided together, when either is providedrule:has(self.cert) == has(self.key)tokenURL:description:TokenURL is the URL to fetch the token from.type:stringtype:objectparams:additionalProperties:items:type:stringtype:arraydescription:HTTP GET params to use when scraping.type:objectpath:description:HTTP path to scrape metrics from. Defaults to "/metrics".type:stringport:anyOf:-type:integer-type:stringdescription:|-Name or number of the port to scrape.The container metadata label is only populated if the port is referenced by namebecause port numbers are not unique across containers.maxLength:253minLength:1x-kubernetes-int-or-string:truex-kubernetes-validations:-message:Port is requiredrule:self != 0proxyUrl:description:|-ProxyURL is the HTTP proxy server to use to connect to the targets.Encoded passwords are not supported.maxLength:2000type:stringx-kubernetes-validations:-rule:isURL(self) && !self.matches('@')scheme:description:Protocol scheme to use to scrape.enum:-http-httpstype:stringtimeout:description:|-Timeout for metrics scrapes. Must be a valid Prometheus duration.Must not be larger than the scrape interval.format:durationtype:stringtls:description:TLS configures the scrape request's TLS settings.properties:ca:description:|-SecretSelector references a secret from a secret provider e.g. Kubernetes Secret. Only oneprovider can be used at a time.properties:secret:description:Secret represents reference to a given key from certain Secret in a given namespace.properties:key:description:Key of the secret to select from. Must be a valid secret key.type:stringname:description:Name of the secret to select from.type:stringnamespace:description:|-Namespace of the secret to select from.If empty the parent resource namespace will be chosen.type:stringrequired:-key-nametype:objecttype:objectcert:description:Cert uses the secret as the certificate for client authentication to the server.properties:secret:description:Secret represents reference to a given key from certain Secret in a given namespace.properties:key:description:Key of the secret to select from. Must be a valid secret key.type:stringname:description:Name of the secret to select from.type:stringnamespace:description:|-Namespace of the secret to select from.If empty the parent resource namespace will be chosen.type:stringrequired:-key-nametype:objecttype:objectinsecureSkipVerify:description:InsecureSkipVerify disables target certificate validation.type:booleankey:description:Key uses the secret as the private key for client authentication to the server.properties:secret:description:Secret represents reference to a given key from certain Secret in a given namespace.properties:key:description:Key of the secret to select from. Must be a valid secret key.type:stringname:description:Name of the secret to select from.type:stringnamespace:description:|-Namespace of the secret to select from.If empty the parent resource namespace will be chosen.type:stringrequired:-key-nametype:objecttype:objectmaxVersion:description:|-MaxVersion is the maximum TLS version. Accepted values: TLS10 (TLS 1.0), TLS11 (TLS 1.1),TLS12 (TLS 1.2), TLS13 (TLS 1.3).If unset, Prometheus will use Go default minimum version, which is TLS 1.2.See MinVersion in https://pkg.go.dev/crypto/tls#Config.enum:-TLS10-TLS11-TLS12-TLS13type:stringminVersion:description:|-MinVersion is the minimum TLS version. Accepted values: TLS10 (TLS 1.0), TLS11 (TLS 1.1),TLS12 (TLS 1.2), TLS13 (TLS 1.3).If unset, Prometheus will use Go default minimum version, which is TLS 1.2.See MinVersion in https://pkg.go.dev/crypto/tls#Config.enum:-TLS10-TLS11-TLS12-TLS13type:stringserverName:description:ServerName is used to verify the hostname for the targets.type:stringtype:objectx-kubernetes-validations:-message:client cert and client key must be provided together, when either is providedrule:has(self.cert) == has(self.key)required:-interval-porttype:objectx-kubernetes-validations:-messageExpression:'''scrapetimeout(%s)mustnotbegreaterthanscrapeinterval(%s)''.format([self.timeout,self.interval])'rule:'!has(self.timeout)||self.timeout<=self.interval'-rule:'((has(self.authorization)?1:0)+(has(self.basicAuth)?1:0)+(has(self.oauth2)?1:0))<=1'maxItems:10minItems:1type:arrayfilterRunning:description:|-FilterRunning will drop any pods that are in the "Failed" or "Succeeded"pod lifecycle.See: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phasetype:booleanlimits:description:Limits to apply at scrape time.properties:labelNameLength:description:|-Maximum label name length.Uses Prometheus default if left unspecified.format:int64type:integerlabelValueLength:description:|-Maximum label value length.Uses Prometheus default if left unspecified.format:int64type:integerlabels:description:|-Maximum number of labels accepted for a single sample.Uses Prometheus default if left unspecified.format:int64type:integersamples:description:|-Maximum number of samples accepted within a single scrape.Uses Prometheus default if left unspecified.format:int64type:integertype:objectselector:description:|-Label selector that specifies which pods are selected for this monitoringconfiguration.properties:matchExpressions:description:matchExpressions is a list of label selector requirements. The requirements are ANDed.items:description:|-A label selector requirement is a selector that contains values, a key, and an operator thatrelates the key and values.properties:key:description:key is the label key that the selector applies to.type:stringoperator:description:|-operator represents a key's relationship to a set of values.Valid operators are In, NotIn, Exists and DoesNotExist.type:stringvalues:description:|-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 strategicmerge patch.items:type:stringtype:arrayx-kubernetes-list-type:atomicrequired:-key-operatortype:objecttype:arrayx-kubernetes-list-type:atomicmatchLabels:additionalProperties:type:stringdescription:|-matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabelsmap is equivalent to an element of matchExpressions, whose key field is "key", theoperator is "In", and the values array contains only "value". The requirements are ANDed.type:objecttype:objectx-kubernetes-map-type:atomictargetLabels:description:|-Labels to add to the Prometheus target for discovered endpoints.The `instance` label is always set to `<pod_name>:<port>` or `<node_name>:<port>`if the scraped pod is controlled by a DaemonSet.properties:fromPod:description:|-Labels to transfer from the Kubernetes Pod to Prometheus target labels.Mappings are applied in order.items:description:|-LabelMapping specifies how to transfer a label from a Kubernetes resourceonto a Prometheus target.properties:from:description:Kubernetes resource label to remap.type:stringto:description:|-Remapped Prometheus target label.Defaults to the same name as `From`.pattern:^[a-zA-Z_][a-zA-Z0-9_]*$type:stringx-kubernetes-validations:-messageExpression:'''cannotrelabelontoprotectedlabel"%s"''.format([self])'rule:self != 'project_id' && self != 'location' && self != 'cluster' && self != 'namespace' && self != 'job' && self != 'instance' && self != 'top_level_controller' && self != 'top_level_controller_type' && self != '__address__'required:-fromtype:objectmaxItems:100type:arraymetadata:default:-container-pod-top_level_controller_name-top_level_controller_typedescription:|-Pod metadata labels that are set on all scraped targets.Permitted keys are `container`, `node`, `pod`, `top_level_controller_name`,and `top_level_controller_type`. The `container`label is only populated if the scrape port is referenced by name.Defaults to [container, pod, top_level_controller_name, top_level_controller_type].If set to null, it will be interpreted as the empty list.This is for backwards-compatibility only.items:enum:-container-node-pod-top_level_controller_name-top_level_controller_typetype:stringtype:arrayx-kubernetes-list-type:settype:objectrequired:-endpoints-selectortype:objectstatus:description:Most recently observed status of the resource.properties:conditions:description:Represents the latest available observations of a podmonitor's current state.items:description:MonitoringCondition describes the condition of a PodMonitoring.properties:lastTransitionTime:description:Last time the condition transitioned from one status to another.format:date-timetype:stringlastUpdateTime:description:The last time this condition was updated.format:date-timetype:stringmessage:description:A human-readable message indicating details about the transition.type:stringreason:description:The reason for the condition's last transition.type:stringstatus:description:Status of the condition, one of True, False, Unknown.type:stringtype:description:MonitoringConditionType is the type of MonitoringCondition.type:stringrequired:-status-typetype:objecttype:arrayendpointStatuses:description:Represents the latest available observations of target state for each ScrapeEndpoint.items:properties:activeTargets:description:Total number of active targets.format:int64type:integercollectorsFraction:description:|-Fraction of collectors included in status, bounded [0,1].Ideally, this should always be 1. Anything less canbe considered a problem and should be investigated.type:stringlastUpdateTime:description:Last time this status was updated.format:date-timetype:stringname:description:The name of the ScrapeEndpoint.type:stringsampleGroups:description:A fixed sample of targets grouped by error type.items:properties:count:description:Total count of similar errors.format:int32type:integersampleTargets:description:Targets emitting the error message.items:properties:health:description:Health status.type:stringlabels:additionalProperties:description:A LabelValue is an associated value for a LabelName.type:stringdescription:The label set, keys and values, of the target.type:objectlastError:description:Error message.type:stringlastScrapeDurationSeconds:description:Scrape duration in seconds.type:stringtype:objecttype:arraytype:objecttype:arrayunhealthyTargets:description:Total number of active, unhealthy targets.format:int64type:integerrequired:-nametype:objecttype:arrayobservedGeneration:description:The generation observed by the controller.format:int64type:integertype:objectrequired:-spectype:objectx-kubernetes-validations:-message:Namespace not allowed on PodMonitoring secret references.reason:FieldValueForbiddenrule:self.spec.endpoints.all(e, !has(e.authorization) || !has(e.authorization.credentials) || !has(e.authorization.credentials.secret) || !has(e.authorization.credentials.secret.__namespace__))-message:Namespace not allowed on PodMonitoring secret references.reason:FieldValueForbiddenrule:self.spec.endpoints.all(e, !has(e.basicAuth) || !has(e.basicAuth.password) || !has(e.basicAuth.password.secret) || !has(e.basicAuth.password.secret.__namespace__))-message:Namespace not allowed on PodMonitoring secret references.reason:FieldValueForbiddenrule:self.spec.endpoints.all(e, !has(e.tls) || !has(e.tls.ca) || !has(e.tls.ca.secret) || !has(e.tls.ca.secret.__namespace__))-message:Namespace not allowed on PodMonitoring secret references.reason:FieldValueForbiddenrule:self.spec.endpoints.all(e, !has(e.tls) || !has(e.tls.cert) || !has(e.tls.cert.secret) || !has(e.tls.cert.secret.__namespace__))-message:Namespace not allowed on PodMonitoring secret references.reason:FieldValueForbiddenrule:self.spec.endpoints.all(e, !has(e.tls) || !has(e.tls.key) || !has(e.tls.key.secret) || !has(e.tls.key.secret.__namespace__))-message:Namespace not allowed on PodMonitoring secret references.reason:FieldValueForbiddenrule:self.spec.endpoints.all(e, !has(e.oauth2) || !has(e.oauth2.clientSecret) || !has(e.oauth2.clientSecret.secret) || !has(e.oauth2.clientSecret.secret.__namespace__))served:truestorage:truesubresources:status:{}-deprecated:truename:v1alpha1schema:openAPIV3Schema:description:PodMonitoring defines monitoring for a set of pods.properties:apiVersion:description:|-APIVersion defines the versioned schema of this representation of an object.Servers should convert recognized schemas to the latest internal value, andmay reject unrecognized values.More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resourcestype:stringkind:description:|-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-kindstype:stringmetadata:type:objectspec:description:|-Specification of desired Pod selection for target discovery byPrometheus.properties:endpoints:description:The endpoints to scrape on the selected pods.items:description:ScrapeEndpoint specifies a Prometheus metrics endpoint to scrape.properties:interval:description:Interval at which to scrape metrics. Must be a valid Prometheus duration.type:stringmetricRelabeling:description:|-Relabeling rules for metrics scraped from this endpoint. Relabeling rules thatoverride protected target labels (project_id, location, cluster, namespace, job,instance, or __address__) are not permitted. The labelmap action is not permittedin general.items:description:RelabelingRule defines a single Prometheus relabeling rule.properties:action:description:Action to perform based on regex matching. Defaults to 'replace'.type:stringmodulus:description:Modulus to take of the hash of the source label values.format:int64type:integerregex:description:Regular expression against which the extracted value is matched. Defaults to '(.*)'.type:stringreplacement:description:|-Replacement value against which a regex replace is performed if theregular expression matches. Regex capture groups are available. Defaults to '$1'.type:stringseparator:description:Separator placed between concatenated source label values. Defaults to ';'.type:stringsourceLabels:description:|-The source labels select values from existing labels. Their content is concatenatedusing the configured separator and matched against the configured regular expressionfor the replace, keep, and drop actions.items:type:stringtype:arraytargetLabel:description:|-Label to which the resulting value is written in a replace action.It is mandatory for replace actions. Regex capture groups are available.type:stringtype:objecttype:arrayparams:additionalProperties:items:type:stringtype:arraydescription:HTTP GET params to use when scraping.type:objectpath:description:HTTP path to scrape metrics from. Defaults to "/metrics".type:stringport:anyOf:-type:integer-type:stringdescription:Name or number of the port to scrape.x-kubernetes-int-or-string:trueproxyUrl:description:Proxy URL to scrape through. Encoded passwords are not supported.type:stringscheme:description:Protocol scheme to use to scrape.type:stringtimeout:description:|-Timeout for metrics scrapes. Must be a valid Prometheus duration.Must not be larger then the scrape interval.type:stringrequired:-porttype:objecttype:arraylimits:description:Limits to apply at scrape time.properties:labelNameLength:description:|-Maximum label name length.Uses Prometheus default if left unspecified.format:int64type:integerlabelValueLength:description:|-Maximum label value length.Uses Prometheus default if left unspecified.format:int64type:integerlabels:description:|-Maximum number of labels accepted for a single sample.Uses Prometheus default if left unspecified.format:int64type:integersamples:description:|-Maximum number of samples accepted within a single scrape.Uses Prometheus default if left unspecified.format:int64type:integertype:objectselector:description:|-Label selector that specifies which pods are selected for this monitoringconfiguration.properties:matchExpressions:description:matchExpressions is a list of label selector requirements. The requirements are ANDed.items:description:|-A label selector requirement is a selector that contains values, a key, and an operator thatrelates the key and values.properties:key:description:key is the label key that the selector applies to.type:stringoperator:description:|-operator represents a key's relationship to a set of values.Valid operators are In, NotIn, Exists and DoesNotExist.type:stringvalues:description:|-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 strategicmerge patch.items:type:stringtype:arrayx-kubernetes-list-type:atomicrequired:-key-operatortype:objecttype:arrayx-kubernetes-list-type:atomicmatchLabels:additionalProperties:type:stringdescription:|-matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabelsmap is equivalent to an element of matchExpressions, whose key field is "key", theoperator is "In", and the values array contains only "value". The requirements are ANDed.type:objecttype:objectx-kubernetes-map-type:atomictargetLabels:description:Labels to add to the Prometheus target for discovered endpoints.properties:fromPod:description:|-Labels to transfer from the Kubernetes Pod to Prometheus target labels.Mappings are applied in order.items:description:|-LabelMapping specifies how to transfer a label from a Kubernetes resourceonto a Prometheus target.properties:from:description:Kubenetes resource label to remap.type:stringto:description:|-Remapped Prometheus target label.Defaults to the same name as `From`.type:stringrequired:-fromtype:objecttype:arraymetadata:description:|-Pod metadata labels that are set on all scraped targets.Permitted keys are `pod`, `container`, and `node` for PodMonitoring and`pod`, `container`, `node`, and `namespace` for ClusterPodMonitoring.Defaults to [pod, container] for PodMonitoring and [namespace, pod, container]for ClusterPodMonitoring.If set to null, it will be interpreted as the empty list for PodMonitoringand to [namespace] for ClusterPodMonitoring. This is for backwards-compatibilityonly.items:type:stringtype:arraytype:objectrequired:-endpoints-selectortype:objectstatus:description:Most recently observed status of the resource.properties:conditions:description:Represents the latest available observations of a podmonitor's current state.items:description:MonitoringCondition describes a condition of a PodMonitoring.properties:lastTransitionTime:description:Last time the condition transitioned from one status to another.format:date-timetype:stringlastUpdateTime:description:The last time this condition was updated.format:date-timetype:stringmessage:description:A human-readable message indicating details about the transition.type:stringreason:description:The reason for the condition's last transition.type:stringstatus:description:Status of the condition, one of True, False, Unknown.type:stringtype:description:MonitoringConditionType is the type of MonitoringCondition.type:stringrequired:-status-typetype:objecttype:arrayobservedGeneration:description:The generation observed by the controller.format:int64type:integertype:objectrequired:-spectype:objectserved:truestorage:falsesubresources:status:{}---apiVersion:apiextensions.k8s.io/v1kind:CustomResourceDefinitionmetadata:annotations:controller-gen.kubebuilder.io/version:v0.17.1-0.20250103184936-50893dee96daname:rules.monitoring.googleapis.comspec:group:monitoring.googleapis.comnames:kind:RuleslistKind:RulesListplural:rulessingular:rulesscope:Namespacedversions:-name:v1schema:openAPIV3Schema:description:|-Rules defines Prometheus alerting and recording rules that are scopedto the namespace of the resource. Only metric data from this namespace is processedand all rule results have their project_id, cluster, and namespace label preservedfor query processing.If the location label is not preserved by the rule, it defaults to the cluster's location.properties:apiVersion:description:|-APIVersion defines the versioned schema of this representation of an object.Servers should convert recognized schemas to the latest internal value, andmay reject unrecognized values.More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resourcestype:stringkind:description:|-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-kindstype:stringmetadata:type:objectspec:description:Specification of rules to record and alert on.properties:groups:description:A list of Prometheus rule groups.items:description:|-RuleGroup declares rules in the Prometheus format:https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/properties:interval:default:1mdescription:The interval at which to evaluate the rules. Must be a valid Prometheus duration.format:durationtype:stringname:description:The name of the rule group.type:stringrules:description:A list of rules that are executed sequentially as part of this group.items:description:|-Rule is a single rule in the Prometheus format:https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/properties:alert:description:|-Name of the alert to evaluate the expression as.Only one of `record` and `alert` must be set.type:stringannotations:additionalProperties:type:stringdescription:|-A set of annotations to attach to alerts produced by the query expression.Only valid if `alert` is set.type:objectexpr:description:The PromQL expression to evaluate.type:stringfor:description:|-The duration to wait before a firing alert produced by this rule is sent to Alertmanager.Only valid if `alert` is set.format:durationtype:stringlabels:additionalProperties:type:stringdescription:A set of labels to attach to the result of the query expression.type:objectrecord:description:|-Record the result of the expression to this metric name.Only one of `record` and `alert` must be set.pattern:^[a-zA-Z_:][a-zA-Z0-9_:]*$type:stringrequired:-exprtype:objectx-kubernetes-validations:-message:Must set exactly one of Record or Alertrule:'(has(self.record)?1:0)+(has(self.alert)?1:0)==1'-message:Annotations are only allowed for alerting rulesrule:'!has(self.annotations)||has(self.alert)'minItems:1type:arrayrequired:-name-rulestype:objecttype:arrayrequired:-groupstype:objectstatus:description:Most recently observed status of the resource.properties:conditions:description:Represents the latest available observations of a podmonitor's current state.items:description:MonitoringCondition describes the condition of a PodMonitoring.properties:lastTransitionTime:description:Last time the condition transitioned from one status to another.format:date-timetype:stringlastUpdateTime:description:The last time this condition was updated.format:date-timetype:stringmessage:description:A human-readable message indicating details about the transition.type:stringreason:description:The reason for the condition's last transition.type:stringstatus:description:Status of the condition, one of True, False, Unknown.type:stringtype:description:MonitoringConditionType is the type of MonitoringCondition.type:stringrequired:-status-typetype:objecttype:arrayobservedGeneration:description:The generation observed by the controller.format:int64type:integertype:objectrequired:-spectype:objectserved:truestorage:truesubresources:status:{}-deprecated:truename:v1alpha1schema:openAPIV3Schema:description:|-Rules defines Prometheus alerting and recording rules that are scopedto the namespace of the resource. Only metric data from this namespace is processedand all rule results have their project_id, cluster, and namespace label preservedfor query processing.If the location label is not preserved by the rule, it defaults to the cluster's location.properties:apiVersion:description:|-APIVersion defines the versioned schema of this representation of an object.Servers should convert recognized schemas to the latest internal value, andmay reject unrecognized values.More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resourcestype:stringkind:description:|-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-kindstype:stringmetadata:type:objectspec:description:Specification of rules to record and alert on.properties:groups:description:A list of Prometheus rule groups.items:description:|-RuleGroup declares rules in the Prometheus format:https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/properties:interval:description:The interval at which to evaluate the rules. Must be a valid Prometheus duration.type:stringname:description:The name of the rule group.type:stringrules:description:A list of rules that are executed sequentially as part of this group.items:description:|-Rule is a single rule in the Prometheus format:https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/properties:alert:description:|-Name of the alert to evaluate the expression as.Only one of `record` and `alert` must be set.type:stringannotations:additionalProperties:type:stringdescription:|-A set of annotations to attach to alerts produced by the query expression.Only valid if `alert` is set.type:objectexpr:description:The PromQL expression to evaluate.type:stringfor:description:|-The duration to wait before a firing alert produced by this rule is sent to Alertmanager.Only valid if `alert` is set.type:stringlabels:additionalProperties:type:stringdescription:A set of labels to attach to the result of the query expression.type:objectrecord:description:|-Record the result of the expression to this metric name.Only one of `record` and `alert` must be set.type:stringrequired:-exprtype:objecttype:arrayrequired:-interval-name-rulestype:objecttype:arrayrequired:-groupstype:objectstatus:description:Most recently observed status of the resource.type:objectrequired:-spectype:objectserved:truestorage:falsesubresources:status:{}operator.yaml
# Copyright 2026 Google LLC## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.---# Source: operator/templates/priorityclass.yamlapiVersion:scheduling.k8s.io/v1kind:PriorityClassmetadata:name:gmp-critical# Maximum allowed user-defined. Only system-node-critical and system-cluster-critical# pods are higher.value:1000000000description:Used for GMP collector pods.---# Source: operator/templates/namespace.yamlapiVersion:v1kind:Namespacemetadata:name:gmp-system---# Source: operator/templates/namespace.yamlapiVersion:v1kind:Namespacemetadata:name:gmp-public---# Source: operator/templates/serviceaccount.yamlapiVersion:v1kind:ServiceAccountmetadata:name:collectornamespace:gmp-system---# Source: operator/templates/serviceaccount.yamlapiVersion:v1kind:ServiceAccountmetadata:name:operatornamespace:gmp-system---# Source: operator/templates/role.yamlapiVersion:rbac.authorization.k8s.io/v1kind:ClusterRolemetadata:name:gmp-system:collectorrules:-resources:-endpoints-nodes-nodes/metrics-pods-servicesapiGroups:[""]verbs:["get","list","watch"]-resources:-configmapsapiGroups:[""]verbs:["get"]-nonResourceURLs:["/metrics"]verbs:["get"]---# Source: operator/templates/role.yamlapiVersion:rbac.authorization.k8s.io/v1kind:ClusterRolemetadata:name:gmp-system:operatorrules:# Resources controlled by the operator.-resources:-clusterpodmonitorings-clusterrules-globalrules-clusternodemonitorings-podmonitorings-rulesapiGroups:["monitoring.googleapis.com"]verbs:["get","list","watch"]-resources:-clusterpodmonitorings/status-clusterrules/status-globalrules/status-clusternodemonitorings/status-podmonitorings/status-rules/statusapiGroups:["monitoring.googleapis.com"]verbs:["get","patch","update"]-resources:-customresourcedefinitionsresourceNames:["verticalpodautoscalers.autoscaling.k8s.io"]apiGroups:["apiextensions.k8s.io"]verbs:["get"]---# Source: operator/templates/role.yamlapiVersion:rbac.authorization.k8s.io/v1kind:ClusterRolemetadata:name:gmp-system:operator:webhook-adminrules:# Permission to inject CA bundles into webhook configs of fixed name.-resources:-validatingwebhookconfigurations-mutatingwebhookconfigurationsapiGroups:["admissionregistration.k8s.io"]resourceNames:-gmp-operator.gmp-system.monitoring.googleapis.comverbs:["get","patch","update","watch"]# Permission to delete legacy webhook config the operator directly created# in previous versions.-resources:-validatingwebhookconfigurations-mutatingwebhookconfigurationsapiGroups:["admissionregistration.k8s.io"]resourceNames:-gmp-operatorverbs:["delete"]---# Source: operator/templates/rolebinding.yamlapiVersion:rbac.authorization.k8s.io/v1kind:ClusterRoleBindingmetadata:name:gmp-system:operatorroleRef:name:gmp-system:operatorkind:ClusterRoleapiGroup:rbac.authorization.k8s.iosubjects:-name:operatornamespace:gmp-systemkind:ServiceAccount---# Source: operator/templates/rolebinding.yamlapiVersion:rbac.authorization.k8s.io/v1kind:ClusterRoleBindingmetadata:name:gmp-system:operator:webhook-adminroleRef:name:gmp-system:operator:webhook-adminkind:ClusterRoleapiGroup:rbac.authorization.k8s.iosubjects:-name:operatornamespace:gmp-systemkind:ServiceAccount---# Source: operator/templates/rolebinding.yamlapiVersion:rbac.authorization.k8s.io/v1kind:ClusterRoleBindingmetadata:name:gmp-system:collectorroleRef:name:gmp-system:collectorkind:ClusterRoleapiGroup:rbac.authorization.k8s.iosubjects:-name:collectornamespace:gmp-systemkind:ServiceAccount---# Source: operator/templates/role.yamlapiVersion:rbac.authorization.k8s.io/v1kind:Rolemetadata:name:operatornamespace:gmp-systemrules:-resources:-podsapiGroups:[""]verbs:["list","watch"]-resources:-secretsapiGroups:[""]verbs:["list","watch","create"]-resources:-secretsapiGroups:[""]resourceNames:["collection","rules","alertmanager"]verbs:["get","patch","update"]-resources:-configmapsapiGroups:[""]verbs:["list","watch","create"]-resources:-configmapsapiGroups:[""]resourceNames:["collector","rule-evaluator","rules-generated"]verbs:["get","patch","update"]-resources:-daemonsetsapiGroups:["apps"]resourceNames:["collector"]verbs:["get","list","watch"]-resources:-deploymentsapiGroups:["apps"]resourceNames:["rule-evaluator"]verbs:["get","list","watch"]-resources:-deployments/scaleapiGroups:["apps"]resourceNames:["rule-evaluator"]verbs:["get","patch","update"]-resources:-servicesapiGroups:[""]resourceNames:["alertmanager"]verbs:["get","list","watch"]-resources:-statefulsetsapiGroups:["apps"]resourceNames:["alertmanager"]verbs:["get","list","watch"]-resources:-statefulsets/scaleapiGroups:["apps"]resourceNames:["alertmanager"]verbs:["get","patch","update"]-resources:-verticalpodautoscalersapiGroups:["autoscaling.k8s.io"]verbs:["create","delete","get","list","watch"]---# Source: operator/templates/role.yamlapiVersion:rbac.authorization.k8s.io/v1kind:Rolemetadata:name:operatornamespace:gmp-publicrules:-resources:-secretsapiGroups:[""]verbs:["get","list","watch"]-resources:-operatorconfigsapiGroups:["monitoring.googleapis.com"]verbs:["get","update","list","watch"]---# Source: operator/templates/rolebinding.yamlapiVersion:rbac.authorization.k8s.io/v1kind:RoleBindingmetadata:name:operatornamespace:gmp-publicroleRef:name:operatorkind:RoleapiGroup:rbac.authorization.k8s.iosubjects:-name:operatornamespace:gmp-systemkind:ServiceAccount---# Source: operator/templates/rolebinding.yamlapiVersion:rbac.authorization.k8s.io/v1kind:RoleBindingmetadata:name:operatornamespace:gmp-systemroleRef:name:operatorkind:RoleapiGroup:rbac.authorization.k8s.iosubjects:-name:operatorkind:ServiceAccount---# Source: operator/templates/alertmanager.yamlapiVersion:v1kind:Servicemetadata:name:alertmanagernamespace:gmp-systemspec:selector:app:managed-prometheus-alertmanagerapp.kubernetes.io/name:alertmanagerports:-name:alertmanagerport:9093targetPort:9093clusterIP:None---# Source: operator/templates/rule-evaluator.yamlapiVersion:v1kind:Servicemetadata:name:rule-evaluatornamespace:gmp-systemspec:selector:app.kubernetes.io/name:rule-evaluatorports:-name:rule-evaluatorport:19092targetPort:19092---# Source: operator/templates/service.yamlapiVersion:v1kind:Servicemetadata:name:gmp-operatornamespace:gmp-systemspec:selector:app.kubernetes.io/component:operatorapp.kubernetes.io/name:gmp-operatorapp.kubernetes.io/part-of:gmpports:# This port does not do anything, but allows upgrades in the case# of server-side apply (SSA) conflicts.# TODO(pintohutch): remove once the SSA issues from upgrades are resolved.-name:legacyprotocol:TCPport:8443targetPort:webhook-name:webhookprotocol:TCPport:443targetPort:web---# Source: operator/templates/collector.yamlapiVersion:apps/v1kind:DaemonSetmetadata:name:collectornamespace:gmp-systemspec:selector:matchLabels:# DO NOT MODIFY - label selectors are immutable by the Kubernetes API.# see: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/#pod-selector.app.kubernetes.io/name:collectortemplate:metadata:labels:app:managed-prometheus-collectorapp.kubernetes.io/name:collectorapp.kubernetes.io/version:0.17.2annotations:# The emptyDir for the storage and config directories prevents cluster# autoscaling unless this annotation is set.cluster-autoscaler.kubernetes.io/safe-to-evict:"true"components.gke.io/component-name:managed_prometheusspec:serviceAccountName:collectorautomountServiceAccountToken:truepriorityClassName:gmp-criticalinitContainers:-name:config-initimage:gke.gcr.io/gke-distroless/bash:gke_distroless_20251107.00_p0command:['/bin/bash','-c','touch/prometheus/config_out/config.yaml']volumeMounts:-name:config-outmountPath:/prometheus/config_outsecurityContext:allowPrivilegeEscalation:falsecapabilities:drop:-allprivileged:falsereadOnlyRootFilesystem:truecontainers:-name:config-reloaderimage:gke.gcr.io/prometheus-engine/config-reloader:v0.17.2-gke.2args:---config-file=/prometheus/config/config.yaml---config-file-output=/prometheus/config_out/config.yaml---reload-url=http://127.0.0.1:19090/-/reload---ready-url=http://127.0.0.1:19090/-/ready---listen-address=:19091ports:-name:cfg-rel-metricscontainerPort:19091env:-name:NODE_NAMEvalueFrom:fieldRef:apiVersion:v1fieldPath:spec.nodeNameresources:limits:memory:32Mrequests:cpu:1mmemory:4MvolumeMounts:-name:configreadOnly:truemountPath:/prometheus/config-name:config-outmountPath:/prometheus/config_outsecurityContext:allowPrivilegeEscalation:falsecapabilities:drop:-allprivileged:falsereadOnlyRootFilesystem:true-name:prometheusimage:gke.gcr.io/prometheus-engine/prometheus:v2.53.5-gmp.1-gke.2args:---config.file=/prometheus/config_out/config.yaml---enable-feature=exemplar-storage# Special Google flag for authorization using native Kubernetes secrets.---enable-feature=google-kubernetes-secret-provider---storage.tsdb.path=/prometheus/data---storage.tsdb.no-lockfile# Special Google flag for force deleting all data on start. We use ephemeral storage in# this manifest, but there are cases were container restart still reuses, potentially# bad data (corrupted, with high cardinality causing OOMs or slow startups).# Force deleting, so container restart is consistent with pod restart.# NOTE: Data is likely already sent GCM, plus GCM export does not use that# data on disk (WAL).---gmp.storage.delete-data-on-start# Keep 30 minutes of data. As we are backed by an emptyDir volume, this will count towards# the containers memory usage. We could lower it further if this becomes problematic, but# it the window for local data is quite convenient for debugging.---storage.tsdb.retention.time=30m---storage.tsdb.wal-compression# Effectively disable compaction and make blocks short enough so that our retention window# can be kept in practice.---storage.tsdb.min-block-duration=10m---storage.tsdb.max-block-duration=10m---web.listen-address=:19090---web.enable-lifecycle---web.route-prefix=/---export.user-agent-mode=kubectl# JSON log format is needed for GKE to display log levels correctly.---log.format=jsonports:-name:prom-metricscontainerPort:19090# The environment variable EXTRA_ARGS will be populated by the operator.# DO NOT specify it here.env:-name:GOGCvalue:"25"resources:limits:memory:2Grequests:cpu:4mmemory:32MvolumeMounts:-name:storagemountPath:/prometheus/data-name:config-outreadOnly:truemountPath:/prometheus/config_out-name:collection-secretreadOnly:truemountPath:/etc/secretslivenessProbe:httpGet:port:19090path:/-/healthyscheme:HTTPreadinessProbe:httpGet:port:19090path:/-/readyscheme:HTTPsecurityContext:allowPrivilegeEscalation:falsecapabilities:drop:-allprivileged:falsereadOnlyRootFilesystem:truevolumes:-name:storageemptyDir:{}-name:configconfigMap:name:collector-name:config-outemptyDir:{}-name:collection-secretsecret:secretName:collectionaffinity:nodeAffinity:requiredDuringSchedulingIgnoredDuringExecution:nodeSelectorTerms:-matchExpressions:-key:kubernetes.io/archoperator:Invalues:-arm64-amd64-key:kubernetes.io/osoperator:Invalues:-linuxtolerations:-key:"components.gke.io/gke-managed-components"operator:"Exists"-effect:NoExecuteoperator:Exists-effect:NoScheduleoperator:ExistssecurityContext:runAsGroup:1000runAsNonRoot:truerunAsUser:1000seccompProfile:type:RuntimeDefault---# Source: operator/templates/deployment.yamlapiVersion:apps/v1kind:Deploymentmetadata:name:gmp-operatornamespace:gmp-systemlabels:app:managed-prometheus-operatorapp.kubernetes.io/component:operatorapp.kubernetes.io/name:gmp-operatorapp.kubernetes.io/part-of:gmpspec:replicas:1selector:matchLabels:# DO NOT MODIFY - label selectors are immutable by the Kubernetes API.# see: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#label-selector-updates.app.kubernetes.io/component:operatorapp.kubernetes.io/name:gmp-operatorapp.kubernetes.io/part-of:gmptemplate:metadata:labels:app:managed-prometheus-operatorapp.kubernetes.io/component:operatorapp.kubernetes.io/name:gmp-operatorapp.kubernetes.io/part-of:gmpapp.kubernetes.io/version:0.17.2spec:serviceAccountName:operatorautomountServiceAccountToken:truepriorityClassName:gmp-criticalcontainers:-name:operatorimage:gke.gcr.io/prometheus-engine/operator:v0.17.2-gke.2args:-"--operator-namespace=gmp-system"-"--public-namespace=gmp-public"-"--webhook-addr=:10250"ports:-name:web# Note this should match the --listen-addr flag passed in to the operator args.# Default is 10250.containerPort:10250-name:metrics# Note this should match the --metrics-addr flag passed in to the operator args.# Default is 18080.containerPort:18080resources:limits:memory:2Grequests:cpu:1mmemory:16MsecurityContext:allowPrivilegeEscalation:falsecapabilities:drop:-allprivileged:falsereadOnlyRootFilesystem:truelivenessProbe:httpGet:path:/healthz# Note this should match the --probe-addr flag passed in to the operator args.# Default is 18081.port:18081scheme:HTTPreadinessProbe:httpGet:path:/readyz# Note this should match the --probe-addr flag passed in to the operator args.# Default is 18081.port:18081scheme:HTTPvolumeMounts:-name:certsmountPath:/etc/tls/privateaffinity:nodeAffinity:requiredDuringSchedulingIgnoredDuringExecution:nodeSelectorTerms:-matchExpressions:-key:kubernetes.io/archoperator:Invalues:-arm64-amd64-key:kubernetes.io/osoperator:Invalues:-linuxtolerations:-key:"components.gke.io/gke-managed-components"operator:"Exists"-value:"amd64"effect:"NoSchedule"key:"kubernetes.io/arch"operator:"Equal"-value:"arm64"effect:"NoSchedule"key:"kubernetes.io/arch"operator:"Equal"securityContext:runAsGroup:1000runAsNonRoot:truerunAsUser:1000seccompProfile:type:RuntimeDefaultvolumes:-name:certsemptyDir:{}---# Source: operator/templates/rule-evaluator.yamlapiVersion:apps/v1kind:Deploymentmetadata:name:rule-evaluatornamespace:gmp-systemspec:selector:matchLabels:# DO NOT MODIFY - label selectors are immutable by the Kubernetes API.# see: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#label-selector-updates.app.kubernetes.io/name:rule-evaluatortemplate:metadata:labels:app.kubernetes.io/name:rule-evaluatorapp:managed-prometheus-rule-evaluatorapp.kubernetes.io/version:0.17.2annotations:# The emptyDir for the storage and config directories prevents cluster# autoscaling unless this annotation is set.cluster-autoscaler.kubernetes.io/safe-to-evict:"true"components.gke.io/component-name:managed_prometheusspec:serviceAccountName:collectorautomountServiceAccountToken:truepriorityClassName:gmp-criticalinitContainers:-name:config-initimage:gke.gcr.io/gke-distroless/bash:gke_distroless_20251107.00_p0command:['/bin/bash','-c','touch/prometheus/config_out/config.yaml']volumeMounts:-name:config-outmountPath:/prometheus/config_outsecurityContext:allowPrivilegeEscalation:falsecapabilities:drop:-allprivileged:falsereadOnlyRootFilesystem:truecontainers:-name:evaluatorimage:gke.gcr.io/prometheus-engine/rule-evaluator:v0.17.2-gke.2args:---config.file=/prometheus/config_out/config.yaml---web.listen-address=:19092---export.user-agent-mode=kubectlports:-name:r-eval-metricscontainerPort:19092resources:limits:memory:1Grequests:cpu:1mmemory:16MvolumeMounts:-name:config-outreadOnly:truemountPath:/prometheus/config_out-name:rules-outreadOnly:truemountPath:/etc/rules-name:rules-secretreadOnly:truemountPath:/etc/secretslivenessProbe:httpGet:port:19092path:/-/healthyscheme:HTTPreadinessProbe:httpGet:port:19092path:/-/readyscheme:HTTPsecurityContext:allowPrivilegeEscalation:falsecapabilities:drop:-allprivileged:falsereadOnlyRootFilesystem:true-name:config-reloaderimage:gke.gcr.io/prometheus-engine/config-reloader:v0.17.2-gke.2args:---config-file=/prometheus/config/config.yaml---config-file-output=/prometheus/config_out/config.yaml---config-dir=/etc/rules---config-dir-output=/prometheus/rules_out---watched-dir=/etc/secrets---reload-url=http://127.0.0.1:19092/-/reload---ready-url=http://127.0.0.1:19092/-/ready---listen-address=:19093ports:-name:cfg-rel-metricscontainerPort:19093resources:limits:memory:32Mrequests:cpu:1mmemory:4MvolumeMounts:-name:configreadOnly:truemountPath:/prometheus/config-name:config-outmountPath:/prometheus/config_out-name:rulesreadOnly:truemountPath:/etc/rules-name:rules-outmountPath:/prometheus/rules_out-name:rules-secretreadOnly:truemountPath:/etc/secretssecurityContext:allowPrivilegeEscalation:falsecapabilities:drop:-allprivileged:falsereadOnlyRootFilesystem:truevolumes:-name:configconfigMap:name:rule-evaluatordefaultMode:420-name:config-outemptyDir:{}-name:rulesconfigMap:name:rules-generateddefaultMode:420-name:rules-outemptyDir:{}-name:rules-secretsecret:defaultMode:420secretName:rulesaffinity:nodeAffinity:requiredDuringSchedulingIgnoredDuringExecution:nodeSelectorTerms:-matchExpressions:-key:kubernetes.io/archoperator:Invalues:-arm64-amd64-key:kubernetes.io/osoperator:Invalues:-linuxtolerations:-key:"components.gke.io/gke-managed-components"operator:"Exists"-value:"amd64"effect:"NoSchedule"key:"kubernetes.io/arch"operator:"Equal"-value:"arm64"effect:"NoSchedule"key:"kubernetes.io/arch"operator:"Equal"securityContext:runAsGroup:1000runAsNonRoot:truerunAsUser:1000seccompProfile:type:RuntimeDefault---# Source: operator/templates/alertmanager.yamlapiVersion:apps/v1kind:StatefulSetmetadata:name:alertmanagernamespace:gmp-systemspec:selector:matchLabels:# DO NOT MODIFY - label selectors are immutable by the Kubernetes API.# see: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#pod-selector.app:managed-prometheus-alertmanagerapp.kubernetes.io/name:alertmanagertemplate:metadata:labels:app:managed-prometheus-alertmanagerapp.kubernetes.io/name:alertmanagerapp.kubernetes.io/version:0.17.2annotations:cluster-autoscaler.kubernetes.io/safe-to-evict:"true"components.gke.io/component-name:managed_prometheusspec:priorityClassName:gmp-criticalautomountServiceAccountToken:falseinitContainers:-name:config-initimage:gke.gcr.io/gke-distroless/bash:gke_distroless_20251107.00_p0command:['/bin/bash','-c','touch/alertmanager/config_out/config.yaml &&echo-e"receivers:\n-name:noop\nroute:\nreceiver:noop" >alertmanager/config_out/config.yaml']volumeMounts:-name:alertmanager-configmountPath:/alertmanager/config_outsecurityContext:allowPrivilegeEscalation:falsecapabilities:drop:-allprivileged:falsereadOnlyRootFilesystem:truecontainers:-name:alertmanagerimage:gke.gcr.io/prometheus-engine/alertmanager:v0.27.0-gmp.4-gke.4args:---config.file=/alertmanager/config_out/config.yaml---storage.path=/alertmanager-data---cluster.listen-address=[$(POD_IP)]:9094---web.listen-address=:9093---log.format=jsonports:-name:alertmanagercontainerPort:9093env:-name:POD_IPvalueFrom:fieldRef:apiVersion:v1fieldPath:status.podIPresources:limits:memory:128Mrequests:cpu:1mmemory:16MvolumeMounts:-name:alertmanager-configreadOnly:truemountPath:/alertmanager/config_out-name:alertmanager-datamountPath:/alertmanager-datasecurityContext:allowPrivilegeEscalation:falsecapabilities:drop:-allprivileged:falsereadOnlyRootFilesystem:true-name:config-reloaderimage:gke.gcr.io/prometheus-engine/config-reloader:v0.17.2-gke.2args:---config-file=/alertmanager/config.yaml---config-file-output=/alertmanager/config_out/config.yaml---reload-url=http://127.0.0.1:9093/-/reload---ready-url=http://127.0.0.1:9093/-/ready---listen-address=:19091ports:-name:cfg-rel-metricscontainerPort:19091env:-name:NODE_NAMEvalueFrom:fieldRef:apiVersion:v1fieldPath:spec.nodeNameresources:limits:memory:32Mrequests:cpu:1mmemory:4MvolumeMounts:-name:configreadOnly:truemountPath:/alertmanager-name:alertmanager-configmountPath:/alertmanager/config_outsecurityContext:allowPrivilegeEscalation:falsecapabilities:drop:-allprivileged:falsereadOnlyRootFilesystem:truevolumes:-name:configsecret:secretName:alertmanager-name:alertmanager-dataemptyDir:{}-name:alertmanager-configemptyDir:{}affinity:nodeAffinity:requiredDuringSchedulingIgnoredDuringExecution:nodeSelectorTerms:-matchExpressions:-key:kubernetes.io/archoperator:Invalues:-arm64-amd64-key:kubernetes.io/osoperator:Invalues:-linuxtolerations:-key:"components.gke.io/gke-managed-components"operator:"Exists"-value:"amd64"effect:"NoSchedule"key:"kubernetes.io/arch"operator:"Equal"-value:"arm64"effect:"NoSchedule"key:"kubernetes.io/arch"operator:"Equal"securityContext:runAsGroup:1000runAsNonRoot:truerunAsUser:1000seccompProfile:type:RuntimeDefaultserviceName:alertmanager---# Source: operator/templates/mutatingwebhookconfiguration.yamlapiVersion:admissionregistration.k8s.io/v1kind:MutatingWebhookConfigurationmetadata:name:gmp-operator.gmp-system.monitoring.googleapis.comwebhooks:-name:default.operatorconfigs.gmp-operator.gmp-system.monitoring.googleapis.comadmissionReviewVersions:-v1clientConfig:# caBundle populated by operator.service:name:gmp-operatornamespace:gmp-systemport:443path:/default/monitoring.googleapis.com/v1/operatorconfigs# Since this is re-applied at runtime by the operator's controllers# we can safely ignore any transient issues with the webhook server.failurePolicy:Ignorerules:-resources:-operatorconfigsapiGroups:-monitoring.googleapis.comapiVersions:-v1operations:-UPDATEsideEffects:None---# Source: operator/templates/operatorconfig.yamlapiVersion:monitoring.googleapis.com/v1kind:OperatorConfigmetadata:name:confignamespace:gmp-public---# Source: operator/templates/validating-admission-policy.yaml# Copyright 2025 Google LLC## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.apiVersion:admissionregistration.k8s.io/v1kind:ValidatingAdmissionPolicymetadata:name:"operatorconfigs.monitoring.googleapis.com"spec:failurePolicy:FailmatchConstraints:resourceRules:-apiGroups:["monitoring.googleapis.com"]apiVersions:["*"]operations:["CREATE","UPDATE"]resources:["operatorconfigs"]validations:-expression:"object.metadata.name=='config'"-expression:"object.metadata.namespace=='gmp-public'"---# Source: operator/templates/validating-admission-policy.yamlapiVersion:admissionregistration.k8s.io/v1kind:ValidatingAdmissionPolicymetadata:name:"protected-labels.monitoring.googleapis.com"spec:failurePolicy:FailmatchConstraints:resourceRules:-apiGroups:["monitoring.googleapis.com"]apiVersions:["*"]operations:["CREATE","UPDATE"]resources:["clusternodemonitorings","clusterpodmonitorings","podmonitorings"]validations:-expression:"object.spec.endpoints.all(e,!has(e.metricRelabeling)||e.metricRelabeling.all(m,!has(m.regex)||'project_id'.matches(m.regex)==false))"message:"Relabelingruleregexwouldmatchprotectedlabel:\"project_id\""-expression:"object.spec.endpoints.all(e,!has(e.metricRelabeling)||e.metricRelabeling.all(m,!has(m.regex)||'location'.matches(m.regex)==false))"message:"Relabelingruleregexwouldmatchprotectedlabel:\"location\""-expression:"object.spec.endpoints.all(e,!has(e.metricRelabeling)||e.metricRelabeling.all(m,!has(m.regex)||'cluster'.matches(m.regex)==false))"message:"Relabelingruleregexwouldmatchprotectedlabel:\"cluster\""-expression:"object.spec.endpoints.all(e,!has(e.metricRelabeling)||e.metricRelabeling.all(m,!has(m.regex)||'namespace'.matches(m.regex)==false))"message:"Relabelingruleregexwouldmatchprotectedlabel:\"namespace\""-expression:"object.spec.endpoints.all(e,!has(e.metricRelabeling)||e.metricRelabeling.all(m,!has(m.regex)||'instance'.matches(m.regex)==false))"message:"Relabelingruleregexwouldmatchprotectedlabel:\"instance\""-expression:"object.spec.endpoints.all(e,!has(e.metricRelabeling)||e.metricRelabeling.all(m,!has(m.regex)||'top_level_controller'.matches(m.regex)==false))"message:"Relabelingruleregexwouldmatchprotectedlabel:\"top_level_controller\""-expression:"object.spec.endpoints.all(e,!has(e.metricRelabeling)||e.metricRelabeling.all(m,!has(m.regex)||'top_level_controller_type'.matches(m.regex)==false))"message:"Relabelingruleregexwouldmatchprotectedlabel:\"top_level_controller_type\""-expression:"object.spec.endpoints.all(e,!has(e.metricRelabeling)||e.metricRelabeling.all(m,!has(m.regex)||'__address__'.matches(m.regex)==false))"message:"Relabelingruleregexwouldmatchprotectedlabel:\"__address__\""---# Source: operator/templates/validating-admission-policy.yamlapiVersion:admissionregistration.k8s.io/v1kind:ValidatingAdmissionPolicymetadata:name:"unique-ports.monitoring.googleapis.com"spec:failurePolicy:FailmatchConstraints:resourceRules:-apiGroups:["monitoring.googleapis.com"]apiVersions:["*"]operations:["CREATE","UPDATE"]resources:["clusterpodmonitorings","podmonitorings"]variables:-name:"ports"expression:"object.spec.endpoints.map(e,e.port)"validations:-expression:"variables.ports.all(p,variables.ports.exists_one(ep,ep==p))"message:"Portsmustbeuniqueacrossallendpoints"---# Source: operator/templates/validating-admission-policy.yamlapiVersion:admissionregistration.k8s.io/v1kind:ValidatingAdmissionPolicyBindingmetadata:name:"operatorconfigs.monitoring.googleapis.com"spec:policyName:"operatorconfigs.monitoring.googleapis.com"validationActions:[Deny]---# Source: operator/templates/validating-admission-policy.yamlapiVersion:admissionregistration.k8s.io/v1kind:ValidatingAdmissionPolicyBindingmetadata:name:"protected-labels.monitoring.googleapis.com"spec:policyName:"protected-labels.monitoring.googleapis.com"validationActions:[Deny]---# Source: operator/templates/validating-admission-policy.yamlapiVersion:admissionregistration.k8s.io/v1kind:ValidatingAdmissionPolicyBindingmetadata:name:"unique-ports.monitoring.googleapis.com"spec:policyName:"unique-ports.monitoring.googleapis.com"validationActions:[Deny]---# Source: operator/templates/validatingwebhookconfiguration.yamlapiVersion:admissionregistration.k8s.io/v1kind:ValidatingWebhookConfigurationmetadata:name:gmp-operator.gmp-system.monitoring.googleapis.comwebhooks:-name:validate.rules.gmp-operator.gmp-system.monitoring.googleapis.comadmissionReviewVersions:-v1clientConfig:# caBundle populated by operator.service:name:gmp-operatornamespace:gmp-systemport:443path:/validate/monitoring.googleapis.com/v1/rulesfailurePolicy:Failrules:-resources:-rulesapiGroups:-monitoring.googleapis.comapiVersions:-v1operations:-CREATE-UPDATEsideEffects:None-name:validate.clusterrules.gmp-operator.gmp-system.monitoring.googleapis.comadmissionReviewVersions:-v1clientConfig:# caBundle populated by operator.service:name:gmp-operatornamespace:gmp-systemport:443path:/validate/monitoring.googleapis.com/v1/clusterrulesfailurePolicy:Failrules:-resources:-clusterrulesapiGroups:-monitoring.googleapis.comapiVersions:-v1operations:-CREATE-UPDATEsideEffects:None-name:validate.globalrules.gmp-operator.gmp-system.monitoring.googleapis.comadmissionReviewVersions:-v1clientConfig:# caBundle populated by operator.service:name:gmp-operatornamespace:gmp-systemport:443path:/validate/monitoring.googleapis.com/v1/globalrulesfailurePolicy:Failrules:-resources:-globalrulesapiGroups:-monitoring.googleapis.comapiVersions:-v1operations:-CREATE-UPDATEsideEffects:None-name:validate.operatorconfigs.gmp-operator.gmp-system.monitoring.googleapis.comadmissionReviewVersions:-v1clientConfig:# caBundle populated by operator.service:name:gmp-operatornamespace:gmp-systemport:443path:/validate/monitoring.googleapis.com/v1/operatorconfigsfailurePolicy:Failrules:-resources:-operatorconfigsapiGroups:-monitoring.googleapis.comapiVersions:-v1operations:-CREATE-UPDATEsideEffects:Noneexample-app.yaml
# Copyright 2022 Google LLC## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## https://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.apiVersion:apps/v1kind:Deploymentmetadata:name:prom-examplelabels:app.kubernetes.io/name:prom-examplespec:selector:matchLabels:app.kubernetes.io/name:prom-examplereplicas:3template:metadata:labels:app.kubernetes.io/name:prom-examplespec:affinity:nodeAffinity:requiredDuringSchedulingIgnoredDuringExecution:nodeSelectorTerms:-matchExpressions:-key:kubernetes.io/archoperator:Invalues:-arm64-amd64-key:kubernetes.io/osoperator:Invalues:-linuxcontainers:-image:nilebox/prometheus-example-app@sha256:dab60d038c5d6915af5bcbe5f0279a22b95a8c8be254153e22d7cd81b21b84c5name:prom-exampleports:-name:metricscontainerPort:1234command:-"/main"-"--process-metrics"-"--go-metrics"pod-monitoring.yaml
# Copyright 2022 Google LLC## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## https://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.apiVersion:monitoring.googleapis.com/v1kind:PodMonitoringmetadata:name:prom-examplelabels:app.kubernetes.io/name:prom-examplespec:selector:matchLabels:app.kubernetes.io/name:prom-exampleendpoints:-port:metricsinterval:30sprometheus.yaml
# Copyright 2022 Google LLC## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## https://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.apiVersion:rbac.authorization.k8s.io/v1kind:ClusterRolemetadata:name:gmp-test:prometheus-testrules:-apiGroups:[""]resources:-podsverbs:["get","list","watch"]---apiVersion:rbac.authorization.k8s.io/v1kind:ClusterRoleBindingmetadata:name:gmp-test:prometheus-testroleRef:apiGroup:rbac.authorization.k8s.iokind:ClusterRolename:gmp-test:prometheus-testsubjects:-kind:ServiceAccountnamespace:gmp-testname:default---apiVersion:v1kind:Servicemetadata:namespace:gmp-testname:prometheus-testlabels:prometheus:testspec:type:ClusterIPselector:app:prometheusprometheus:testports:-name:webport:9090targetPort:web---apiVersion:apps/v1kind:StatefulSetmetadata:namespace:gmp-testname:prometheus-testannotations:# The emptyDir for the storage and config directories prevents cluster# autoscaling unless this annotation is set. See# https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-types-of-pods-can-prevent-ca-from-removing-a-node# for details.cluster-autoscaler.kubernetes.io/safe-to-evict:"true"labels:prometheus:testspec:replicas:1selector:matchLabels:app:prometheusprometheus:testserviceName:prometheus-testtemplate:metadata:labels:app:prometheusprometheus:testspec:automountServiceAccountToken:trueaffinity:nodeAffinity:requiredDuringSchedulingIgnoredDuringExecution:nodeSelectorTerms:-matchExpressions:-key:kubernetes.io/archoperator:Invalues:-arm64-amd64-key:kubernetes.io/osoperator:Invalues:-linuxinitContainers:-name:config-initimage:gke.gcr.io/gke-distroless/bash:gke_distroless_20251007.00_p0command:['/bin/bash','-c','touch/prometheus/config_out/config.yaml']volumeMounts:-name:config-outmountPath:/prometheus/config_outsecurityContext:allowPrivilegeEscalation:falsecapabilities:drop:-allprivileged:falsecontainers:-name:prometheusimage:gke.gcr.io/prometheus-engine/prometheus:v2.53.5-gmp.1-gke.2args:---config.file=/prometheus/config_out/config.yaml---storage.tsdb.path=/prometheus/data---storage.tsdb.retention.time=24h---web.enable-lifecycle---storage.tsdb.no-lockfile---web.route-prefix=/ports:-name:webcontainerPort:9090readinessProbe:httpGet:path:/-/readyport:webscheme:HTTPresources:requests:memory:400MivolumeMounts:-name:config-outmountPath:/prometheus/config_outreadOnly:true-name:prometheus-dbmountPath:/prometheus/data-name:config-reloaderimage:gke.gcr.io/prometheus-engine/config-reloader:v0.17.2-gke.2args:---config-file=/prometheus/config/config.yaml---config-file-output=/prometheus/config_out/config.yaml---reload-url=http://localhost:9090/-/reload---ready-url=http://localhost:9090/-/ready---listen-address=:19091ports:-name:reloader-webcontainerPort:8080resources:limits:memory:50Mirequests:cpu:100mmemory:50MivolumeMounts:-name:configmountPath:/prometheus/config-name:config-outmountPath:/prometheus/config_outterminationGracePeriodSeconds:600volumes:-name:prometheus-dbemptyDir:{}-name:configconfigMap:name:prometheus-testdefaultMode:420-name:config-outemptyDir:{}---apiVersion:v1kind:ConfigMapmetadata:namespace:gmp-testname:prometheus-testlabels:prometheus:testdata:config.yaml:|global:scrape_interval: 30sscrape_configs:# Let Prometheus scrape itself.- job_name: prometheusstatic_configs:- targets: ['localhost:9090']# Scrape pods with label app=prom-example across all namespaces# on the port named 'metrics'.- job_name: prom-examplekubernetes_sd_configs:- role: podrelabel_configs:- source_labels: [__meta_kubernetes_pod_label_app, __meta_kubernetes_pod_label_app_kubernetes_io_name]regex: (prom-example.*);.*|.*;(prom-example.*)action: keep- source_labels: [__meta_kubernetes_namespace]target_label: namespace- source_labels: [__meta_kubernetes_pod_name, __meta_kubernetes_pod_container_port_name]regex: (.+);(.+)target_label: instancereplacement: $1:$2action: replace- source_labels: [__meta_kubernetes_pod_container_port_name]regex: metricsaction: keepfrontend.yaml
# Copyright 2022 Google LLC## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## https://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.apiVersion:apps/v1kind:Deploymentmetadata:name:frontendspec:replicas:2selector:matchLabels:app:frontendtemplate:metadata:labels:app:frontendspec:automountServiceAccountToken:trueaffinity:nodeAffinity:requiredDuringSchedulingIgnoredDuringExecution:nodeSelectorTerms:-matchExpressions:-key:kubernetes.io/archoperator:Invalues:-arm64-amd64-key:kubernetes.io/osoperator:Invalues:-linuxcontainers:-name:frontendimage:gke.gcr.io/prometheus-engine/frontend:v0.15.3-gke.0args:-"--web.listen-address=:9090"-"--query.project-id=$PROJECT_ID"ports:-name:webcontainerPort:9090readinessProbe:httpGet:path:/-/readyport:websecurityContext:allowPrivilegeEscalation:falsecapabilities:drop:-allprivileged:falserunAsGroup:1000runAsNonRoot:truerunAsUser:1000livenessProbe:httpGet:path:/-/healthyport:web---apiVersion:v1kind:Servicemetadata:name:frontendspec:clusterIP:Noneselector:app:frontendports:-name:webport:9090grafana.yaml
# Copyright 2022 Google LLC## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## https://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.apiVersion:apps/v1kind:Deploymentmetadata:name:grafanaspec:replicas:1selector:matchLabels:app:grafanatemplate:metadata:labels:app:grafanaspec:affinity:nodeAffinity:requiredDuringSchedulingIgnoredDuringExecution:nodeSelectorTerms:-matchExpressions:-key:kubernetes.io/archoperator:Invalues:-arm64-amd64-key:kubernetes.io/osoperator:Invalues:-linuxcontainers:-name:grafanaimage:grafana/grafana:10.2.4ports:-name:webcontainerPort:3000---apiVersion:v1kind:Servicemetadata:name:grafanaspec:clusterIP:Noneselector:app:grafanaports:-name:webport:3000datasource-syncer.yaml
# Copyright 2026 Google LLC## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.---# Source: datasource-syncer/templates/job.yamlapiVersion:batch/v1kind:Jobmetadata:name:datasource-syncer-initspec:ttlSecondsAfterFinished:60template:metadata:labels:app:datasource-syncer-initspec:affinity:nodeAffinity:requiredDuringSchedulingIgnoredDuringExecution:nodeSelectorTerms:-matchExpressions:-key:kubernetes.io/archoperator:Invalues:-arm64-amd64-key:kubernetes.io/osoperator:Invalues:-linuxcontainers:-name:datasource-syncer-initimage:gke.gcr.io/prometheus-engine/datasource-syncer:v0.17.2-gke.2args:-"--datasource-uids=$DATASOURCE_UIDS"-"--grafana-api-endpoint=$GRAFANA_API_ENDPOINT"-"--grafana-api-token=$GRAFANA_API_TOKEN"-"--project-id=$PROJECT_ID"restartPolicy:Never---# Source: datasource-syncer/templates/cronjob.yamlapiVersion:batch/v1kind:CronJobmetadata:name:datasource-syncerspec:schedule:"*/10****"# Run once every 10 minutes, must run at least once an hour.jobTemplate:spec:template:metadata:labels:app:datasource-syncerspec:affinity:nodeAffinity:requiredDuringSchedulingIgnoredDuringExecution:nodeSelectorTerms:-matchExpressions:-key:kubernetes.io/archoperator:Invalues:-arm64-amd64-key:kubernetes.io/osoperator:Invalues:-linuxcontainers:-name:datasource-syncerimage:gke.gcr.io/prometheus-engine/datasource-syncer:v0.17.2-gke.2args:-"--datasource-uids=$DATASOURCE_UIDS"-"--grafana-api-endpoint=$GRAFANA_API_ENDPOINT"-"--grafana-api-token=$GRAFANA_API_TOKEN"-"--project-id=$PROJECT_ID"restartPolicy:Neverrule-evaluator.yaml
# Copyright 2026 Google LLC## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.---# Source: rule-evaluator/templates/serviceaccount.yamlapiVersion:v1kind:ServiceAccountmetadata:name:rule-evaluator---# Source: rule-evaluator/templates/configmaps.yamlapiVersion:v1kind:ConfigMapmetadata:name:rule-evaluatorlabels:app.kubernetes.io/name:rule-evaluatordata:config.yaml:|global:external_labels: {}evaluation_interval: 60srule_files:- "/etc/rules/*.yaml"---# Source: rule-evaluator/templates/configmaps.yamlapiVersion:v1kind:ConfigMapmetadata:name:ruleslabels:app.kubernetes.io/name:rule-evaluatordata:rules.yaml:|groups:- name: exampleinterval: 10srules:- record: job:up:sumexpr: sum without(instance) (up)- alert: AlwaysFiringexpr: vector(1)---# Source: rule-evaluator/templates/role.yamlapiVersion:rbac.authorization.k8s.io/v1kind:ClusterRolemetadata:name:rule-evaluatorrules:-resources:-endpoints-nodes-nodes/metrics-pods-servicesapiGroups:[""]verbs:["get","list","watch"]-resources:-configmapsapiGroups:[""]verbs:["get"]-nonResourceURLs:["/metrics"]verbs:["get"]---# Source: rule-evaluator/templates/rolebinding.yamlapiVersion:rbac.authorization.k8s.io/v1kind:ClusterRoleBindingmetadata:name:rule-evaluatorroleRef:name:rule-evaluatorkind:ClusterRoleapiGroup:rbac.authorization.k8s.iosubjects:-name:rule-evaluatornamespace:defaultkind:ServiceAccount---# Source: rule-evaluator/templates/service.yamlapiVersion:v1kind:Servicemetadata:name:rule-evaluatorlabels:app.kubernetes.io/name:rule-evaluatorspec:selector:app.kubernetes.io/name:rule-evaluatorports:-name:rule-evaluatorport:9092targetPort:9092---# Source: rule-evaluator/templates/deployment.yamlapiVersion:apps/v1kind:Deploymentmetadata:name:rule-evaluatorlabels:app.kubernetes.io/name:rule-evaluatorspec:selector:matchLabels:app.kubernetes.io/name:rule-evaluatortemplate:metadata:labels:app.kubernetes.io/name:rule-evaluatorapp.kubernetes.io/version:0.17.2spec:serviceAccountName:rule-evaluatorautomountServiceAccountToken:trueinitContainers:-name:config-initimage:gke.gcr.io/gke-distroless/bash:gke_distroless_20251107.00_p0command:['/bin/bash','-c','touch/prometheus/config_out/config.yaml']volumeMounts:-name:config-outmountPath:/prometheus/config_outcontainers:-name:evaluatorimage:gke.gcr.io/prometheus-engine/rule-evaluator:v0.17.2-gke.2args:-"--config.file=/prometheus/config_out/config.yaml"-"--web.listen-address=:9092"ports:-name:r-eval-metricscontainerPort:9092resources:limits:memory:1Grequests:cpu:1mmemory:16MvolumeMounts:-name:config-outreadOnly:truemountPath:/prometheus/config_out-name:rules-outreadOnly:truemountPath:/etc/ruleslivenessProbe:httpGet:port:r-eval-metricspath:/-/healthyreadinessProbe:httpGet:port:r-eval-metricspath:/-/ready# Readiness attempts a query round-trip so we need a more generous timeout.timeoutSeconds:5securityContext:allowPrivilegeEscalation:falsecapabilities:drop:-allprivileged:falsereadOnlyRootFilesystem:true-name:config-reloaderimage:gke.gcr.io/prometheus-engine/config-reloader:v0.17.2-gke.2args:---config-file=/prometheus/config/config.yaml---config-file-output=/prometheus/config_out/config.yaml---config-dir=/etc/rules---config-dir-output=/prometheus/rules_out---reload-url=http://127.0.0.1:9092/-/reload---ready-url=http://127.0.0.1:9092/-/ready---listen-address=:9093ports:-name:cfg-rel-metricsprotocol:TCPcontainerPort:9093resources:limits:memory:32Mrequests:cpu:1mmemory:4MvolumeMounts:-name:configreadOnly:truemountPath:/prometheus/config-name:config-outmountPath:/prometheus/config_out-name:rulesreadOnly:truemountPath:/etc/rules-name:rules-outmountPath:/prometheus/rules_outsecurityContext:allowPrivilegeEscalation:falsecapabilities:drop:-allprivileged:falsereadOnlyRootFilesystem:truevolumes:-name:configconfigMap:name:rule-evaluator-name:config-outemptyDir:{}-name:rulesconfigMap:name:rules-name:rules-outemptyDir:{}affinity:nodeAffinity:requiredDuringSchedulingIgnoredDuringExecution:nodeSelectorTerms:-matchExpressions:-key:kubernetes.io/archoperator:Invalues:-arm64-amd64-key:kubernetes.io/osoperator:Invalues:-linuxtolerations:-key:"components.gke.io/gke-managed-components"operator:"Exists"-value:"amd64"effect:"NoSchedule"key:"kubernetes.io/arch"operator:"Equal"-value:"arm64"effect:"NoSchedule"key:"kubernetes.io/arch"operator:"Equal"securityContext:runAsGroup:1000runAsNonRoot:truerunAsUser:1000seccompProfile:type:RuntimeDefaultrules.yaml
# Copyright 2022 Google LLC## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## https://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.apiVersion:monitoring.googleapis.com/v1kind:Rulesmetadata:name:example-ruleslabels:app.kubernetes.io/name:example-rulesapp.kubernetes.io/part-of:google-cloud-managed-prometheusspec:groups:-name:exampleinterval:30srules:-record:job:up:sumexpr:sum without(instance) (up)-alert:AlwaysFiringexpr:vector(1)delete_metric_descriptors.go
// Copyright 2024 Google LLC//// Licensed under the Apache License, Version 2.0 (the "License");// you may not use this file except in compliance with the License.// You may obtain a copy of the License at//// http://www.apache.org/licenses/LICENSE-2.0//// Unless required by applicable law or agreed to in writing, software// distributed under the License is distributed on an "AS IS" BASIS,// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.// See the License for the specific language governing permissions and// limitations under the License.packagemainimport("bufio""context""errors""flag""fmt""log""os""regexp""strings""time""unicode"monitoring"cloud.google.com/go/monitoring/apiv3/v2""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb""google.golang.org/api/iterator""google.golang.org/api/option")/*This script deletes metric descriptors from the given projects (-projects flag),matching the given metric type (descriptor name) regex expression (-metric_type_regex flag).Metrics to delete will be first printed and then awaiting interactive confirmation,before the actual removal. Dry run option also exists.WARNING: All underlying time series behind each descriptor (potentially yearsof data) will be irreversibly removed once confirmed.Example run:1. Setup Application Default Credentials (ADC) (https://cloud.google.com/docs/authentication/provide-credentials-adc)if you haven't yet:1a. Make sure the account behind the ADC for chosen projects has Monitoring Editor or Monitoring Admin permissions: https://cloud.google.com/monitoring/access-control#monitoring-perms 1b. Acquire Application Default Credentials in your environment using gcloud:gcloud auth application-default login2. Run Go script (from the same directory as the script):go run delete_metric_descriptors.go -projects projects/<your-project> -metric_type_regex "<your matching expression>"See go run delete_metric_descriptors.go -help for all options.*/var(cloudMonitoringEndpoint=flag.String("address","monitoring.googleapis.com:443","address of monitoring API")projectNames=flag.String("projects","","required: comma-separated project IDs of the projects on which to execute the requests. Name format is as defined in https://cloud.google.com/monitoring/api/ref_v3/rpc/google.monitoring.v3#listmetricdescriptorsrequesttarget, e.g. projects/test-project,projects/test-project2")metricTypeRegex=flag.String("metric_type_regex","","required: RE2 regex expression matching metric.type (anchored), so metric descriptor names to delete. Guarded with the interactive 'y' confirmation. See --dry_run to only print those")dryRun=flag.Bool("dry_run",false,"whether to dry run or not")serviceAccountEnvVar=flag.String("sa-envvar","","optional environment variable containing Google Service Account JSON, without it application-default flow will be used."))funcdeleteDescriptors(endpointstring,projects[]string,re*regexp.Regexp,saEnvVarstring,dryRunbool)error{ctx:=context.Background()// Recommended way is to use auth from your environment. Use `gcloud auth application-default login` to set it up.client,err:=monitoring.NewMetricClient(ctx,func()[]option.ClientOption{// Optional, service account JSON in environment variable.ifsaEnvVar!=""{return[]option.ClientOption{option.WithEndpoint(endpoint),option.WithCredentialsJSON([]byte(os.Getenv(saEnvVar))),}}return[]option.ClientOption{option.WithEndpoint(endpoint)}}()...)iferr!=nil{returnfmt.Errorf("failed to build client for %s: %w",endpoint,err)}deferclient.Close()// Find descriptors to delete.descsToDelete:=map[string][]string{}toDelete:=0checked:=0for_,p:=rangeprojects{it:=client.ListMetricDescriptors(ctx,&monitoringpb.ListMetricDescriptorsRequest{Name:p})for{resp,err:=it.Next()iferrors.Is(err,iterator.Done){break}iferr!=nil{returnfmt.Errorf("ListMetricDescriptors iteration: %w",err)}checked++if!re.MatchString(resp.Type){continue}descsToDelete[p]=append(descsToDelete[p],resp.Type)toDelete++}}// Print and perform interactive safety check.{forp,descs:=rangedescsToDelete{fmt.Println()fmt.Printf("For project %v:\n",p)fmt.Println(descs)}fmt.Printf("After checking %v descriptors, found %v to delete across %v project(s)\n",checked,toDelete,len(projects))fmt.Println()}iftoDelete==0{fmt.Println("nothing to do, job done!")returnnil}ifdryRun{fmt.Println("-dry_run selected, job done!")returnnil}if!confirmDelete(){fmt.Println("Deletion not confirmed, exiting")returnnil}// Delete.deleted:=0forp,descs:=rangedescsToDelete{for_,d:=rangedescs{iferr:=client.DeleteMetricDescriptor(ctx,&monitoringpb.DeleteMetricDescriptorRequest{Name:fmt.Sprintf("%s/metricDescriptors/%s",p,d),});err!=nil{returnfmt.Errorf("DeleteMetricDescriptor delete: %w",err)}deleted++fmt.Printf("%s deleted\n",d)ifdeleted%1000==0{fmt.Println("Sleeping 1 second to avoid quota issues...")time.Sleep(1*time.Second)}}}fmt.Printf("Deleted %v descriptors, job done!\n",deleted)returnnil}funcconfirmDelete()bool{fmt.Printf("Are you sure you want to delete the above metric descriptors?\n"+"WARNING: All underlying time series (potentially years of data) will be irreversibly removed! (y/N): ")r,_,err:=bufio.NewReader(os.Stdin).ReadRune()iferr!=nil{log.Fatalln(err)}switchunicode.ToLower(r){case'y':returntruedefault:returnfalse}}funcmain(){flag.Parse()if*projectNames==""{fmt.Println("-projects flag is required")flag.Usage()os.Exit(1)}if*metricTypeRegex==""{fmt.Println("-metric_type_regex flag is required")flag.Usage()os.Exit(1)}// Anchor it to avoid further surprises.reExpr:=fmt.Sprintf("^%s$",*metricTypeRegex)re,err:=regexp.Compile(reExpr)iferr!=nil{log.Fatalf("error while compiling RE2 %v expression: %v",*metricTypeRegex,err)}// Run command.iferr:=deleteDescriptors(*cloudMonitoringEndpoint,strings.Split(*projectNames,","),re,*serviceAccountEnvVar,*dryRun,);err!=nil{log.Fatalf("command failed: %v",err)}}Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-19 UTC.