diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index dce79c7..011d3b3 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -46,7 +46,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6 + uses: github/codeql-action/init@8214744c546c1e5c8f03dde8fab3a7353211988d # v3.26.7 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -60,7 +60,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6 + uses: github/codeql-action/autobuild@8214744c546c1e5c8f03dde8fab3a7353211988d # v3.26.7 # ℹī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -73,6 +73,6 @@ jobs: # ./location_of_script_within_repo/buildscript.sh - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6 + uses: github/codeql-action/analyze@8214744c546c1e5c8f03dde8fab3a7353211988d # v3.26.7 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index f7c5df6..f46b744 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -69,6 +69,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6 + uses: github/codeql-action/upload-sarif@8214744c546c1e5c8f03dde8fab3a7353211988d # v3.26.7 with: sarif_file: results.sarif diff --git a/deployment/live/monitoring/ci/terragrunt.hcl b/deployment/live/monitoring/ci/terragrunt.hcl index 5d0260e..d3a4568 100644 --- a/deployment/live/monitoring/ci/terragrunt.hcl +++ b/deployment/live/monitoring/ci/terragrunt.hcl @@ -7,6 +7,7 @@ inputs = merge( include.root.locals, { alert_lt_num_witness_threshold = 0 + num_expected_devices = 5 } ) diff --git a/deployment/live/monitoring/dev/terragrunt.hcl b/deployment/live/monitoring/dev/terragrunt.hcl index 5d0260e..e7f247c 100644 --- a/deployment/live/monitoring/dev/terragrunt.hcl +++ b/deployment/live/monitoring/dev/terragrunt.hcl @@ -7,6 +7,7 @@ inputs = merge( include.root.locals, { alert_lt_num_witness_threshold = 0 + num_expected_devices = 2 } ) diff --git a/deployment/live/monitoring/prod/terragrunt.hcl b/deployment/live/monitoring/prod/terragrunt.hcl index 8acb465..979b22c 100644 --- a/deployment/live/monitoring/prod/terragrunt.hcl +++ b/deployment/live/monitoring/prod/terragrunt.hcl @@ -8,6 +8,7 @@ inputs = merge( { alert_lt_num_witness_threshold = 10 alert_enable_num_witness = false + num_expected_devices = 15 } ) diff --git a/deployment/modules/monitoring/main.tf b/deployment/modules/monitoring/main.tf index 2475c2a..45cfaa7 100644 --- a/deployment/modules/monitoring/main.tf +++ b/deployment/modules/monitoring/main.tf @@ -84,6 +84,41 @@ resource "google_monitoring_dashboard" "witness_dashboard" { } } }, + { + "title": "Devices seen online", + "xyChart": { + "dataSets": [{ + "timeSeriesQuery": { + "prometheusQuery": "count by (witness_id) (max by (instance_id, witness_id) (rate(distributor_update_checkpoint_request{configuration_name='distributor-service-${var.env}'}[$${__interval}]) > bool 0))" + }, + "plotType": "STACKED_AREA" + }], + "timeshiftDuration": "0s", + "yAxis": { + "label": "Devices", + "scale": "LINEAR" + } + } + }, + { + "title": "% online (assuming ${var.num_expected_devices} devices)", + "xyChart": { + "dataSets": [{ + "timeSeriesQuery": { + "prometheusQuery": "count by (instance_id) (max by (instance_id, witness_id) (rate(distributor_update_checkpoint_request{configuration_name='distributor-service-${var.env}'}[$${__interval}]) > bool 0)) * 100 / ${var.num_expected_devices}" + }, + "plotType": "STACKED_AREA" + }], + "thresholds": [{ + "value": 51 + }], + "timeshiftDuration": "0s", + "yAxis": { + "label": "%", + "scale": "LINEAR" + } + } + }, { "title": "Witness liveness alert chart", "alertChart": { diff --git a/deployment/modules/monitoring/variables.tf b/deployment/modules/monitoring/variables.tf index 2836bef..47540e4 100644 --- a/deployment/modules/monitoring/variables.tf +++ b/deployment/modules/monitoring/variables.tf @@ -29,6 +29,11 @@ variable "env" { type = string } +variable "num_expected_devices" { + description = "Number of expected devices" + type = number +} + variable "alert_lt_num_witness_threshold" { description = "The lower bound alert threshold for the number of live witnesses, as measured by the distributor_update_checkpoint_success Prometheus metric." type = number @@ -37,4 +42,4 @@ variable "alert_lt_num_witness_threshold" { variable "alert_enable_num_witness" { description = "Whether to enable alert_lt_num_witness_threshold." type = bool -} \ No newline at end of file +}