Skip to content

Commit 46874d9

Browse files
committed
feat: add rollup
1 parent 97fb060 commit 46874d9

File tree

4 files changed

+52
-61
lines changed

4 files changed

+52
-61
lines changed

.github/workflows/run-workflow-production.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,6 @@ jobs:
8080
AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_NUMBER }}
8181
run: |
8282
./bin/run snapshot setup
83-
84-
- name: workflow-cli rollup job setup
85-
working-directory: ./workflow-cli
86-
env:
87-
AWS_REGION: ${{ vars.AWS_REGION }}
88-
OS_URL: apm.io.nrs.gov.bc.ca
89-
OS_DOMAIN: nress-prod
90-
AWS_ACCOUNT_NUMBER: ${{ secrets.AWS_ACCOUNT_NUMBER }}
91-
run: |
92-
./bin/run opensearch-sync-rollup
9383
9484
- name: Close intention
9585
uses: bcgov-nr/action-broker-intention-close@v2

workflow-cli/configuration-opensearch/index_template/access_rollup.json renamed to workflow-cli/configuration-opensearch/index_template/accessrollup.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"index_patterns": ["nrm-access-url-rollup*"],
2+
"index_patterns": ["nrm-accessrollup"],
33
"template": {
44
"settings": {
55
"number_of_shards": 1,

workflow-cli/configuration-opensearch/rollup_index_jobs/nrm_access_url_rollup.json

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

workflow-cli/configuration-opensearch/state_management_policy/nrm-type-access-external-policy.json

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,62 @@
1212
"actions": [],
1313
"transitions": [
1414
{
15-
"state_name": "scaled",
15+
"state_name": "rp",
1616
"conditions": {
17-
"min_index_age": "4d"
17+
"min_index_age": "1d"
1818
}
1919
}
2020
]
2121
},
22+
{
23+
"name": "rp",
24+
"actions": [
25+
{
26+
"rollup": {
27+
"ism_rollup": {
28+
"target_index": "nrm-accessrollup",
29+
"description": "nrm access external rollup job",
30+
"page_size": 200,
31+
"dimensions": [
32+
{
33+
"date_histogram": {
34+
"source_field": "@timestamp",
35+
"fixed_interval": "60m",
36+
"timezone": "America/Vancouver"
37+
}
38+
},
39+
{
40+
"terms": {
41+
"source_field": "url.path"
42+
}
43+
},
44+
{
45+
"terms": {
46+
"source_field": "url.domain"
47+
}
48+
}
49+
],
50+
"metrics": [
51+
{
52+
"source_field": "event.outcome",
53+
"metrics": [{"value_count":{}}]
54+
},
55+
{
56+
"source_field": "event.duration",
57+
"metrics": [{"avg": {}}]
58+
}
59+
]
60+
}
61+
}
62+
}
63+
],
64+
"transitions": [{
65+
"state_name": "scaled",
66+
"conditions": {
67+
"min_index_age": "4d"
68+
}
69+
}]
70+
},
2271
{
2372
"name": "scaled",
2473
"actions": [

0 commit comments

Comments
 (0)