## monitoring.gdc.goog/v1

Contains API Schema definitions for the Monitoring group.

### AlertRule

Defines the alert rules configuration.

*Appears in:*
- [MonitoringRuleSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringrulespec)

| Field | Description |
|---|---|
| `alert` *string* | The alert name. Its value must be a valid label value. |
| `expr` *string* | The PromQL or LogQL expression to evaluate the alert rule. |
| `for` *string* | The duration in seconds over which the specified condition must be met to move the alert from the pending state to the open state. |
| `labels` *object (keys:string, values:string)* | The labels to add or overwrite. The required labels in this field are `severity: [error, critical, warning, info]`, `code: <short code for the error>`, and `resource: <component, service, or hardware related to the alert>`. Any additional labels are optional. |
| `annotations` *object (keys:string, values:string)* | The annotations to add. |

### ClusterStatus

ClusterStatus is a list of conditions affecting a specific cluster.

*Appears in:*
- [MonitoringTargetStatus](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringtargetstatus)

| Field | Description |
|---|---|
| `cluster` *string* |   |
| `conditions` *[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#condition-v1-meta) array* |   |

### MonitoringRule

Defines the Schema for the Monitoring Rules API.

*Appears in:*
- [MonitoringRuleList](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringrulelist)

| Field | Description |
|---|---|
| `apiVersion` *string* | `monitoring.gdc.goog/v1` |
| `kind` *string* | `MonitoringRule` |
| `metadata` *[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#objectmeta-v1-meta)* | Refer to Kubernetes API documentation for fields of `metadata`. |
| `spec` *[MonitoringRuleSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringrulespec)* |   |
| `status` *[MonitoringRuleStatus](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringrulestatus)* |   |

### MonitoringRuleList

Contains a list of monitoring rules.

| Field | Description |
|---|---|
| `apiVersion` *string* | `monitoring.gdc.goog/v1` |
| `kind` *string* | `MonitoringRuleList` |
| `metadata` *[ListMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#listmeta-v1-meta)* | Refer to Kubernetes API documentation for fields of `metadata`. |
| `items` *[MonitoringRule](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringrule) array* |   |

### MonitoringRuleSpec

Defines the specification or expected state of the `MonitoringRule` object.

*Appears in:*
- [MonitoringRule](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringrule)

| Field | Description |
|---|---|
| `interval` *string* | The rule evaluation interval. |
| `limit` *integer* | The limit number of alerts. A value of `0` means no limit. |
| `recordRules` *[RecordRule](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#recordrule) array* | The list of record rules. |
| `alertRules` *[AlertRule](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#alertrule) array* | The list of alert rules. |

### MonitoringRuleStatus

Defines the observed state of the `MonitoringRule` object.

*Appears in:*
- [MonitoringRule](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringrule)

| Field | Description |
|---|---|
| `conditions` *[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#condition-v1-meta) array* | Defines the observed state of the `MonitoringRule` object. |
| `errorStatus` *ErrorStatus* | ErrorStatus contains a list of current errors and the timestamp this field gets updated. |

### MonitoringTarget

Defines the Schema for the monitoring targets API.

*Appears in:*
- [MonitoringTargetList](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringtargetlist)

| Field | Description |
|---|---|
| `apiVersion` *string* | `monitoring.gdc.goog/v1` |
| `kind` *string* | `MonitoringTarget` |
| `metadata` *[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#objectmeta-v1-meta)* | Refer to Kubernetes API documentation for fields of `metadata`. |
| `spec` *[MonitoringTargetSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringtargetspec)* |   |
| `status` *[MonitoringTargetStatus](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringtargetstatus)* |   |

### MonitoringTargetList

Contains a list of monitoring targets.

| Field | Description |
|---|---|
| `apiVersion` *string* | `monitoring.gdc.goog/v1` |
| `kind` *string* | `MonitoringTargetList` |
| `metadata` *[ListMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#listmeta-v1-meta)* | Refer to Kubernetes API documentation for fields of `metadata`. |
| `items` *[MonitoringTarget](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringtarget) array* |   |

### MonitoringTargetMetricsRelabeling

Defines a filter for keeping or discarding metrics based on labels.

*Appears in:*
- [MonitoringTargetPodMetricsEndpoints](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringtargetpodmetricsendpoints)

| Field | Description |
|---|---|
| `sourceLabels` *string array* | The selected values from existing labels. The content is concatenated using the `separator` and matched against the `regex` expression for the `replace`, `keep`, and `drop` actions. |
| `separator` *string* | The separator value placed between concatenated source label values. |
| `regex` *string* | The regular expression to match the extracted value. |
| `action` *string* | The action to perform when the `regex` expression matches the extracted value. |
| `targetLabel` *string* | The label to which to write the resulting value in a `replace` action. This field is mandatory for `replace` actions. Capture groups of regular expressions are available. |
| `replacement` *string* | The replacement value to use if the regular expression matches the extracted value in a `replace` action. Capture groups of regular expressions are available. |

### MonitoringTargetPodMetricsEndpoints

Configures the metric endpoints for scraped pods.

*Appears in:*
- [MonitoringTargetSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringtargetspec)

| Field | Description |
|---|---|
| `port` *[MonitoringTargetPodMetricsPort](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringtargetpodmetricsport)* | The port from which metrics are scraped. |
| `path` *[MonitoringTargetPodMetricsPath](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringtargetpodmetricspath)* | The path from which metrics are scraped. |
| `scheme` *[MonitoringTargetPodMetricsScheme](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringtargetpodmetricsscheme)* | The scheme to use when scraping metrics. |
| `params` *object (keys:string, values:string array)* | The query parameters to use when scraping metrics from the `path`. |
| `scrapeInterval` *string* | The frequency for Prometheus to scrape the metric endpoints defined in the `podMetricsEndpoints` field. |
| `scrapeTimeout` *string* | The time for Prometheus to wait for the response from the metric endpoints defined in the `podMetricsEndpoints` field. |
| `metricsRelabelings` *[MonitoringTargetMetricsRelabeling](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringtargetmetricsrelabeling) array* | The filter for either including (`allowlist`) or excluding (`denylist`) metrics based on labels. |
| `ipAddresses` *string array* | IPAddress is for configuring static IP addresses to scrape. |
| `tlsConfig` *[TLSConfig](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#tlsconfig)* | Provide a custom TLS configuration. This is provided for workloads outside of kubernetes that need to be scraped. |
| `authCredential` *string* | Credentials to provide to the scrape endpoint. |

### MonitoringTargetPodMetricsPath

Determines the path to use for scraping metrics from pods.

*Appears in:*
- [MonitoringTargetPodMetricsEndpoints](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringtargetpodmetricsendpoints)

| Field | Description |
|---|---|
| `value` *string* | The path to collect metrics from. If annotations are provided, they take priority over this field. |
| `annotation` *string* | The path to collect metrics from using annotations. |

### MonitoringTargetPodMetricsPort

Determines the port to use for scraping metrics from pods.

*Appears in:*
- [MonitoringTargetPodMetricsEndpoints](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringtargetpodmetricsendpoints)

| Field | Description |
|---|---|
| `value` *integer* | The port to collect metrics from. If annotations are provided, they take priority over this field. |
| `annotation` *string* | The port to collect metrics from using annotations. |

### MonitoringTargetPodMetricsScheme

Determines the scheme to use for scraping metrics from pods.

*Appears in:*
- [MonitoringTargetPodMetricsEndpoints](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringtargetpodmetricsendpoints)

| Field | Description |
|---|---|
| `value` *string* | The scheme to use when collecting metrics. If annotations are provided, they take priority over this field. |
| `annotation` *string* | The scheme to use when collecting metrics using annotations. |

### MonitoringTargetSelectors

Provides selectors that determine which pods to monitor.

*Appears in:*
- [MonitoringTargetSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringtargetspec)

| Field | Description |
|---|---|
| `matchClusters` *string array* | The clusters to consider for this job. The default configuration is to consider all the clusters applicable to the project. The relationship between different clusters is an `OR` relationship. For example, the value `["admin", "system"]` indicates to consider the admin cluster `OR` the system cluster. |
| `matchLabels` *object (keys:string, values:string)* | The pod labels to consider for this job. The default configuration is to consider no filter based on labels. The relationship between different pairs is an `AND` relationship, so all pairs are considered. |
| `matchAnnotations` *object (keys:string, values:string)* | The annotations to consider for this job. The default configuration is to consider no filter based on annotations. The relationship between different pairs is an `AND` relationship, so all pairs are considered. |

### MonitoringTargetSpec

Defines the specification or expected state of the `MonitoringTarget` object.

*Appears in:*
- [MonitoringTarget](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringtarget)

| Field | Description |
|---|---|
| `selector` *[MonitoringTargetSelectors](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringtargetselectors)* | The matching pattern that identifies pods for this job. To establish a relationship between different selectors, use `AND`. |
| `podMetricsEndpoints` *[MonitoringTargetPodMetricsEndpoints](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringtargetpodmetricsendpoints)* | The endpoint exposed for this job. The endpoint uses the style of Prometheus. |

### MonitoringTargetStatus

Defines the observed state of the `MonitoringTarget` object.

*Appears in:*
- [MonitoringTarget](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringtarget)

| Field | Description |
|---|---|
| `conditions` *[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#condition-v1-meta) array* | A list of conditions observed in the monitoring stack. |
| `clusterStatuses` *[ClusterStatus](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#clusterstatus) array* | ClusterStatuses is a list of each cluster and the conditions observed in the Monitoring stack for that cluster. |

### RecordRule

Defines the record rules configuration.

*Appears in:*
- [MonitoringRuleSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringrulespec)

| Field | Description |
|---|---|
| `record` *string* | The time series in which to write the record rule. It must be a valid metric name. |
| `expr` *string* | The PromQL or LogQL expression to evaluate the record rule. |
| `labels` *object (keys:string, values:string)* | The labels to add or overwrite. |

### TLSConfig

*Appears in:*
- [MonitoringTargetPodMetricsEndpoints](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/appliance/apis/service/monitoring/v1/monitoring-v1#monitoringtargetpodmetricsendpoints)

| Field | Description |
|---|---|
| `ca` *string* | Text of the CA cert to use for the targets. |
| `cert` *string* | Text of the client cert file for the targets. |
| `server_name` *string* | Used to verify the hostname for the targets. |