Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Commit

Permalink
Convert JSON to YAML. Writing multiline queries is easier in YAML than
Browse files Browse the repository at this point in the history
in JSON.
  • Loading branch information
yegle committed Sep 9, 2020
1 parent bf4de11 commit 53f8f77
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 88 deletions.
43 changes: 0 additions & 43 deletions terraform/alerting/dashboards/e2e.json

This file was deleted.

38 changes: 38 additions & 0 deletions terraform/alerting/dashboards/e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
displayName: e2e
gridLayout:
columns: 2
widgets:
- title: /api/issue/code_issued_count rate by job
xyChart:
chartOptions:
mode: COLOR
dataSets:
- plotType: LINE
timeSeriesQuery:
timeSeriesQueryLanguage: >
generic_task ::
custom.googleapis.com/opencensus/en-verification-server/api/issue/codes_issued_count
| align rate()
| every 1m
| [resource.job]
timeshiftDuration: 0s
yAxis:
label: y1Axis
scale: LINEAR
- title: /api/verify/attempt_count rate by job
xyChart:
chartOptions:
mode: COLOR
dataSets:
- plotType: LINE
timeSeriesQuery:
timeSeriesQueryLanguage: >
generic_task ::
custom.googleapis.com/opencensus/en-verification-server/api/verify/attempt_count
| align rate()
| every 1m
| [resource.job]
timeshiftDuration: 0s
yAxis:
label: "y1Axis"
scale: "LINEAR"
43 changes: 0 additions & 43 deletions terraform/alerting/dashboards/verification-server.json

This file was deleted.

38 changes: 38 additions & 0 deletions terraform/alerting/dashboards/verification-server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
displayName: Verification Server
gridLayout:
columns: 2
widgets:
- title: Cloud Run Revision - Request Count (grouped) [SUM]
xyChart:
chartOptions:
mode: COLOR
dataSets:
- plotType: LINE
timeSeriesQuery:
timeSeriesQueryLanguage: >
cloud_run_revision ::
run.googleapis.com/request_count
| align rate()
| every 1m
| [resource.service_name, metric.response_code_class]
timeshiftDuration: 0s
yAxis:
label: y1Axis
scale: LINEAR
- title: OpenCensus/en-verification-server/api/issue/attempt_count by label.job [SUM]
xyChart:
chartOptions:
mode: COLOR
dataSets:
- plotType: LINE
timeSeriesQuery:
timeSeriesQueryLanguage: >
generic_task ::
custom.googleapis.com/opencensus/en-verification-server/api/issue/attempt_count
| align rate()
| every 1m
| [resource.job]
timeshiftDuration: 0s
yAxis:
label: y1Axis
scale: LINEAR
4 changes: 2 additions & 2 deletions terraform/alerting/monitoring.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

resource "google_monitoring_dashboard" "verification-server" {
project = var.project
dashboard_json = file("${path.module}/dashboards/verification-server.json")
dashboard_json = jsonencode(yamldecode(file("${path.module}/dashboards/verification-server.yaml")))
depends_on = [
null_resource.manual-step-to-enable-workspace
]
}

resource "google_monitoring_dashboard" "e2e" {
project = var.project
dashboard_json = file("${path.module}/dashboards/e2e.json")
dashboard_json = jsonencode(yamldecode(file("${path.module}/dashboards/e2e.yaml")))
depends_on = [
null_resource.manual-step-to-enable-workspace
]
Expand Down

0 comments on commit 53f8f77

Please sign in to comment.