title | description | lead | date | draft | images | menu | weight | toc | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
API |
Generated API docs for the GMP CRDs |
2021-03-08 08:49:31 +0000 |
false |
|
1000 |
true |
This Document documents the types introduced by the GMP CRDs to be consumed by users.
Note this document is generated from code comments. When contributing a change to this document please do so by changing the code comments.
- AlertingSpec
- AlertmanagerEndpoints
- Authorization
- ClusterPodMonitoring
- ClusterPodMonitoringList
- ClusterPodMonitoringSpec
- ClusterRules
- ClusterRulesList
- CollectionSpec
- ExportFilters
- GlobalRules
- GlobalRulesList
- LabelMapping
- MonitoringCondition
- OperatorConfig
- OperatorConfigList
- PodMonitoring
- PodMonitoringList
- PodMonitoringSpec
- PodMonitoringStatus
- RelabelingRule
- Rule
- RuleEvaluatorSpec
- RuleGroup
- Rules
- RulesList
- RulesSpec
- ScrapeEndpoint
- ScrapeLimits
- SecretOrConfigMap
- TLSConfig
- TargetLabels
AlertingSpec defines alerting configuration.
appears in: RuleEvaluatorSpec
Field | Description | Scheme | Required |
---|---|---|---|
alertmanagers | Alertmanagers contains endpoint configuration for designated Alertmanagers. | []AlertmanagerEndpoints | false |
AlertmanagerEndpoints defines a selection of a single Endpoints object containing alertmanager IPs to fire alerts against.
appears in: AlertingSpec
Field | Description | Scheme | Required |
---|---|---|---|
namespace | Namespace of Endpoints object. | string | true |
name | Name of Endpoints object in Namespace. | string | true |
port | Port the Alertmanager API is exposed on. | intstr.IntOrString | true |
scheme | Scheme to use when firing alerts. | string | false |
pathPrefix | Prefix for the HTTP path alerts are pushed to. | string | false |
tls | TLS Config to use for alertmanager connection. | *TLSConfig | false |
authorization | Authorization section for this alertmanager endpoint | *Authorization | false |
apiVersion | Version of the Alertmanager API that rule-evaluator uses to send alerts. It can be "v1" or "v2". | string | false |
timeout | Timeout is a per-target Alertmanager timeout when pushing alerts. | string | false |
Authorization specifies a subset of the Authorization struct, that is safe for use in Endpoints (no CredentialsFile field).
appears in: AlertmanagerEndpoints
Field | Description | Scheme | Required |
---|---|---|---|
type | Set the authentication type. Defaults to Bearer, Basic will cause an error | string | false |
credentials | The secret's key that contains the credentials of the request | *v1.SecretKeySelector | false |
ClusterPodMonitoring defines monitoring for a set of pods.
appears in: ClusterPodMonitoringList
Field | Description | Scheme | Required |
---|---|---|---|
metadata | metav1.ObjectMeta | false | |
spec | Specification of desired Pod selection for target discovery by Prometheus. | ClusterPodMonitoringSpec | true |
status | Most recently observed status of the resource. | PodMonitoringStatus | true |
ClusterPodMonitoringList is a list of ClusterPodMonitorings.
Field | Description | Scheme | Required |
---|---|---|---|
metadata | metav1.ListMeta | false | |
items | []ClusterPodMonitoring | true |
ClusterPodMonitoringSpec contains specification parameters for PodMonitoring.
appears in: ClusterPodMonitoring
Field | Description | Scheme | Required |
---|---|---|---|
selector | Label selector that specifies which pods are selected for this monitoring configuration. | metav1.LabelSelector | true |
endpoints | The endpoints to scrape on the selected pods. | []ScrapeEndpoint | true |
targetLabels | Labels to add to the Prometheus target for discovered endpoints | TargetLabels | false |
limits | Limits to apply at scrape time. | *ScrapeLimits | false |
ClusterRules defines Prometheus alerting and recording rules that are scoped to the current cluster. Only metric data from the current cluster is processed and all rule results have their project_id and cluster label preserved for query processing. If the location label is not preserved by the rule, it defaults to the cluster's location.
appears in: ClusterRulesList
Field | Description | Scheme | Required |
---|---|---|---|
metadata | metav1.ObjectMeta | false | |
spec | Specification of rules to record and alert on. | RulesSpec | true |
status | Most recently observed status of the resource. | RulesStatus | true |
ClusterRulesList is a list of ClusterRules.
Field | Description | Scheme | Required |
---|---|---|---|
metadata | metav1.ListMeta | false | |
items | []ClusterRules | true |
CollectionSpec specifies how the operator configures collection of metric data.
appears in: OperatorConfig
Field | Description | Scheme | Required |
---|---|---|---|
externalLabels | ExternalLabels specifies external labels that are attached to all scraped data before being written to Cloud Monitoring. The precedence behavior matches that of Prometheus. | map[string]string | false |
filter | Filter limits which metric data is sent to Cloud Monitoring. | ExportFilters | false |
credentials | A reference to GCP service account credentials with which Prometheus collectors are run. It needs to have metric write permissions for all project IDs to which data is written. Within GKE, this can typically be left empty if the compute default service account has the required permissions. | *v1.SecretKeySelector | false |
ExportFilters provides mechanisms to filter the scraped data that's sent to GMP.
appears in: CollectionSpec
Field | Description | Scheme | Required |
---|---|---|---|
matchOneOf | A list Prometheus time series matchers. Every time series must match at least one of the matchers to be exported. This field can be used equivalently to the match[] parameter of the Prometheus federation endpoint to selectively export data.\n\nExample: [\"{job='prometheus'}\", \"{__name__=~'job:.*'}\"] |
[]string | false |
GlobalRules defines Prometheus alerting and recording rules that are scoped to all data in the queried project. If the project_id or location labels are not preserved by the rule, they default to the values of the cluster.
appears in: GlobalRulesList
Field | Description | Scheme | Required |
---|---|---|---|
metadata | metav1.ObjectMeta | false | |
spec | Specification of rules to record and alert on. | RulesSpec | true |
status | Most recently observed status of the resource. | RulesStatus | true |
GlobalRulesList is a list of GlobalRules.
Field | Description | Scheme | Required |
---|---|---|---|
metadata | metav1.ListMeta | false | |
items | []GlobalRules | true |
LabelMapping specifies how to transfer a label from a Kubernetes resource onto a Prometheus target.
appears in: TargetLabels
Field | Description | Scheme | Required |
---|---|---|---|
from | Kubenetes resource label to remap. | string | true |
to | Remapped Prometheus target label. Defaults to the same name as From . |
string | false |
MonitoringCondition describes a condition of a PodMonitoring.
appears in: PodMonitoringStatus
Field | Description | Scheme | Required |
---|---|---|---|
type | MonitoringConditionType | true | |
status | Status of the condition, one of True, False, Unknown. | corev1.ConditionStatus | true |
lastUpdateTime | The last time this condition was updated. | metav1.Time | false |
lastTransitionTime | Last time the condition transitioned from one status to another. | metav1.Time | false |
reason | The reason for the condition's last transition. | string | false |
message | A human-readable message indicating details about the transition. | string | false |
OperatorConfig defines configuration of the gmp-operator.
appears in: OperatorConfigList
Field | Description | Scheme | Required |
---|---|---|---|
metadata | metav1.ObjectMeta | false | |
rules | Rules specifies how the operator configures and deployes rule-evaluator. | RuleEvaluatorSpec | false |
collection | Collection specifies how the operator configures collection. | CollectionSpec | false |
OperatorConfigList is a list of OperatorConfigs.
Field | Description | Scheme | Required |
---|---|---|---|
metadata | metav1.ListMeta | false | |
items | []OperatorConfig | true |
PodMonitoring defines monitoring for a set of pods.
appears in: PodMonitoringList
Field | Description | Scheme | Required |
---|---|---|---|
metadata | metav1.ObjectMeta | false | |
spec | Specification of desired Pod selection for target discovery by Prometheus. | PodMonitoringSpec | true |
status | Most recently observed status of the resource. | PodMonitoringStatus | true |
PodMonitoringList is a list of PodMonitorings.
Field | Description | Scheme | Required |
---|---|---|---|
metadata | metav1.ListMeta | false | |
items | []PodMonitoring | true |
PodMonitoringSpec contains specification parameters for PodMonitoring.
appears in: PodMonitoring
Field | Description | Scheme | Required |
---|---|---|---|
selector | Label selector that specifies which pods are selected for this monitoring configuration. | metav1.LabelSelector | true |
endpoints | The endpoints to scrape on the selected pods. | []ScrapeEndpoint | true |
targetLabels | Labels to add to the Prometheus target for discovered endpoints. | TargetLabels | false |
limits | Limits to apply at scrape time. | *ScrapeLimits | false |
PodMonitoringStatus holds status information of a PodMonitoring resource.
appears in: ClusterPodMonitoring, PodMonitoring
Field | Description | Scheme | Required |
---|---|---|---|
observedGeneration | The generation observed by the controller. | int64 | true |
conditions | Represents the latest available observations of a podmonitor's current state. | []MonitoringCondition | false |
RelabelingRule defines a single Prometheus relabeling rule.
appears in: ScrapeEndpoint
Field | Description | Scheme | Required |
---|---|---|---|
sourceLabels | The source labels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the replace, keep, and drop actions. | []string | false |
separator | Separator placed between concatenated source label values. Defaults to ';'. | string | false |
targetLabel | Label to which the resulting value is written in a replace action. It is mandatory for replace actions. Regex capture groups are available. | string | false |
regex | Regular expression against which the extracted value is matched. Defaults to '(.*)'. | string | false |
modulus | Modulus to take of the hash of the source label values. | uint64 | false |
replacement | Replacement value against which a regex replace is performed if the regular expression matches. Regex capture groups are available. Defaults to '$1'. | string | false |
action | Action to perform based on regex matching. Defaults to 'replace'. | string | false |
Rule is a single rule in the Prometheus format: https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/
appears in: RuleGroup
Field | Description | Scheme | Required |
---|---|---|---|
record | Record the result of the expression to this metric name. Only one of record and alert must be set. |
string | false |
alert | Name of the alert to evaluate the expression as. Only one of record and alert must be set. |
string | false |
expr | The PromQL expression to evaluate. | string | true |
for | The duration to wait before a firing alert produced by this rule is sent to Alertmanager. Only valid if alert is set. |
string | false |
labels | A set of labels to attach to the result of the query expression. | map[string]string | false |
annotations | A set of annotations to attach to alerts produced by the query expression. Only valid if alert is set. |
map[string]string | false |
RuleEvaluatorSpec defines configuration for deploying rule-evaluator.
appears in: OperatorConfig
Field | Description | Scheme | Required |
---|---|---|---|
externalLabels | ExternalLabels specifies external labels that are attached to any rule results and alerts produced by rules. The precedence behavior matches that of Prometheus. | map[string]string | false |
queryProjectID | QueryProjectID is the GCP project ID to evaluate rules against. If left blank, the rule-evaluator will try attempt to infer the Project ID from the environment. | string | false |
alerting | Alerting contains how the rule-evaluator configures alerting. | AlertingSpec | false |
credentials | A reference to GCP service account credentials with which the rule evaluator container is run. It needs to have metric read permissions against queryProjectId and metric write permissions against all projects to which rule results are written. Within GKE, this can typically be left empty if the compute default service account has the required permissions. | *v1.SecretKeySelector | false |
RuleGroup declares rules in the Prometheus format: https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/
appears in: RulesSpec
Field | Description | Scheme | Required |
---|---|---|---|
name | The name of the rule group. | string | true |
interval | The interval at which to evaluate the rules. Must be a valid Prometheus duration. | string | true |
rules | A list of rules that are executed sequentially as part of this group. | []Rule | true |
Rules defines Prometheus alerting and recording rules that are scoped to the namespace of the resource. Only metric data from this namespace is processed and all rule results have their project_id, cluster, and namespace label preserved for query processing. If the location label is not preserved by the rule, it defaults to the cluster's location.
appears in: RulesList
Field | Description | Scheme | Required |
---|---|---|---|
metadata | metav1.ObjectMeta | false | |
spec | Specification of rules to record and alert on. | RulesSpec | true |
status | Most recently observed status of the resource. | RulesStatus | true |
RulesList is a list of Rules.
Field | Description | Scheme | Required |
---|---|---|---|
metadata | metav1.ListMeta | false | |
items | []Rules | true |
RulesSpec contains specification parameters for a Rules resource.
appears in: ClusterRules, GlobalRules, Rules
Field | Description | Scheme | Required |
---|---|---|---|
groups | A list of Prometheus rule groups. | []RuleGroup | true |
ScrapeEndpoint specifies a Prometheus metrics endpoint to scrape.
appears in: ClusterPodMonitoringSpec, PodMonitoringSpec
Field | Description | Scheme | Required |
---|---|---|---|
port | Name or number of the port to scrape. | intstr.IntOrString | false |
scheme | Protocol scheme to use to scrape. | string | false |
path | HTTP path to scrape metrics from. Defaults to "/metrics". | string | false |
params | HTTP GET params to use when scraping. | map[string][]string | false |
proxyUrl | Proxy URL to scrape through. Encoded passwords are not supported. | string | false |
interval | Interval at which to scrape metrics. Must be a valid Prometheus duration. | string | false |
timeout | Timeout for metrics scrapes. Must be a valid Prometheus duration. Must not be larger then the scrape interval. | string | false |
metricRelabeling | Relabeling rules for metrics scraped from this endpoint. Relabeling rules that override protected target labels (project_id, location, cluster, namespace, job, instance, or address) are not permitted. The labelmap action is not permitted in general. | []RelabelingRule | false |
ScrapeLimits limits applied to scraped targets.
appears in: ClusterPodMonitoringSpec, PodMonitoringSpec
Field | Description | Scheme | Required |
---|---|---|---|
samples | Maximum number of samples accepted within a single scrape. Uses Prometheus default if left unspecified. | uint64 | false |
labels | Maximum number of labels accepted for a single sample. Uses Prometheus default if left unspecified. | uint64 | false |
labelNameLength | Maximum label name length. Uses Prometheus default if left unspecified. | uint64 | false |
labelValueLength | Maximum label value length. Uses Prometheus default if left unspecified. | uint64 | false |
SecretOrConfigMap allows to specify data as a Secret or ConfigMap. Fields are mutually exclusive. Taking inspiration from prometheus-operator: https://github.com/prometheus-operator/prometheus-operator/blob/2c81b0cf6a5673e08057499a08ddce396b19dda4/Documentation/api.md#secretorconfigmap
appears in: TLSConfig
Field | Description | Scheme | Required |
---|---|---|---|
secret | Secret containing data to use for the targets. | *v1.SecretKeySelector | false |
configMap | ConfigMap containing data to use for the targets. | *v1.ConfigMapKeySelector | false |
SafeTLSConfig specifies TLS configuration parameters from Kubernetes resources.
appears in: AlertmanagerEndpoints
Field | Description | Scheme | Required |
---|---|---|---|
ca | Struct containing the CA cert to use for the targets. | *SecretOrConfigMap | false |
cert | Struct containing the client cert file for the targets. | *SecretOrConfigMap | false |
keySecret | Secret containing the client key file for the targets. | *v1.SecretKeySelector | false |
serverName | Used to verify the hostname for the targets. | string | false |
insecureSkipVerify | Disable target certificate validation. | bool | false |
TargetLabels configures labels for the discovered Prometheus targets.
appears in: ClusterPodMonitoringSpec, PodMonitoringSpec
Field | Description | Scheme | Required |
---|---|---|---|
fromPod | Labels to transfer from the Kubernetes Pod to Prometheus target labels. In the case of a label mapping conflict: - Mappings at the end of the array take precedence. | []LabelMapping | false |