Skip to content

Commit efe0268

Browse files
authored
[ BB2-943 ] BFD-Insights update Athena views and log utility (#1002)
* Update log export tools and readme - Update the utlity program to handle both Cloudwatch and Splunk exports. - Update the S3 file upload shell script. - Update the readme.md for how to use the tool. BB2-943 * Update Athena view SQL and readme - Remove previous versions. - Add new view SQL for impl/Sandbox. - Update the readme.md for how to use. BB2-943 * Create views for PROD and TEST * Update readme.md * Update athena views with new metrics * Update readme.md * Rename grants to grant for consistency * Create lambda that creates table for Quicksight * Add FHIR/AUTH metrics to views * Update for flake8 * Update for LGTM warning
1 parent bc028f5 commit efe0268

14 files changed

+2706
-306
lines changed

insights/athena/readme.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,41 @@
22

33
In between the Kinesis Firehose log streams and QuickSights there are Athena views setup for mapping the reporting data.
44

5-
65
## Global State per Application View
76

8-
VIEW NAME: vw_global_state_per_app
7+
VIEW NAME: vw_<test|impl|prod>_global_state_per_app
98

10-
FILE: views_sql/vw_global_state_per_app.sql
9+
FILE: views_sql/vw_<test|impl|prod>_global_state_per_app.sql
1110

12-
Summary:
11+
NOTE: There is a separate view for each BB2 ENV logging area.
12+
13+
### Summary:
1314

14-
* This is a JOIN of top level BB2 stats from the `bb2.events_global_state` table and per application stats from the `bb2.events_global_state_apps` table in athena.
15+
* This is a JOIN of top level BB2 stats from the `bb2.events_<test|impl|prod>_perf_mon` table with type="global_state_metrics_per_app" and per application stats from the same table with type="global_state_metrics" table in athena.
1516

16-
* This returns sets of data grouped by `vpc` and `week_number`.
17+
* This returns sets of data grouped by `vpc`, `year` and `week_number`.
1718

18-
* This excludes our internal testing applications from the per application results.
19+
* This excludes our internal testing applications from the per application results. NOTE: This may need updated on occasion for any future changes
1920

21+
* To test or view results via the Athena SQL editor use the following for the target ENV:
22+
```
23+
SELECT * FROM "bb2"."vw_<test|impl|prod>_global_state_per_app"
24+
```
2025

2126
## Global State View
2227

23-
VIEW NAME: vw_global_state
28+
VIEW NAME: vw_<test|impl|prod>_global_state
2429

25-
FILE: views_sql/vw_global_state.sql
30+
FILE: views_sql/vw_<test|impl|prod>_global_state.sql
2631

2732
Summary:
2833

29-
* This utilizis the `vw_global_state_per_app` view to produce counts of apps and bene data grouped by `vpc` & `week_number`.
34+
* This utilizis the `vw_<test|impl|prod>_global_state_per_app` view to produce counts of apps and bene data grouped by `vpc`, `year` & `week_number`.
35+
36+
* To test or view results via the Athena SQL editor use the following for the target ENV:
37+
```
38+
SELECT * FROM "bb2"."vw_<test|impl|prod>_global_state"
39+
```
3040

3141

3242
# HOW-TO: Update Athena Views For SQL Changes
@@ -62,3 +72,5 @@ The following is a general procedure for updating Athena views and QuickSight da
6272
14. Edit your existing Analyses that are utlizing the dataset related to the changes.
6373

6474
15. Commit your SQL file changes back to the repository via PR.
75+
76+
NOTE: When editing SQL an alternate online formatter can be used vs. the built-in one in Athena.

insights/athena/views_sql/vw_global_state.sql

Lines changed: 0 additions & 49 deletions
This file was deleted.

insights/athena/views_sql/vw_global_state_per_app.sql

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)