Skip to content

Monitor A Bunch More Endpoints#4764

Merged
jperson1 merged 7 commits into
mainfrom
jp/monitor-ever-more
Mar 11, 2025
Merged

Monitor A Bunch More Endpoints#4764
jperson1 merged 7 commits into
mainfrom
jp/monitor-ever-more

Conversation

@jperson1
Copy link
Copy Markdown
Contributor

@jperson1 jperson1 commented Mar 10, 2025

Monitor A Bunch More Endpoints

Issue: #4741

Changes:

  1. Adds a few endpoints we weren't already checking
    • Unlock after certification
    • Submission eligibility forms (step 1-3, AKA the pre-screener)
    • Submission information forms (General Info, Audit Info, Tribal Data Release)
  2. Adds a new template to handle submission management endpoints
    • The template does a blanket latency check, instead of per-endpoint. This is because they're all low-traffic, and make very similar operations.
    • Each endpoint still gets a transactions and error graph, but transactions are counted by day rather than hour

How to test:

The terraform was applied to preview in this workflow run. Visit the preview monitoring dashboard to verify that it works.

Screenshots:

New tabs and part of the eligibility endpoints:
image

Audit management format:
image

PR Checklist: Submitter

  • Link to an issue if possible. If there’s no issue, describe what your branch does. Even if there is an issue, a brief description in the PR is still useful.
  • List any special steps reviewers have to follow to test the PR. For example, adding a local environment variable, creating a local test file, etc.
  • For extra credit, submit a screen recording like this one.
  • Make sure you’ve merged main into your branch shortly before creating the PR. (You should also be merging main into your branch regularly during development.)
  • Make sure you’ve accounted for any migrations. When you’re about to create the PR, bring up the application locally and then run git status | grep migrations. If there are any results, you probably need to add them to the branch for the PR. Your PR should have only one new migration file for each of the component apps, except in rare circumstances; you may need to delete some and re-run python manage.py makemigrations to reduce the number to one. (Also, unless in exceptional circumstances, your PR should not delete any migration files.)
  • Make sure that whatever feature you’re adding has tests that cover the feature. This includes test coverage to make sure that the previous workflow still works, if applicable.
  • Make sure the full-submission.cy.js Cypress test passes, if applicable.
  • Do manual testing locally. Our tests are not good enough yet to allow us to skip this step. If that’s not applicable for some reason, check this box.
  • Verify that no Git surgery was necessary, or, if it was necessary at any point, repeat the testing after it’s finished.
  • Once a PR is merged, keep an eye on it until it’s deployed to dev, and do enough testing on dev to verify that it deployed successfully, the feature works as expected, and the happy path for the broad feature area (such as submission) still works.
  • Ensure that prior to merging, the working branch is up to date with main and the terraform plan is what you expect.

PR Checklist: Reviewer

  • Pull the branch to your local environment and run make docker-clean; make docker-first-run && docker compose up; then run docker compose exec web /bin/bash -c "python manage.py test"
  • Manually test out the changes locally, or check this box to verify that it wasn’t applicable in this case.
  • Check that the PR has appropriate tests. Look out for changes in HTML/JS/JSON Schema logic that may need to be captured in Python tests even though the logic isn’t in Python.
  • Verify that no Git surgery is necessary at any point (such as during a merge party), or, if it was, repeat the testing after it’s finished.

The larger the PR, the stricter we should be about these points.

Pre Merge Checklist: Merger

  • Ensure that prior to approving, the terraform plan is what we expect it to be. -/+ resource "null_resource" "cors_header" should be destroying and recreating its self and ~ resource "cloudfoundry_app" "clamav_api" might be updating its sha256 for the fac-file-scanner and fac-av-${ENV} by default.
  • Ensure that the branch is up to date with main.
  • Ensure that a terraform plan has been recently generated for the pull request.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 10, 2025

Terraform plan for meta

No changes. Your infrastructure matches the configuration.
No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.

✅ Plan applied in Deploy to Development and Management Environment #961

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 10, 2025

Terraform plan for dev

Plan: 1 to add, 3 to change, 1 to destroy.
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
!~  update in-place
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # module.dev.module.clamav.cloudfoundry_app.clamav_api will be updated in-place
!~  resource "cloudfoundry_app" "clamav_api" {
!~      docker_image                    = "ghcr.io/gsa-tts/fac/clamav@sha256:40919683d4fbd026ee189783ca5c4c58ca99ec50c35d4defdaf1f88e192e002a" -> "ghcr.io/gsa-tts/fac/clamav@sha256:b74a991de6029f90524ce976f90286263f4e5709fd4fb40f8c1f7055c2478ba4"
        id                              = "779bbc51-f78a-4186-90eb-5acb68d7d746"
        name                            = "fac-av-dev"
#        (17 unchanged attributes hidden)

#        (1 unchanged block hidden)
    }

  # module.dev.module.cors.null_resource.cors_header must be replaced
-/+ resource "null_resource" "cors_header" {
!~      id       = "*******************" -> (known after apply)
!~      triggers = { # forces replacement
!~          "always_run" = "2025-03-03T19:52:20Z" -> (known after apply)
        }
    }

  # module.dev.module.file_scanner_clamav.cloudfoundry_app.clamav_api will be updated in-place
!~  resource "cloudfoundry_app" "clamav_api" {
!~      docker_image                    = "ghcr.io/gsa-tts/fac/clamav@sha256:40919683d4fbd026ee189783ca5c4c58ca99ec50c35d4defdaf1f88e192e002a" -> "ghcr.io/gsa-tts/fac/clamav@sha256:b74a991de6029f90524ce976f90286263f4e5709fd4fb40f8c1f7055c2478ba4"
        id                              = "65c83416-4126-4785-99c2-5e1adb810422"
        name                            = "fac-av-dev-fs"
#        (17 unchanged attributes hidden)

#        (1 unchanged block hidden)
    }

  # module.dev.module.newrelic.newrelic_one_dashboard_json.fac_monitoring will be updated in-place
