Skip to content

Commit

Permalink
fix probe memory and add heartbeat probe
Browse files Browse the repository at this point in the history
  • Loading branch information
ndo77 committed Sep 11, 2024
1 parent a3e0305 commit 39a6355
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 89 deletions.
1 change: 1 addition & 0 deletions docs/severity.md
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,7 @@

|Detector|Critical|Major|Minor|Warning|Info|
|---|---|---|---|---|---|
|GCP Cloud Run heartbeat|X|-|-|-|-|
|GCP Cloud Run cpu utilizations|X|X|-|-|-|
|GCP Cloud Run memory utilizations|X|X|-|-|-|

Expand Down
48 changes: 3 additions & 45 deletions modules/integration_gcp-cloud-run/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
- [Metadata configuration for default filtering](#metadata-configuration-for-default-filtering)
- [CPU utilizations](#cpu-utilizations)
- [Memory utilizations](#memory-utilizations)
- [Connection refused to cloud sql](#connection-refused-to-cloud-sql)
- [Error 5xx](#error-5xx)
- [Related documentation](#related-documentation)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->
Expand Down Expand Up @@ -82,6 +80,7 @@ This module creates the following SignalFx detectors which could contain one or

|Detector|Critical|Major|Minor|Warning|Info|
|---|---|---|---|---|---|
|GCP Cloud Run heartbeat|X|-|-|-|-|
|GCP Cloud Run cpu utilizations|X|X|-|-|-|
|GCP Cloud Run memory utilizations|X|X|-|-|-|

Expand All @@ -101,7 +100,9 @@ Check the [Related documentation](#related-documentation) section for more detai

Here is the list of required metrics for detectors in this module.

* `container/containers`
* `container/cpu/utilizations`
* `container/memory/utilizations`


## Notes
Expand Down Expand Up @@ -218,49 +219,6 @@ module "signalfx-detectors-integration_gcp-cloud-run" {
}
```

### Connection refused to cloud sql

Keeping track of this ratio is crucial in ensuring smooth and maintained service.

```hcl
module "signalfx-detectors-integration_gcp-cloud-run" {
source = "github.com/claranet/terraform-signalfx-detectors.git//modules/integration_gcp-cloud-run"
environment = var.environment
gcp_project_id = var.project_id
notifications = local.notifications
# We keep default filtering policy here, we just want to append additional filter to it
filtering_append = true
# We define the additional filter
filtering_custom = "filter('service_name', '*service-name*')"
# We can configure the thresholds of the probes
connection_refused_to_sql_ratio_threshold_critical = 85
connection_refused_to_sql_ratio_threshold_major = 80
}
```
### Error 5xx

Monitoring server-side errors to track and rectify system issues.

```hcl
module "signalfx-detectors-integration_gcp-cloud-run" {
source = "github.com/claranet/terraform-signalfx-detectors.git//modules/integration_gcp-cloud-run"
environment = var.environment
gcp_project_id = var.project_id
notifications = local.notifications
# We keep default filtering policy here, we just want to append additional filter to it
filtering_append = true
# We define the additional filter
filtering_custom = "filter('service_name', '*service-name*')"
# We can configure the thresholds of the probes
error_rate_5xx_threshold_critical = 10
error_rate_5xx_threshold_major = 80
}
```


## Related documentation

Expand Down
15 changes: 15 additions & 0 deletions modules/integration_gcp-cloud-run/conf/00-heartbeat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module: "GCP Cloud Run"
name: "heartbeat"

transformation: true
aggregation: true

signals:
signal:
metric: "container/containers"

rules:
critical:
threshold: 0
comparator: "=="

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ transformation: ".min(over='30m')"

signals:
signal:
metric: "container/cpu/utilizations"
metric: "container/memory/utilizations"

rules:
critical:
Expand Down
Loading

0 comments on commit 39a6355

Please sign in to comment.