-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create FAC Log Review Dashboard #4028
Conversation
Terraform plan for dev Plan: 1 to add, 0 to change, 0 to destroy.Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# module.dev.module.newrelic.newrelic_one_dashboard.log_review_dashboard will be created
+ resource "newrelic_one_dashboard" "log_review_dashboard" {
+ account_id = (known after apply)
+ guid = (known after apply)
+ id = (known after apply)
+ name = "FAC Log Review (dev)"
+ permalink = (known after apply)
+ permissions = "public_read_only"
+ page {
+ guid = (known after apply)
+ name = "FAC Log Review"
+ widget_billboard {
+ column = 1
+ height = 3
+ id = (known after apply)
+ legend_enabled = true
+ row = 1
+ title = "Submission Count"
+ width = 3
+ nrql_query {
+ account_id = (known after apply)
+ query = "From Transaction SELECT count(*) as 'Submissions' WHERE appName = 'gsa-fac-dev' and request.method = 'POST' and request.uri like '/audit/submission/%' since 1 week ago"
}
}
+ widget_billboard {
+ column = 4
+ height = 3
+ id = (known after apply)
+ legend_enabled = true
+ row = 1
+ title = "Excel Uploads"
+ width = 3
+ nrql_query {
+ account_id = (known after apply)
+ query = "FROM Metric SELECT count(*) AS 'Total uploads', average(apm.service.transaction.duration) AS 'Average time (s)' WHERE appName = 'gsa-fac-dev' AND path LIKE 'audit.views.views:ExcelFileHandlerView.post'"
}
}
+ widget_billboard {
+ column = 7
+ height = 3
+ id = (known after apply)
+ legend_enabled = true
+ row = 1
+ title = "Single Audit Report Uploads"
+ width = 3
+ nrql_query {
+ account_id = (known after apply)
+ query = "FROM Metric SELECT count(*) AS 'Total uploads', average(apm.service.transaction.duration) AS 'Average time (s)' WHERE appName = 'gsa-fac-dev' AND path LIKE 'audit.views.upload_report_view:UploadReportView.post'"
}
}
+ widget_billboard {
+ column = 10
+ height = 3
+ id = (known after apply)
+ legend_enabled = true
+ row = 1
+ title = "Global Requests (Non-Upload)"
+ width = 3
+ nrql_query {
+ account_id = (known after apply)
+ query = "FROM Metric SELECT count(*) AS 'Total requests', average(apm.service.transaction.duration) * 1000 AS 'Average time (ms)' WHERE appName = 'gsa-fac-dev' AND path NOT LIKE '%ExcelFileHandlerView.post' AND path NOT LIKE '%UploadReportView.post'"
}
}
+ widget_billboard {
+ column = 9
+ height = 3
+ id = (known after apply)
+ legend_enabled = true
+ row = 4
+ title = "Infected Files Detected"
+ width = 3
+ nrql_query {
+ account_id = (known after apply)
+ query = "SELECT count(*) AS 'Infected Files' FROM Log WHERE tags.space_name = 'dev' and message LIKE '%ScanResult.INFECTED%'"
}
}
+ widget_billboard {
+ column = 9
+ height = 3
+ id = (known after apply)
+ legend_enabled = true
+ row = 5
+ title = "Django /admin/login/ Count"
+ width = 3
+ nrql_query {
+ account_id = (known after apply)
+ query = "SELECT count(`message` as `/admin/login/ hits`) FROM Log WHERE `message` LIKE 'fac-dev.app.cloud.gov%/admin/login%' SINCE 7 days ago"
}
}
+ widget_billboard {
+ column = 9
+ height = 3
+ id = (known after apply)
+ legend_enabled = true
+ row = 6
+ title = "dev api.sam.gov Connection Count"
+ width = 3
+ nrql_query {
+ account_id = (known after apply)
+ query = "SELECT count(*) AS 'api.sam.gov connections' FROM Log WHERE `entity.name` = 'gsa-fac-dev' AND allColumnSearch('api.sam.gov', insensitive: true) SINCE 7 DAYS AGO"
}
}
+ widget_billboard {
+ column = 9
+ height = 3
+ id = (known after apply)
+ legend_enabled = true
+ row = 7
+ title = "dev login.gov Connection Count"
+ width = 3
+ nrql_query {
+ account_id = (known after apply)
+ query = "SELECT count(*) AS 'login.gov connections' FROM Log WHERE `entity.name` = 'gsa-fac-dev' AND allColumnSearch('/api/openid_connect/userinfo', insensitive: true) SINCE 7 DAYS AGO"
}
}
+ widget_log_table {
+ column = 1
+ height = 3
+ id = (known after apply)
+ legend_enabled = true
+ row = 6
+ title = "dev api.sam.gov Connections"
+ width = 8
+ nrql_query {
+ account_id = (known after apply)
+ query = "SELECT `message` FROM Log WHERE `entity.name` = 'gsa-fac-dev' AND allColumnSearch('api.sam.gov', insensitive: true) SINCE 7 DAYS AGO"
}
}
+ widget_log_table {
+ column = 1
+ height = 3
+ id = (known after apply)
+ legend_enabled = true
+ row = 7
+ title = "dev login.gov Connections"
+ width = 8
+ nrql_query {
+ account_id = (known after apply)
+ query = "SELECT `message` FROM Log WHERE `entity.name` = 'gsa-fac-dev' AND allColumnSearch('/api/openid_connect/userinfo', insensitive: true) SINCE 7 DAYS AGO"
}
}
+ widget_stacked_bar {
+ column = 1
+ height = 4
+ id = (known after apply)
+ legend_enabled = true
+ row = 3
+ title = "500 Error Code"
+ width = 12
+ nrql_query {
+ account_id = (known after apply)
+ query = "SELECT count(*) FROM Transaction FACET `request.uri` WHERE response.status = '500' and appName = 'gsa-fac-dev' SINCE 1 week AGO TIMESERIES"
}
}
+ widget_stacked_bar {
+ column = 1
+ height = 3
+ id = (known after apply)
+ legend_enabled = true
+ row = 4
+ title = "Login Requests"
+ width = 8
+ colors {
+ color = "#00ff04"
+ series_overrides {
+ color = "#00ff04"
+ series_name = "/openid/login/"
}
}
+ nrql_query {
+ account_id = (known after apply)
+ query = "SELECT count(*) FROM Transaction FACET `request.uri` WHERE request.uri = '/openid/login/' and appName = 'gsa-fac-dev' SINCE 1 week AGO TIMESERIES"
}
}
+ widget_stacked_bar {
+ column = 1
+ height = 3
+ id = (known after apply)
+ legend_enabled = true
+ row = 5
+ title = "Logout Requests"
+ width = 8
+ colors {
+ color = "#ff0000"
+ series_overrides {
+ color = "#ff0000"
+ series_name = "/openid/logout/"
}
}
+ nrql_query {
+ account_id = (known after apply)
+ query = "SELECT count(*) FROM Transaction FACET `request.uri` WHERE request.uri = '/openid/logout/' and appName = 'gsa-fac-dev' SINCE 1 week AGO TIMESERIES"
}
}
}
}
Plan: 1 to add, 0 to change, 0 to destroy.
Warning: Argument is deprecated
with module.dev-backups-bucket.cloudfoundry_service_instance.bucket,
on /tmp/terraform-data-dir/modules/dev-backups-bucket/s3/main.tf line 14, in resource "cloudfoundry_service_instance" "bucket":
14: recursive_delete = var.recursive_delete
Since CF API v3, recursive delete is always done on the cloudcontroller side.
This will be removed in future releases
(and 6 more similar warnings elsewhere) ✅ Plan applied in Deploy to Development and Management Environment #736 |
Terraform plan for meta No changes. Your infrastructure matches the configuration.
✅ Plan applied in Deploy to Development and Management Environment #736 |
height = 3 | ||
|
||
nrql_query { | ||
query = "SELECT count(`message` as `/admin/login/ hits`) FROM Log WHERE `message` LIKE 'app.fac.gov%/admin/login%' SINCE 7 days ago" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this query work in non-prod environments (looking at the url pattern)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will work, yes, but all dashboard will have it.
Ill modify it a little bit to be each specific environments url.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest commit should fix this:
local tf plans
space = production
query = "SELECT count(`message` as `/admin/login/ hits`) FROM Log WHERE `message` LIKE 'app.fac.gov%/admin/login%' SINCE 7 days ago"
space = preview
"SELECT count(`message` as `/admin/login/ hits`) FROM Log WHERE `message` LIKE 'fac-preview.app.cloud.gov%/admin/login%' SINCE 7 days ago"
Not sure how much the lower env admin panels are used, but this should theoretically work for the dashboard and keep it 100% dynamic
Minimum allowed coverage is Generated by 🐒 cobertura-action against a287f05 |
b7dcff4
to
a287f05
Compare
a287f05
to
b2d618c
Compare
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified FilesNo covered modified files...
|
2f1b822
to
fa2d338
Compare
fa2d338
to
0f28938
Compare
0f28938
to
5885975
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Excellent to have this under version control/infra as code.
This PR creates a dashboard, managed in terraform for each environment that will have all necessary items (as of now) to complete a log review process.
Image for what the dashboard contains can be found here in slack
Dashboard: NR Dashboard (if no one deploys over it in preview)