!~  resource "newrelic_one_dashboard_json" "fac_monitoring" {
        id         = "MzkxOTA3NnxWSVp8REFTSEJPQVJEfGRhOjc5NjI5ODA"
!~      json       = jsonencode(
!~          {
                name        = "FAC Monitoring - Dev"
!~              pages       = [
#                    (3 unchanged elements hidden)
                    {
                        description = null
                        name        = "File Downloads"
                        widgets     = [
                            {
                                layout            = {
                                    column = 1
                                    height = 1
                                    row    = 1
                                    width  = 10
                                }
                                linkedEntityGuids = null
                                rawConfiguration  = {
                                    text = "# Single Summary Report Download"
                                }
                                title             = ""
                                visualization     = {
                                    id = "viz.markdown"
                                }
                            },
                            {
                                layout            = {
                                    column = 1
                                    height = 3
                                    row    = 2
                                    width  = 2
                                }
                                linkedEntityGuids = null
                                rawConfiguration  = {
                                    nrqlQueries = [
                                        {
                                            accountIds = [
                                                3919076,
                                            ]
                                            query      = "FROM Transaction SELECT count(*) AS 'Transactions (last hour)' WHERE (appName = 'gsa-fac-dev') AND (request.method = 'GET' AND request.uri LIKE '/dissemination/summary-report/xlsx%') SINCE 1 hour ago"
                                        },
                                    ]
                                }
                                title             = "Transactions (last hour)"
                                visualization     = {
                                    id = "viz.billboard"
                                }
                            },
                            {
                                description       = "Average number of transactions per hour over the past week"
                                layout            = {
                                    column = 3
                                    height = 3
                                    row    = 2
                                    width  = 2
                                }
                                linkedEntityGuids = null
                                rawConfiguration  = {
                                    dataFormatters     = [
                                        {
                                            name      = "Transactions Per Hour"
                                            precision = "0"
                                            type      = "decimal"
                                        },
                                    ]
                                    linkedEntityGuids  = []
                                    nrqlQueries        = [
                                        {
                                            accountIds = [
                                                3919076,
                                            ]
                                            query      = "FROM Transaction SELECT rate(count(*), 1 hour) AS 'Transactions (per hour)' WHERE appName ='gsa-fac-dev' AND request.method = 'GET' AND request.uri LIKE '/dissemination/summary-report/xlsx%' SINCE 7 days ago"
                                        },
                                    ]
                                    thresholds         = [
                                        {
                                            alertSeverity = "WARNING"
                                            value         = 80
                                        },
                                        {
                                            alertSeverity = "CRITICAL"
                                            value         = 70
                                        },
                                    ]
                                    vizcoConfiguration = {
                                        billboard      = {
                                            thresholds = [
                                                {
                                                    limit = 80
                                                    type  = "warning"
                                                },
                                                {
                                                    limit = 70
                                                    type  = "critical"
                                                },
                                            ]
                                        }
                                        dataFormatters = [
                                            {
                                                name      = "Transactions Per Hour"
                                                precision = "0"
                                                type      = "decimal"
                                            },
                                        ]
                                    }
                                }
                                title             = "Transactions Target: 70 (per hour/past week)"
                                visualization     = {
                                    id = "viz.billboard"
                                }
                            },
                            {
                                layout            = {
                                    column = 5
                                    height = 3
                                    row    = 2
                                    width  = 6
                                }
                                linkedEntityGuids = null
                                rawConfiguration  = {
                                    nrqlQueries = [
                                        {
                                            accountId = 3919076
                                            query     = "FROM Transaction SELECT count(*) AS 'Transactions' WHERE appName = 'gsa-fac-dev' AND request.method = 'GET' AND  request.uri LIKE '/dissemination/summary-report/xlsx%' SINCE 14 days ago TIMESERIES"
                                        },
                                    ]
                                }
                                title             = "Transactions"
                                visualization     = {
                                    id = "viz.line"
                                }
                            },
                            {
                                layout            = {
                                    column = 1
                                    height = 3
                                    row    = 5
                                    width  = 2
                                }
                                linkedEntityGuids = null
                                rawConfiguration  = {
                                    nrqlQueries = [
                                        {
                                            accountIds = [
                                                3919076,
                                            ]
                                            query      = "FROM TransactionError SELECT count(*) AS 'Errors (last hour)' WHERE (appName = 'gsa-fac-dev') AND (request.method = 'GET' AND request.uri LIKE '/dissemination/summary-report/xlsx%') SINCE 1 hour ago"
                                        },
                                    ]
                                }
                                title             = "Errors (last hour)"
                                visualization     = {
                                    id = "viz.billboard"
                                }
                            },
                            {
                                layout            = {
                                    column = 3
                                    height = 3
                                    row    = 5
                                    width  = 2
                                }
                                linkedEntityGuids = null
                                rawConfiguration  = {
                                    dataFormatters     = [
                                        {
                                            name      = "Success Rate (%)"
                                            precision = "4"
                                            type      = "decimal"
                                        },
                                    ]
                                    linkedEntityGuids  = []
                                    nrqlQueries        = [
                                        {
                                            accountIds = [
                                                3919076,
                                            ]
                                            query      = "FROM Transaction SELECT 100 - percentage(count(*), WHERE error is true) AS 'Success Rate' WHERE appName ='gsa-fac-dev' AND request.method = 'GET' AND request.uri LIKE '/dissemination/summary-report/xlsx%' SINCE 7 days ago "
                                        },
                                    ]
                                    thresholds         = [
                                        {
                                            alertSeverity = "WARNING"
                                            value         = 0.995
                                        },
                                        {
                                            alertSeverity = "CRITICAL"
                                            value         = 0.99
                                        },
                                    ]
                                    vizcoConfiguration = {
                                        billboard      = {
                                            thresholds = [
                                                {
                                                    limit = 0.995
                                                    type  = "warning"
                                                },
                                                {
                                                    limit = 0.99
                                                    type  = "critical"
                                                },
                                            ]
                                        }
                                        dataFormatters = [
                                            {
                                                name      = "Success Rate (%)"
                                                precision = "4"
                                                type      = "decimal"
                                            },
                                        ]
                                    }
                                }
                                title             = "Success Rate Target: Above 99%"
                                visualization     = {
                                    id = "viz.billboard"
                                }
                            },
                            {
                                layout            = {
                                    column = 5
                                    height = 3
                                    row    = 5
                                    width  = 6
                                }
                                linkedEntityGuids = null
                                rawConfiguration  = {
                                    nrqlQueries = [
                                        {
                                            accountId = 3919076
                                            query     = "FROM TransactionError SELECT count(*) AS 'Errors (last hour)' WHERE (appName = 'gsa-fac-dev') AND (request.method = 'GET' AND request.uri LIKE '/dissemination/summary-report/xlsx%') SINCE 14 days ago TIMESERIES"
                                        },
                                    ]
                                }
                                title             = "Errors"
                                visualization     = {
                                    id = "viz.line"
                                }
                            },
                            {
                                layout            = {
                                    column = 1
                                    height = 3
                                    row    = 8
                                    width  = 2
                                }
                                linkedEntityGuids = null
                                rawConfiguration  = {
                                    dataFormatters  = [
                                        {
                                            name = "p95"
                                            type = "decimal"
                                        },
                                        {
                                            name = "p50"
                                            type = "decimal"
                                        },
                                        {
                                            name = "Average"
                                            type = "decimal"
                                        },
                                    ]
                                    facet           = {
                                        showOtherSeries = false
                                    }
                                    nrqlQueries     = [
                                        {
                                            accountIds = [
                                                3919076,
                                            ]
                                            query      = "FROM Transaction SELECT average(convert(duration, 's', 'ms')) AS 'Average', percentile(convert(duration, 's', 'ms'), 50) AS 'p50', percentile(convert(duration, 's', 'ms'), 95) AS 'p95' WHERE (appName = 'gsa-fac-dev') AND (request.method = 'GET' AND request.uri LIKE '/dissemination/summary-report/xlsx%') SINCE 1 hour ago"
                                        },
                                    ]
                                    platformOptions = {
                                        ignoreTimeRange = false
                                    }
                                }
                                title             = "Latency (last hour)"
                                visualization     = {
                                    id = "viz.billboard"
                                }
                            },
                            {
                                layout            = {
                                    column = 3
                                    height = 3
                                    row    = 8
                                    width  = 2
                                }
                                linkedEntityGuids = null
                                rawConfiguration  = {
                                    dataFormatters     = [
                                        {
                                            name      = "Average Latency (ms)"
                                            precision = "0"
                                            type      = "decimal"
                                        },
                                    ]
                                    linkedEntityGuids  = []
                                    nrqlQueries        = [
                                        {
                                            accountIds = [
                                                3919076,
                                            ]
                                            query      = "FROM Transaction SELECT average(convert(duration, 's', 'ms')) AS 'Average' WHERE (appName = 'gsa-fac-dev') AND (request.method = 'GET' AND request.uri LIKE '/dissemination/summary-report/xlsx%') SINCE 7 days ago "
                                        },
                                    ]
                                    thresholds         = [
                                        {
                                            alertSeverity = "CRITICAL"
                                            value         = 800
                                        },
                                        {
                                            alertSeverity = "WARNING"
                                            value         = 700
                                        },
                                    ]
                                    vizcoConfiguration = {
                                        billboard      = {
                                            thresholds = [
                                                {
                                                    limit = 800
                                                    type  = "critical"
                                                },
                                                {
                                                    limit = 700
                                                    type  = "warning"
                                                },
                                            ]
                                        }
                                        dataFormatters = [
                                            {
                                                name      = "Average Latency (ms)"
                                                precision = "0"
                                                type      = "decimal"
                                            },
                                        ]
                                    }
                                }
                                title             = "Average Latency Target (last week): 800ms"
                                visualization     = {
                                    id = "viz.billboard"
                                }
                            },
                            {
                                layout            = {
                                    column = 5
                                    height = 3
                                    row    = 8
                                    width  = 6
                                }
                                linkedEntityGuids = null
                                rawConfiguration  = {
                                    facet           = {
                                        showOtherSeries = false
                                    }
                                    legend          = {
                                        enabled = true
                                    }
                                    nrqlQueries     = [
                                        {
                                            accountIds = [
                                                3919076,
                                            ]
                                            query      = "FROM Transaction SELECT average(convert(duration, 's', 'ms')) AS 'Average', percentile(convert(duration, 's', 'ms'), 50) AS 'p50', percentile(convert(duration, 's', 'ms'), 95) AS 'p95'  WHERE (appName = 'gsa-fac-dev') AND (request.method = 'GET' AND request.uri LIKE '/dissemination/summary-report/xlsx%') SINCE 14 days ago TIMESERIES"
                                        },
                                    ]
                                    platformOptions = {
                                        ignoreTimeRange = false
                                    }
                                    thresholds      = {
                                        isLabelVisible = true
                                    }
                                    units           = {
                                        unit = "MS"
                                    }
                                    yAxisLeft       = {
                                        zero = true
                                    }
                                    yAxisRight      = {
                                        zero = true
                                    }
                                }
                                title             = "Latency"
                                visualization     = {
                                    id = "viz.line"
                                }
                            },
                            {
                                layout            = {
                                    column = 1
                                    height = 1
                                    row    = 11
                                    width  = 10
                                }
                                linkedEntityGuids = null
                                rawConfiguration  = {
                                    text = "# Workbook Downloads"
                                }
                                title             = ""
                                visualization     = {
                                    id = "viz.markdown"
                                }
                            },
                            {
                                layout            = {
                                    column = 1
                                    height = 3
                                    row    = 12
                                    width  = 2
                                }
                                linkedEntityGuids = null
                                rawConfiguration  = {
                                    nrqlQueries = [
                                        {
                                            accountIds = [
                                                3919076,
                                            ]
                                            query      = "FROM Transaction SELECT count(*) AS 'Transactions (last hour)' WHERE (appName = 'gsa-fac-dev') AND (request.method = 'GET' AND request.uri LIKE '/audit/excel/%') SINCE 1 hour ago"
                                        },
                                    ]
                                }
                                title             = "Transactions (last hour)"
                                visualization     = {
                                    id = "viz.billboard"
                                }
                            },
                            {
                                description       = "Average number of transactions per hour over the past week"
                                layout            = {
                                    column = 3
                                    height = 3
                                    row    = 12
                                    width  = 2
                                }
                                linkedEntityGuids = null
                                rawConfiguration  = {
                                    dataFormatters     = [
                                        {
                                            name      = "Transactions Per Hour"
                                            precision = "0"
                                            type      = "decimal"
                                        },
                                    ]
                                    linkedEntityGuids  = []
                                    nrqlQueries        = [
                                        {
                                            accountIds = [
                                                3919076,
                                            ]
                                            query      = "FROM Transaction SELECT rate(count(*), 1 hour) AS 'Transactions (per hour)' WHERE appName ='gsa-fac-dev' AND request.method = 'GET' AND request.uri LIKE '/audit/excel/%' SINCE 7 days ago"
                                        },
                                    ]
                                    thresholds         = [
                                        {
                                            alertSeverity = "WARNING"
                                            value         = 25
                                        },
                                        {
                                            alertSeverity = "CRITICAL"
                                            value         = 20
                                        },
                                    ]
                                    vizcoConfiguration = {
                                        billboard      = {
                                            thresholds = [
                                                {
                                                    limit = 25
                                                    type  = "warning"
                                                },
                                                {
                                                    limit = 20
                                                    type  = "critical"
                                                },
                                            ]
                                        }
                                        dataFormatters = [
                                            {
                                                name      = "Transactions Per Hour"
                                                precision = "0"
                                                type      = "decimal"
                                            },
                                        ]
                                    }
                                }
                                title             = "Transactions Target: 20 (per hour/past week)"
                                visualization     = {
                                    id = "viz.billboard"
                                }
                            },
                            {
                                layout            = {
                                    column = 5
                                    height = 3
                                    row    = 12
                                    width  = 6
                                }
                                linkedEntityGuids = null
                                rawConfiguration  = {
                                    nrqlQueries = [
                                        {
                                            accountId = 3919076
                                            query     = "FROM Transaction SELECT count(*) AS 'Transactions' WHERE appName = 'gsa-fac-dev' AND request.method = 'GET' AND  request.uri LIKE '/audit/excel/%' SINCE 14 days ago TIMESERIES"
                                        },
                                    ]
                                }
                                title             = "Transactions"
                                visualization     = {
                                    id = "viz.line"
                                }
                            },
                            {
                                layout            = {
                                    column = 1
                                    height = 3
                                    row    = 15
                                    width  = 2
                                }
                                linkedEntityGuids = null
                                rawConfiguration  = {
                                    nrqlQueries = [
                                        {
                                            accountIds = [
                                                3919076,
                                            ]
                                            query      = "FROM TransactionError SELECT count(*) AS 'Errors (last hour)' WHERE (appName = 'gsa-fac-dev') AND (request.method = 'GET' AND request.uri LIKE '/audit/excel/%') SINCE 1 hour ago"
                                        },
                                    ]
                                }
                                title             = "Errors (last hour)"
                                visualization     = {
                                    id = "viz.billboard"
                                }
                            },
                            {
                                layout            = {
                                    column = 3
                                    height = 3
                                    row    = 15
                                    width  = 2
                                }
                                linkedEntityGuids = null
                                rawConfiguration  = {
                                    dataFormatters     = [
                                        {
                                            name      = "Success Rate (%)"
                                            precision = "4"
                                            type      = "decimal"
                                        },
                                    ]
                                    linkedEntityGuids  = []
                                    nrqlQueries        = [
                                        {
                                            accountIds = [
                                                3919076,
                                            ]
                                            query      = "FROM Transaction SELECT 100 - percentage(count(*), WHERE error is true) AS 'Success Rate' WHERE appName ='gsa-fac-dev' AND request.method = 'GET' AND request.uri LIKE '/audit/excel/%' SINCE 7 days ago "
                                        },
                                    ]
                                    thresholds         = [
                                        {
                                            alertSeverity = "WARNING"
                                            value         = 0.995
                                        },
                                        {
                                            alertSeverity = "CRITICAL"
                                            value         = 0.99
                                        },
                                    ]
                                    vizcoConfiguration = {
                                        billboard      = {
                                            thresholds = [
                                                {
                                                    limit = 0.995
                                                    type  = "warning"
                                                },
                                                {
                                                    limit = 0.99
                                                    type  = "critical"
                                                },
                                            ]
                                        }
                                        dataFormatters = [
                                            {
                                                name      = "Success Rate (%)"
                                                precision = "4"
                                                type      = "decimal"
                                            },
                                        ]
                                    }
                                }
                                title             = "Success Rate Target: Above 99%"
                                visualization     = {
                                    id = "viz.billboard"
                                }
                            },
                            {
                                layout            = {
                                    column = 5
                                    height = 3
                                    row    = 15
                                    width  = 6
                                }
                                linkedEntityGuids = null
                                rawConfiguration  = {
                                    nrqlQueries = [
                                        {
                                            accountId = 3919076
                                            query     = "FROM TransactionError SELECT count(*) AS 'Errors (last hour)' WHERE (appName = 'gsa-fac-dev') AND (request.method = 'GET' AND request.uri LIKE '/audit/excel/%') SINCE 14 days ago TIMESERIES"
                                        },
                                    ]
                                }
                                title             = "Errors"
                                visualization     = {
                                    id = "viz.line"
                                }
                            },
                            {
                                layout            = {
                                    column = 1
                                    height = 3
                                    row    = 18
                                    width  = 2
                                }
                                linkedEntityGuids = null
                                rawConfiguration  = {
                                    dataFormatters  = [
                                        {
                                            name = "p95"
                                            type = "decimal"
                                        },
                                        {
                                            name = "p50"
                                            type = "decimal"
                                        },
                                        {
                                            name = "Average"
                                            type = "decimal"
                                        },
                                    ]
                                    facet           = {
                                        showOtherSeries = false
                                    }
                                    nrqlQueries     = [
                                        {
                                            accountIds = [
                                                3919076,
                                            ]
                                            query      = "FROM Transaction SELECT average(convert(duration, 's', 'ms')) AS 'Average', percentile(convert(duration, 's', 'ms'), 50) AS 'p50', percentile(convert(duration, 's', 'ms'), 95) AS 'p95' WHERE (appName = 'gsa-fac-dev') AND (request.method = 'GET' AND request.uri LIKE '/audit/excel/%') SINCE 1 hour ago"
                                        },
                                    ]
                                    platformOptions = {
                                        ignoreTimeRange = false
                                    }
                                }
                                title             = "Latency (last hour)"
                                visualization     = {
                                    id = "viz.billboard"
                                }
                            },
                            {
                                layout            = {
                                    column = 3
                                    height = 3
                                    row    = 18
                                    width  = 2
                                }
                                linkedEntityGuids = null
                                rawConfiguration  = {
                                    dataFormatters     = [
                                        {
                                            name      = "Average Latency (ms)"
                                            precision = "0"
                                            type      = "decimal"
                                        },
                                    ]
                                    linkedEntityGuids  = []
                                    nrqlQueries        = [
                                        {
                                            accountIds = [
                                                3919076,
                                            ]
                                            query      = "FROM Transaction SELECT average(convert(duration, 's', 'ms')) AS 'Average' WHERE (appName = 'gsa-fac-dev') AND (request.method = 'GET' AND request.uri LIKE '/audit/excel/%') SINCE 7 days ago "
                                        },
                                    ]
                                    thresholds         = [
                                        {
                                            alertSeverity = "CRITICAL"
                                            value         = 12000
                                        },
                                        {
                                            alertSeverity = "WARNING"
                                            value         = 10000
                                        },
                                    ]
                                    vizcoConfiguration = {
                                        billboard      = {
                                            thresholds = [
                                                {
                                                    limit = 12000
                                                    type  = "critical"
                                                },
                                                {
                                                    limit = 10000
                                                    type  = "warning"
                                                },
                                            ]
                                        }
                                        dataFormatters = [
                                            {
                                                name      = "Average Latency (ms)"
                                                precision = "0"
                                                type      = "decimal"
                                            },
                                        ]
                                    }
                                }
                                title             = "Average Latency Target (last week): 12000ms"
                                visualization     = {
                                    id = "viz.billboard"
                                }
                            },
                            {
                                layout            = {
                                    column = 5
                                    height = 3
                                    row    = 18
                                    width  = 6
                                }
                                linkedEntityGuids = null
                                rawConfiguration  = {
                                    facet           = {
                                        showOtherSeries = false
                                    }
                                    legend          = {
                                        enabled = true
                                    }
                                    nrqlQueries     = [
                                        {
                                            accountIds = [
                                                3919076,
                                            ]
                                            query      = "FROM Transaction SELECT average(convert(duration, 's', 'ms')) AS 'Average', percentile(convert(duration, 's', 'ms'), 50) AS 'p50', percentile(convert(duration, 's', 'ms'), 95) AS 'p95'  WHERE (appName = 'gsa-fac-dev') AND (request.method = 'GET' AND request.uri LIKE '/audit/excel/%') SINCE 14 days ago TIMESERIES"
                                        },
                                    ]
                                    platformOptions = {
                                        ignoreTimeRange = false
                                    }
                                    thresholds      = {
                                        isLabelVisible = true
                                    }
                                    units           = {
                                        unit = "MS"
                                    }
                                    yAxisLeft       = {
                                        zero = true
                                    }
                                    yAxisRight      = {
                                        zero = true
                                    }
                                }
                                title             = "Latency"
                                visualization     = {
                                    id = "viz.line"
                                }
                            },
                        ]
                    },
!~                  {
!~                      name        = "Validation and Submission" -> "Presubmission Eligibility"
!~                      widgets     = [
!~                          {
!~                              rawConfiguration  = {
!~                                  text = "# Cross Validation" -> "# Eligibility (Step 1)"
                                }
#                                (4 unchanged attributes hidden)
                            },
!~                          {
!~                              rawConfiguration  = {
!~                                  nrqlQueries = [
!~                                      {
!~                                          query      = "FROM Transaction SELECT count(*) AS 'Transactions (last hour)' WHERE (appName = 'gsa-fac-dev') AND (request.method = 'POST' AND request.uri LIKE '/audit/cross-validation/%') SINCE 1 hour ago" -> "FROM Transaction SELECT count(*) AS 'Transactions (last hour)' WHERE (appName = 'gsa-fac-dev') AND (request.method = 'POST' AND request.uri LIKE '/report_submission/eligibility/') SINCE 1 hour ago"
#                                            (1 unchanged attribute hidden)
                                        },
                                    ]
                                }
#                                (4 unchanged attributes hidden)
                            },
!~                          {
!~                              rawConfiguration  = {
!~                                  nrqlQueries        = [
!~                                      {
!~                                          query      = "FROM Transaction SELECT rate(count(*), 1 hour) AS 'Transactions (per hour)' WHERE appName ='gsa-fac-dev' AND request.method = 'POST' AND request.uri LIKE '/audit/cross-validation/%' SINCE 7 days ago" -> "FROM Transaction SELECT rate(count(*), 1 hour) AS 'Transactions (per hour)' WHERE appName ='gsa-fac-dev' AND request.method = 'POST' AND request.uri LIKE '/report_submission/eligibility/' SINCE 7 days ago"
#                                            (1 unchanged attribute hidden)
                                        },
                                    ]
!~                                  thresholds         = [
!~                                      {
!~                                          value         = 10 -> 15
#                                            (1 unchanged attribute hidden)
                                        },
!~                                      {
!~                                          value         = 8 -> 10
#                                            (1 unchanged attribute hidden)
                                        },
                                    ]
!~                                  vizcoConfiguration = {
!~                                      billboard      = {
!~                                          thresholds = [
!~                                              {
!~                                                  limit = 10 -> 15
#                                                    (1 unchanged attribute hidden)
                                                },
!~                                              {
!~                                                  limit = 8 -> 10
#                                                    (1 unchanged attribute hidden)
                                                },
                                            ]
                                        }
#                                        (1 unchanged attribute hidden)
                                    }
#                                    (2 unchanged attributes hidden)
                                }
!~                              title             = "Transactions Target: 8 (per hour/past week)" -> "Transactions Target: 10 (per hour/past week)"
#                                (4 unchanged attributes hidden)
                            },
!~                          {
!~                              rawConfiguration  = {
!~                                  nrqlQueries = [
!~                                      {
!~                                          query     = "FROM Transaction SELECT count(*) AS 'Transactions' WHERE appName = 'gsa-fac-dev' AND request.method = 'POST' AND  request.uri LIKE '/audit/cross-validation/%' SINCE 14 days ago TIMESERIES" -> "FROM Transaction SELECT count(*) AS 'Transactions' WHERE appName = 'gsa-fac-dev' AND request.method = 'POST' AND  request.uri LIKE '/report_submission/eligibility/' SINCE 14 days ago TIMESERIES"
#                                            (1 unchanged attribute hidden)
                                        },
                                    ]
                                }
#                                (4 unchanged attributes hidden)
                            },
!~                          {
!~                              rawConfiguration  = {
!~                                  nrqlQueries = [
!~                                      {
Plan is too large to fit in a PR comment. See the full plan in the workflow log.

✅ Plan applied in Deploy to Development and Management Environment #961

@github-actions
Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Branch Rate Health
. 100% 100%
api 98% 90%
audit 97% 87%
audit.cross_validation 98% 88%
audit.fixtures 84% 50%
audit.intakelib 88% 82%
audit.intakelib.checks 92% 85%
audit.intakelib.common 98% 82%
audit.intakelib.transforms 100% 95%
audit.management.commands 78% 17%
audit.migrations 100% 100%
audit.models 94% 73%
audit.templatetags 100% 100%
audit.views 72% 54%
census_historical_migration 96% 65%
census_historical_migration.migrations 100% 100%
census_historical_migration.sac_general_lib 92% 84%
census_historical_migration.transforms 95% 90%
census_historical_migration.workbooklib 68% 69%
config 77% 37%
curation 100% 100%
curation.curationlib 93% 100%
curation.migrations 100% 100%
dissemination 92% 72%
dissemination.migrations 97% 25%
dissemination.searchlib 76% 66%
dissemination.templatetags 100% 100%
djangooidc 53% 38%
djangooidc.tests 100% 94%
report_submission 93% 88%
report_submission.migrations 100% 100%
report_submission.templatetags 74% 100%
support 91% 66%
support.migrations 100% 100%
support.models 96% 50%
tools 98% 50%
users 95% 92%
users.fixtures 100% 83%
users.management 100% 100%
users.management.commands 100% 100%
users.migrations 100% 100%
Summary 91% (18503 / 20270) 77% (2277 / 2962)

@jperson1 jperson1 added this pull request to the merge queue Mar 11, 2025
Merged via the queue into main with commit 7f004e0 Mar 11, 2025
@jperson1 jperson1 deleted the jp/monitor-ever-more branch March 11, 2025 15:30
gsa-suk pushed a commit that referenced this pull request Mar 14, 2025
* Add Audit Management Endpoints

* Add unlock after certification to monitoring

* Adjust row/column count for management endpoints

* Mispelling is a crime punished with loading times

* UNCLEAR COMMAS

* Resolve copy paste error in a monitoring query.

* Monitor even even more endpoints

Add submission elibility (steps 1-3) and information form endpoints
github-merge-queue Bot pushed a commit that referenced this pull request Apr 7, 2025
* Creating/Saving Audits

* Audit migration command

* Linting and feedback

- Address feedback where we no longer need`_convert_additional_fields()` - it is a duplicate of a method in `utils.py`.
- Minor cleanup on `_populate_accesses()`. I no longer felt it needed to be an isolated function while addressing the above bullet point

* More linting and more feedback

- Supplied two new arguments, "--disseminated" and "--intake". The first will only fetch SAC data that is disseminated, while the second will only fetch SAC data that has not yet disseminated.
- Rather than iterate through 50k SACs at a time, this change introduces a while condition that will continuously migrate batches of 100 until all relevant SACs are migrated. This should mean we only need to run the command once at a time.

* Exclusive mgmt command from Bandit

Bandit does not like potential SQL injection with string-based query construction, however this logic is only accessed internally.

* Remove deprecated "Schema" field

* Updating mixins to account for audits

* New migration and migration logic cleanup

- Added `migrated_to_audit` flag on `SingleAuditChecklist` for determining which SACs have not yet been migrated.
- Added some logic (for local testing ONLY) which cleans up audit data and references to mimic a clean slate.

* Search on Audits, with some refactoring

* Minor bug fixes

* Missed the General Information tab

* First start at cross validation

* Migration script revisions

- Updated `generate_audit_indexes` to catch an issue where `auditee_fiscal_period_end` is an empty string for some records.
- `migrate_audits` command now uses ORM instead of raw queries for performance improvements.
- Improved logging of `migrate_audits` for better monitoring of progress.
- Inserted `null=True` into `migrated_to_audit` booleanfield for SACs.
- Setting `migrated_to_audit=True` for SACs that get created during intake process. This is because an Audit already gets created with the SAC during this step.

* Removing template tag

* Adding blurb about how to use search

* Updating the excel file handling to save records into the history table.
Refactoring.

* Migration corrections

- `0019_audit_auditee_name` and `0019_singleauditchecklist_migrated_to_audit` were migration files that overlapped because they were created from separate branches.
- This change moves `migrated_to_audit` sequentially after `audit_auditee_name`. This should be the extent of the changes needed to correct the issue, as the migration files do not conflict with one another.

* Update instructions for testing migration script

* Initial checkin for cog/over migration to Audit table

* Cleanup

* Added _get_cog_over

* Update

* Fix migration conflict

* Create History when adding accesses

Currently this is only generating SubmissionEvents. We want the History table to replicate these.

* Revert Access change

This is not needed in light of the `source-of-truth/events` PR. (https://github.com/GSA-TTS/FAC/pull/4784/files)

* Creating/Saving Audits

* Audit migration command

* Linting and feedback

- Address feedback where we no longer need`_convert_additional_fields()` - it is a duplicate of a method in `utils.py`.
- Minor cleanup on `_populate_accesses()`. I no longer felt it needed to be an isolated function while addressing the above bullet point

* More linting and more feedback

- Supplied two new arguments, "--disseminated" and "--intake". The first will only fetch SAC data that is disseminated, while the second will only fetch SAC data that has not yet disseminated.
- Rather than iterate through 50k SACs at a time, this change introduces a while condition that will continuously migrate batches of 100 until all relevant SACs are migrated. This should mean we only need to run the command once at a time.

* Exclusive mgmt command from Bandit

Bandit does not like potential SQL injection with string-based query construction, however this logic is only accessed internally.

* Remove deprecated "Schema" field

* New migration and migration logic cleanup

- Added `migrated_to_audit` flag on `SingleAuditChecklist` for determining which SACs have not yet been migrated.
- Added some logic (for local testing ONLY) which cleans up audit data and references to mimic a clean slate.

* Missed the General Information tab

* Updating mixins to account for audits

* Search on Audits, with some refactoring

* Minor bug fixes

* Removing template tag

* Adding blurb about how to use search

* First start at cross validation

* Migration script revisions

- Updated `generate_audit_indexes` to catch an issue where `auditee_fiscal_period_end` is an empty string for some records.
- `migrate_audits` command now uses ORM instead of raw queries for performance improvements.
- Improved logging of `migrate_audits` for better monitoring of progress.
- Inserted `null=True` into `migrated_to_audit` booleanfield for SACs.
- Setting `migrated_to_audit=True` for SACs that get created during intake process. This is because an Audit already gets created with the SAC during this step.

* Migration corrections

- `0019_audit_auditee_name` and `0019_singleauditchecklist_migrated_to_audit` were migration files that overlapped because they were created from separate branches.
- This change moves `migrated_to_audit` sequentially after `audit_auditee_name`. This should be the extent of the changes needed to correct the issue, as the migration files do not conflict with one another.

* Update instructions for testing migration script

* Updating the excel file handling to save records into the history table.
Refactoring.

* Fix migration conflict

* Create History when adding accesses

Currently this is only generating SubmissionEvents. We want the History table to replicate these.

* Revert Access change

This is not needed in light of the `source-of-truth/events` PR. (https://github.com/GSA-TTS/FAC/pull/4784/files)

* Updated Events for Access.

* Tested management command

* Monitor A Bunch More Endpoints (#4764)

* Add Audit Management Endpoints

* Add unlock after certification to monitoring

* Adjust row/column count for management endpoints

* Mispelling is a crime punished with loading times

* UNCLEAR COMMAS

* Resolve copy paste error in a monitoring query.

* Monitor even even more endpoints

Add submission elibility (steps 1-3) and information form endpoints

* Dependency updates (#4768)

* Scale ClamAV and App for March (#4762)

* Terraform module updates (#4692)

* Initial Legacy Provider Update

Sets the new provider into the terraform providers.tf and runs a dual provider setup,
forcing any resource that does not natively interact with the new provider using:

provider = cloudfoundry-community

* ClamAV version 2.0.0

- Removes app_name_or_id for network policies
- Reintroduces external network policy for clamav -> proxy
- Deployed successfully around 9a with v2.0.0 clamav module and was able to successfully
validate a file at around 916a without any issues

* Clamav Module Update

* Preliminary setup for v2.1.0 upgrade

* Upgrade resources

* Add upgrade docs

* Add app -> clamav network policy

* Update gitignore

* Update gitignore

* Update prepare-proxy.sh

* Meta Provider Update

* Update managed providers

* prevent globbing

* Move sandbox imports

* Live commands

* Documentation on all commands

* Meta Module Upgrade

* Dev and Preview Module Upgrade

* Add routes.tf

* Staging Module Upgrade

* Production Module Upgrade

* Update prod instances

* Update bootstrap provider version

* Update sandbox provider version

* Upgrade sandbox shared modules provider

* Updating the excel file handling to save records into the history table.
Refactoring.

* Fix migration conflict

* Create History when adding accesses

Currently this is only generating SubmissionEvents. We want the History table to replicate these.

* Revert Access change

This is not needed in light of the `source-of-truth/events` PR. (https://github.com/GSA-TTS/FAC/pull/4784/files)

* Updated Events for Access.

* Added _get_cog_over

* Fixes after rebase with jr/source-of-truth/main

* Updating the excel file handling to save records into the history table.
Refactoring.

* Scale ClamAV and App for March (#4762)

* Terraform module updates (#4692)

* Initial Legacy Provider Update

Sets the new provider into the terraform providers.tf and runs a dual provider setup,
forcing any resource that does not natively interact with the new provider using:

provider = cloudfoundry-community

* ClamAV version 2.0.0

- Removes app_name_or_id for network policies
- Reintroduces external network policy for clamav -> proxy
- Deployed successfully around 9a with v2.0.0 clamav module and was able to successfully
validate a file at around 916a without any issues

* Clamav Module Update

* Preliminary setup for v2.1.0 upgrade

* Upgrade resources

* Add upgrade docs

* Add app -> clamav network policy

* Update gitignore

* Update gitignore

* Update prepare-proxy.sh

* Meta Provider Update

* Update managed providers

* prevent globbing

* Move sandbox imports

* Live commands

* Documentation on all commands

* Meta Module Upgrade

* Dev and Preview Module Upgrade

* Add routes.tf

* Staging Module Upgrade

* Production Module Upgrade

* Update prod instances

* Update bootstrap provider version

* Update sandbox provider version

* Upgrade sandbox shared modules provider

* Deleted to match jr/source-of-truth/main

* Using only the audits with status SUBMITTED or IN_PROGRESS

* Admin and migration changes

- Now displaying Audit and Audit History in django admin.
- Updated comments on `migrate_audits` mgmt command.
- Now creating `History` for every `SubmissionEvent` tied to a SAC in the `migrate_audits` command.

* Delete migrations

- These should not still be here.

* Correcting linting

* Rename function, exit when no federal awards

* Added year 2025, processing audits with SUBMITTED or DISSEMINATED status

* My Submissions Beta Page

* Update

* Add arg for individual report_ids to migration script

* Fix for auditee_ein

* Updates per discussion

* Removed initialize_db

* Adding a beta page for Summary View

* Remived CognizantAssignment

* Removed unused imports

* Removed unused imports

* Tweak verbose names for Audit and Audit History

* Fix issue with non-disseminated audits

* Fix typo with showing download button

* Fix notes to sefa count

* Fix for counting of findings to be in-line with previous method

* Update ein

* Fix for counting of findings to be in-line with previous method

* Limited number of rows read from audit table so container memory will not max out

* This provides repeatable data loading for test

* Updating README

* Update menu.bash

Line 54 was reading from the file (presumably untouched) when we wanted the script to read from a piped version of the file that removes `transaction_timeout`.

* Update backend/util/load_public_dissem_data/README.md

* File Uploads connection to Audit. Refactoring.

* Assign file references to audit in migration script

* Updates the script to handle additional utilities

Resets the `migrated_to_audit` field after data load.

Allows for truncating the `audit_audit` table during testing.

* Minor tweak to the migration script

* Adding api version 1.2.0 for SoT

* Adding API test code

Still needs more README, and perhaps not a `lib`.

To be merged and tested with the new API code.

* Updated api version ref in remaining sql files

* Fixing an import

* Adds some initial debugging

This will want a flag to turn it on/off for production use.

* Added api version 1.2.0 to live list

* Export audit data

* Export audit data

* Export audit data

* Fixed bugs and improved SQL scripts

* Fixed the audit type underscore issue

* Updating the downloads to use the audit table.

* Initial commit

- Created new model: `AuditValidationWaiver`. Operates the same as `SacValidationWaiver` but focuses on Audits.
- Adjusted `test_admin` to account for the new model as well as testing actions on the audit instead of the SAC.
- Created new method in `viewflow.py` for transitioning state of an Audit.
- linting.

* Include staffuser permissions for new models

* Updates

* Updates

* Added Export Audit Data to CSV

* Initial checkin

* Updates

* Updates

* Update

* Update

* Copy over datasource during migration

* PR Feedback

* Refactor save_model() for AuditValidationWaiverAdmin

* Further refactoring to save_model() and logical error fixes

* Minor update to make code run smoothly

* Added input parameters allowing audit_year or all options

* Added year parameter

* Testing

* Testing

* Testing

* Testing

* Testing

* Fixed range

* Updating the API to account for audit table, and refactoring.

* Updating created/updated for the migration script

* Implemented changes suggested by Matt

* Removed print statement

* Updated for full cycle

This should allow us to take raw(ish) data from prod, clean it up
further, and prepare it for reuse.

More work would be needed to work directly with prod data. We
(hopefully) will not have a need to re-run this process again. If we do,
we will extend the script "further back" so that it is easy to
replicate.

* Minor changes to print statements and comments

Nothing of note. No core logic changes.

* In progress

* Updating the previous references validation to use Audit table

* Added logic to print results in CSV

* Added exports for Federal year

* Paired fixes

We fixed a number of things in the comparison script, and like where we
are.

One fix in the API.

Ready for iteration.

* Fix admin test with deleting flagged records

* Cleaning up the logging for search a bit

* Bug fixing

* Fix cog/over and history date on migration

* Fixing html linting

* Linting.

* Linting.

* Linting

* bandit fixes

Ignoring the test file, adding a timeout to `get()`.

* mypy typing fixes

* mypy fix

* minor fix for api 1.2

* Do the date calculations for fac-accepted-date

* Code improvement and completed api view for general table

---------

Co-authored-by: Bobby Novak <176936850+rnovak338@users.noreply.github.com>
Co-authored-by: Matthew Jadud <matthew.jadud@gsa.gov>
Co-authored-by: Sudha Kumar <sudha.kumar@gsa.gov>
Co-authored-by: James Person <james.person@gsa.gov>
Co-authored-by: Phil Dominguez <142051477+phildominguez-gsa@users.noreply.github.com>
Co-authored-by: Alex Steel <130377221+asteel-gsa@users.noreply.github.com>
Co-authored-by: Sudha Kumar <135276194+gsa-suk@users.noreply.github.com>
Co-authored-by: Hassan D. M. Sambo <hassandeme.mamasambo@gsa.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants