Skip to content

Commit

Permalink
Hotfix remove hardcoded summaries (#79)
Browse files Browse the repository at this point in the history
Dont allow SM of hard-coded types
  • Loading branch information
naxhh authored Feb 11, 2021
1 parent 2f9c1c0 commit 6223488
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 35 deletions.
2 changes: 0 additions & 2 deletions definitions/infra-container/definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,3 @@ goldenTags:
compositeMetrics:
goldenMetrics:
- golden_metrics.yml
summaryMetrics:
- summary_metrics.yml
33 changes: 0 additions & 33 deletions definitions/infra-container/summary_metrics.yml

This file was deleted.

40 changes: 40 additions & 0 deletions validator/tools/validate_uniqueness.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,46 @@ const RULES = [
ENTITY.set(identifier, def)
}
}
},
{
name: 'Summary metrics for this type are not allowed',
apply: def => {
const notAllowed = [
// Types with not exposed functionality.
"INFRA-AZUREVIRTUALNETWORKSPUBLICIPADDRESS",
"INFRA-CONTAINER",
"INFRA-COUCHBASENODE",
"INFRA-F5NODE",
"INFRA-F5POOL",
"INFRA-F5POOLMEMEBER",
"INFRA-F5VIRTUALSERVER",
"INFRA-F5VIRTUALSERVER",
"INFRA-HOST",
"INFRA-KUBERNETESCLUSTER",
"INFRA-RABBITMQNODE",
"MOBILE-APPLICATION",

// Types with special implementations.
"APM-APPLICATION",
"BROWSER-APPLICATION",
"EXT-SERVICE",
"INFRA-AWSLAMBDAFUNCTION",
"NR1-WORKLOADS",
"PROTO-ENGGROUP",
"PROTO-TEAM",
"SYNTH-MONITOR",
"SYNTH-SECURED",
"VIZ-DASHBOARD",
]


const domainType = def.domain + "-" + def.type
const hasSummaryMetrics = 'compositeMetrics' in def && 'summaryMetrics' in def['compositeMetrics']

if (notAllowed.includes(domainType) && hasSummaryMetrics) {
throw `We don't allow custom summary metrics for ${domainType}. Please open an issue if you want to change this type.`
}
}
}
]

Expand Down

0 comments on commit 6223488

Please sign in to comment.