@hiiretail/gcp-infra-cli 0.82.0 → 0.82.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,13 +41,19 @@ inputs = {
41
41
  "roles/container.viewer",
42
42
  "roles/compute.viewer",
43
43
  "roles/errorreporting.user",
44
- "roles/monitoring.editor",
45
44
  "roles/logging.viewer",
46
45
  "roles/logging.configWriter",
47
46
  "roles/cloudtrace.user",
48
47
  "roles/pubsub.viewer",
49
48
  "roles/run.viewer",
50
49
  "roles/viewer",
50
+ "roles/monitoring.viewer",
51
+ "roles/monitoring.uptimeCheckConfigViewer",
52
+ "roles/monitoring.servicesViewer",
53
+ "roles/monitoring.notificationChannelViewer",
54
+ "roles/monitoring.metricsScopesViewer",
55
+ "roles/monitoring.dashboardEditor",
56
+ "roles/monitoring.alertPolicyViewer"
51
57
  ]
52
58
 
53
59
  roles_map = [
@@ -128,7 +128,7 @@ module.exports = class extends BaseGenerator {
128
128
  const oldYaml = yaml.load(fs.readFileSync(yamlPath, 'utf8')) || [];
129
129
  const newYaml = await handleUptimeChecks(oldYaml, uptimeCheckTemplates, this.answers);
130
130
 
131
- fs.writeFileSync(yamlPath, yaml.dump(newYaml));
131
+ fs.writeFileSync(yamlPath, yaml.dump(newYaml, { lineWidth: 250, noArrayIndent: true }));
132
132
  }
133
133
 
134
134
  if (monitoringResource === 'slos') {
@@ -141,7 +141,7 @@ module.exports = class extends BaseGenerator {
141
141
  const oldYaml = yaml.load(fs.readFileSync(yamlPath, 'utf8')) || [];
142
142
  const newYaml = await handleSlos(oldYaml, sloTemplates, this.answers);
143
143
 
144
- fs.writeFileSync(yamlPath, yaml.dump(newYaml));
144
+ fs.writeFileSync(yamlPath, yaml.dump(newYaml, { lineWidth: 250, noArrayIndent: true }));
145
145
  }
146
146
 
147
147
  if (monitoringResource === 'alerts') {
@@ -153,7 +153,7 @@ module.exports = class extends BaseGenerator {
153
153
  const newYaml = await handleAlerts(oldYaml, alertTemplates,
154
154
  { ...this.answers, clan: defaultClan });
155
155
 
156
- fs.writeFileSync(yamlPath, yaml.dump(newYaml));
156
+ fs.writeFileSync(yamlPath, yaml.dump(newYaml, { lineWidth: 250, noArrayIndent: true }));
157
157
  }
158
158
  }
159
159
 
@@ -103,19 +103,22 @@ cloud_sql:
103
103
  documentation:
104
104
  content: <% if (runbookLink) { %>[Runbook](<%-runbookLink%>)<%} else { %> <% } %>
105
105
  query_over_1s:
106
- display_name: "[P4] <%-clan%> - CloudSQL | Query resolve time"
106
+ display_name: "[P4] <%-clan%> - CloudSQL | Slow query"
107
107
  conditions:
108
- - display_name: Cloud SQL Instance Database - Per query execution times above 1000 ms
108
+ - display_name: Cloud SQL - Slow query latency
109
109
  condition_threshold:
110
110
  filter: |
111
+ metric.type="cloudsql.googleapis.com/database/postgresql/insights/perquery/latencies"
111
112
  resource.type="cloudsql_instance_database"
112
- metric.type="cloudsql.googleapis.com/database/postgresql/insights/perquery/execution_time"
113
113
  resource.labels.project_id="<%-projectId%>"
114
114
  threshold_value: 1000000
115
115
  aggregations:
116
116
  - alignment_period: 60s
117
117
  per_series_aligner: ALIGN_DELTA
118
- group_by_fields: ["resource.label.resource_id"]
118
+ cross_series_reducer: REDUCE_PERCENTILE_99
119
+ group_by_fields:
120
+ - metric.label.querystring
121
+ - resource.label.resource_id
119
122
  documentation:
120
123
  content: <% if (runbookLink) { %>[Runbook](<%-runbookLink%>)<%} else { %> <% } %>
121
124
  memorystore:
@@ -239,6 +242,8 @@ cloud_function:
239
242
  aggregations:
240
243
  - alignment_period: 60s
241
244
  per_series_aligner: ALIGN_COUNT
242
- group_by_fields: ["metric.label.status", "resource.label.function_name"]
245
+ group_by_fields:
246
+ - metric.label.status
247
+ - resource.label.function_name
243
248
  documentation:
244
249
  content: <% if (runbookLink) { %>[Runbook](<%-runbookLink%>)<%} else { %> <% } %>
@@ -18,7 +18,5 @@ locals {
18
18
  inputs = merge(local.project_vars.locals, local.common_vars.locals,
19
19
  {
20
20
  clan_project_id = local.project_vars.locals.project_id
21
- # Use var below if we decide to go with hiiretail-monitoring-prod project
22
- #tribe_project_id = local.common_vars.locals.monitoring_project_id
23
21
  }
24
22
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hiiretail/gcp-infra-cli",
3
- "version": "0.82.0",
3
+ "version": "0.82.2",
4
4
  "description": "Infrastructure as code generator for GCP.",
5
5
  "main": "src/cli.js",
6
6
  "bin": {
@@ -1,34 +0,0 @@
1
- # Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
2
- # working directory, into a temporary folder, and execute your Terraform commands in that folder.
3
- terraform {
4
- source = "git::https://github.com/extenda/tf-module-gcp-monitoring//?ref=v0.1.6"
5
- }
6
-
7
- # Include all settings from the root terragrunt.hcl file
8
- include {
9
- path = find_in_parent_folders("terragrunt_root.hcl")
10
- }
11
-
12
- dependency "notification_channels" {
13
- config_path = "../notification-channels"
14
- mock_outputs = {
15
- notification_channels = ["dummy-channel"]
16
- }
17
- }
18
-
19
- locals {
20
- project_vars = read_terragrunt_config(find_in_parent_folders("project.hcl"))
21
- common_vars = read_terragrunt_config(find_in_parent_folders("common.hcl"))
22
- }
23
-
24
- # These are the variables we have to pass in to use the module specified in the terragrunt configuration above
25
- inputs = merge(local.project_vars.locals, local.common_vars.locals,
26
- {
27
- clan_project_id = local.project_vars.locals.project_id
28
- notification_channels = dependency.notification_channels.outputs.notification_channels
29
- cloudfunction_monitoring = true
30
- user_labels = {
31
- cc = local.common_vars.locals.cost_center
32
- }
33
- }
34
- )
@@ -1,34 +0,0 @@
1
- # Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
2
- # working directory, into a temporary folder, and execute your Terraform commands in that folder.
3
- terraform {
4
- source = "git::https://github.com/extenda/tf-module-gcp-monitoring//?ref=v0.1.6"
5
- }
6
-
7
- # Include all settings from the root terragrunt.hcl file
8
- include {
9
- path = find_in_parent_folders("terragrunt_root.hcl")
10
- }
11
-
12
- dependency "notification_channels" {
13
- config_path = "../notification-channels"
14
- mock_outputs = {
15
- notification_channels = ["dummy-channel"]
16
- }
17
- }
18
-
19
- locals {
20
- project_vars = read_terragrunt_config(find_in_parent_folders("project.hcl"))
21
- common_vars = read_terragrunt_config(find_in_parent_folders("common.hcl"))
22
- }
23
-
24
- # These are the variables we have to pass in to use the module specified in the terragrunt configuration above
25
- inputs = merge(local.project_vars.locals, local.common_vars.locals,
26
- {
27
- clan_project_id = local.project_vars.locals.project_id
28
- notification_channels = dependency.notification_channels.outputs.notification_channels
29
- cloudrun_monitoring = true
30
- user_labels = {
31
- cc = local.common_vars.locals.cost_center
32
- }
33
- }
34
- )
@@ -1,34 +0,0 @@
1
- # Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
2
- # working directory, into a temporary folder, and execute your Terraform commands in that folder.
3
- terraform {
4
- source = "git::https://github.com/extenda/tf-module-gcp-monitoring//?ref=v0.1.6"
5
- }
6
-
7
- # Include all settings from the root terragrunt.hcl file
8
- include {
9
- path = find_in_parent_folders("terragrunt_root.hcl")
10
- }
11
-
12
- dependency "notification_channels" {
13
- config_path = "../notification-channels"
14
- mock_outputs = {
15
- notification_channels = ["dummy-channel"]
16
- }
17
- }
18
-
19
- locals {
20
- project_vars = read_terragrunt_config(find_in_parent_folders("project.hcl"))
21
- common_vars = read_terragrunt_config(find_in_parent_folders("common.hcl"))
22
- }
23
-
24
- # These are the variables we have to pass in to use the module specified in the terragrunt configuration above
25
- inputs = merge(local.project_vars.locals, local.common_vars.locals,
26
- {
27
- clan_project_id = local.project_vars.locals.project_id
28
- notification_channels = dependency.notification_channels.outputs.notification_channels
29
- dataflow_monitoring = true
30
- user_labels = {
31
- cc = local.common_vars.locals.cost_center
32
- }
33
- }
34
- )