Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cmd/config-translator/translator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ func TestMetricsDestinationsConfig(t *testing.T) {
expectedErrorMap["required"] = 1
checkIfSchemaValidateAsExpected(t, "../../translator/config/sampleSchema/invalidMetricsDestinations.json", false, expectedErrorMap)
}
func TestJmxConfig(t *testing.T) {
checkIfSchemaValidateAsExpected(t, "../../translator/config/sampleSchema/validContainerInsightsJmx.json", true, map[string]int{})
expectedErrorMap := map[string]int{"additional_property_not_allowed": 1, "number_any_of": 1, "required": 1}
checkIfSchemaValidateAsExpected(t, "../../translator/config/sampleSchema/invalidContainerInsightsJmx.json", false, expectedErrorMap)
}

// Validate all sampleConfig files schema
func TestSampleConfigSchema(t *testing.T) {
Expand Down
14 changes: 14 additions & 0 deletions translator/config/sampleSchema/invalidContainerInsightsJmx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"agent": {
"region": "us-west-2"
},
"logs": {
"metrics": {
"emf": {
},
"kubernetes": {
}
},
"force_flush_interval": 5
}
}
16 changes: 16 additions & 0 deletions translator/config/sampleSchema/validContainerInsightsJmx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"agent": {
"region": "us-west-2"
},
"logs": {
"metrics_collected": {
"emf": {
},
"kubernetes": {
"cluster_name": "TestCluster",
"jmx_container_insights": true
}
},
"force_flush_interval": 5
}
}
28 changes: 28 additions & 0 deletions translator/tocwconfig/sampleConfig/container_insights_jmx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[agent]
collection_jitter = "0s"
debug = true
flush_interval = "1s"
flush_jitter = "0s"
hostname = "host_name_from_env"
interval = "60s"
logfile = ""
logtarget = "lumberjack"
metric_batch_size = 1000
metric_buffer_limit = 10000
omit_hostname = false
precision = ""
quiet = false
round_interval = false

[outputs]

[[outputs.cloudwatch]]

[[outputs.cloudwatchlogs]]
force_flush_interval = "5s"
log_stream_name = "host_name_from_env"
mode = "OP"
profile = "AmazonCloudWatchAgent"
region = "us-west-2"
region_type = "ACJ"
shared_credential_file = "fake-path"
41 changes: 41 additions & 0 deletions translator/tocwconfig/sampleConfig/container_insights_jmx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"agent": {
"debug": true
},
"logs": {
"metrics_collected": {
"emf": { },
"kubernetes": {
"cluster_name": "TestCluster",
"jmx_container_insights": true
}
}
},
"metrics": {
"metrics_collected": {
"jmx": {
"jvm": {
"measurement": [
"jvm.classes.loaded",
"jvm.memory.pool.used",
"jvm.system.swap.space.total",
"jvm.system.cpu.utilization",
"jvm.cpu.recent_utilization",
"jvm.system.swap.space.free",
"jvm.system.physical.memory.total",
"jvm.system.physical.memory.free",
"jvm.open_file_descriptor.count",
"jvm.system.available.processors",
"jvm.threads.count",
"jvm.memory.heap.used",
"jvm.memory.nonheap.init",
"jvm.threads.daemon"
]
}
}
},
"metrics_destinations": {
"cloudwatch": { }
}
}
}
Loading
Loading