Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
6 changes: 6 additions & 0 deletions cmd/config-translator/translator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ 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{}
expectedErrorMap["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_collected": {
"emf": {
},
"kubernete": {
}
},
"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": "jvmCluster",
"namespace":"siprmp-jmx"
}
},
"force_flush_interval": 5
}
}
26 changes: 26 additions & 0 deletions translator/tocwconfig/sampleConfig/container_insights_jmx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[agent]
collection_jitter = "0s"
debug = true
flush_interval = "1s"
flush_jitter = "0s"
hostname = ""
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 = "bcd0745edc19"
mode = "EC2"
region = "us-west-2"
region_type = "ACJ"
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.operating.system.total.swap.space.size",
"jvm.operating.system.system.cpu.load",
"jvm.operating.system.process.cpu.load",
"jvm.operating.system.free.swap.space.size",
"jvm.operating.system.total.physical.memory.size",
"jvm.operating.system.free.physical.memory.size",
"jvm.operating.system.open.file.descriptor.count",
"jvm.operating.system.available.processors",
"jvm.threads.count",
"jvm.memory.heap.used",
"jvm.memory.nonheap.init",
"jvm.threads.daemon"
]
}
}
},
"metrics_destinations": {
"cloudwatch": { }
}
}
}
Loading
Loading