Skip to content

Commit

Permalink
atlas cloudwatch: add Per-VPC mapping.
Browse files Browse the repository at this point in the history
And remove the common nf.region tag from the reference.conf. Move it
to the test application file instead. Entailed cleaning up a couple of
DefaultTagger unit tests.
  • Loading branch information
manolama committed Mar 31, 2023
1 parent fb6d061 commit 977b6d4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
8 changes: 4 additions & 4 deletions atlas-cloudwatch/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,10 @@ atlas {
name = "OutputGroupName"
alias = "aws.output-group"
},
{
name = "Per-VPC Metrics"
alias = "aws.vpc"
},
{
name = "Pipeline"
alias = "aws.pipeline"
Expand Down Expand Up @@ -495,10 +499,6 @@ atlas {

// Tags that should get applied to all metrics from cloudwatch.
common-tags = [
{
key = "nf.region"
value = "us-west-2"
}
]

// When using the netflix mapper, this setting specifies which keys should get
Expand Down
11 changes: 10 additions & 1 deletion atlas-cloudwatch/src/test/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ atlas {

poller {

// Set to a large value because we don't want it running during tests
# Set to a large value because we don't want it running during tests
frequency = 60 minutes

pollers = [
Expand Down Expand Up @@ -57,6 +57,15 @@ atlas {
}
}
}

tagger = {
common-tags = [
{
key = "nf.region"
value = "us-west-2"
}
]
}
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,7 @@ class DefaultTaggerSuite extends FunSuite {
val tagger = new DefaultTagger(cfg.getConfig("atlas.cloudwatch.tagger"))

val expected = Map(
"aws.alb" -> "captured-portion",
"nf.region" -> "us-west-2"
"aws.alb" -> "captured-portion"
)

val actual = tagger(
Expand All @@ -365,8 +364,7 @@ class DefaultTaggerSuite extends FunSuite {
val tagger = new DefaultTagger(cfg.getConfig("atlas.cloudwatch.tagger"))

val expected = Map(
"aws.nlb" -> "captured-portion",
"nf.region" -> "us-west-2"
"aws.nlb" -> "captured-portion"
)

val actual = tagger(
Expand Down

0 comments on commit 977b6d4

Please sign in to comment.