Skip to content

Commit 0ad6fb6

Browse files
authored
add error reporting to cloudevent receiver (#114)
matches that of service dashboard --------- Signed-off-by: Kenny Leung <[email protected]>
1 parent ae75aea commit 0ad6fb6

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

modules/cloudevent-recorder/recorder.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ module "triggers" {
9191
module "recorder-dashboard" {
9292
source = "../dashboard/cloudevent-receiver"
9393
service_name = var.name
94+
project_id = var.project_id
9495

9596
labels = { for type, schema in var.types : replace(type, ".", "_") => "" }
9697

modules/dashboard/cloudevent-receiver/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ No requirements.
8383

8484
| Name | Source | Version |
8585
|------|--------|---------|
86+
| <a name="module_errgrp"></a> [errgrp](#module\_errgrp) | ../sections/errgrp | n/a |
8687
| <a name="module_http"></a> [http](#module\_http) | ../sections/http | n/a |
8788
| <a name="module_layout"></a> [layout](#module\_layout) | ../sections/layout | n/a |
8889
| <a name="module_logs"></a> [logs](#module\_logs) | ../sections/logs | n/a |
@@ -102,6 +103,7 @@ No requirements.
102103
|------|-------------|------|---------|:--------:|
103104
| <a name="input_labels"></a> [labels](#input\_labels) | Additional labels to apply to the dashboard. | `map` | `{}` | no |
104105
| <a name="input_notification_channels"></a> [notification\_channels](#input\_notification\_channels) | List of notification channels to alert. | `list(string)` | `[]` | no |
106+
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | ID of the GCP project | `string` | n/a | yes |
105107
| <a name="input_service_name"></a> [service\_name](#input\_service\_name) | Name of the service(s) to monitor | `string` | n/a | yes |
106108
| <a name="input_triggers"></a> [triggers](#input\_triggers) | A mapping from a descriptive name to a subscription name prefix, an alert threshold, and list of notification channels. | <pre>map(object({<br> subscription_prefix = string<br> alert_threshold = optional(number, 50000)<br> notification_channels = optional(list(string), [])<br> }))</pre> | n/a | yes |
107109

modules/dashboard/cloudevent-receiver/dashboard.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ module "subscription" {
99
notification_channels = each.value.notification_channels
1010
}
1111

12+
module "errgrp" {
13+
source = "../sections/errgrp"
14+
title = "Service Error Reporting"
15+
project_id = var.project_id
16+
service_name = var.service_name
17+
}
18+
1219
module "logs" {
1320
source = "../sections/logs"
1421
title = "Service Logs"
@@ -38,6 +45,7 @@ module "layout" {
3845
sections = concat(
3946
[for key in sort(keys(var.triggers)) : module.subscription[key].section],
4047
[
48+
module.errgrp.section,
4149
module.logs.section,
4250
module.http.section,
4351
module.resources.section,

modules/dashboard/cloudevent-receiver/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ variable "triggers" {
1717
}))
1818
}
1919

20+
variable "project_id" {
21+
description = "ID of the GCP project"
22+
type = string
23+
}
24+
2025
variable "notification_channels" {
2126
description = "List of notification channels to alert."
2227
type = list(string)

0 commit comments

Comments
 (0)