Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop original metrics support added for all metrics. #1206

Merged
merged 17 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from 12 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
18 changes: 18 additions & 0 deletions translator/config/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,12 @@
},
"metrics_aggregation_interval": {
"$ref": "#/definitions/timeIntervalWithZeroDefinition"
},
"drop_original_metrics": {
"type": "array",
"items": { "type": "string" },
"minItems": 1,
"uniqueItems": true
}
},
"additionalProperties": false
Expand Down Expand Up @@ -337,6 +343,12 @@
"type": "string",
"minLength": 1,
"maxLength": 255
},
"drop_original_metrics": {
"type": "array",
"items": { "type": "string" },
"minItems": 1,
"uniqueItems": true
}
},
"additionalProperties": false
Expand Down Expand Up @@ -471,6 +483,12 @@
},
"append_dimensions": {
"$ref": "#/definitions/generalAppendDimensionsDefinition"
},
"drop_original_metrics": {
"type": "array",
"items": { "type": "string" },
"minItems": 1,
"uniqueItems": true
}
},
"additionalProperties": false
Expand Down
10 changes: 8 additions & 2 deletions translator/tocwconfig/sampleConfig/complete_linux_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@
"collectd_typesdb": [
"/usr/share/collectd/types.db"
],
"metrics_aggregation_interval": 60
"metrics_aggregation_interval": 60,
"drop_original_metrics": [
"collectd_drop"
]
},
"cpu": {
"resources": [
Expand Down Expand Up @@ -155,7 +158,10 @@
"service_address": ":8125",
"metrics_collection_interval": 10,
"metrics_aggregation_interval": 60,
"metric_separator": "_"
"metric_separator": "_",
"drop_original_metrics": [
"statsd_drop"
]
},
"swap": {
"measurement": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ exporters:
awscloudwatch:
drop_original_metrics:
CPU_USAGE_IDLE: true
collectd_drop: true
cpu_time_active: true
statsd_drop: true
endpoint_override: https://monitoring-fips.us-west-2.amazonaws.com
force_flush_interval: 1m0s
max_datums_per_call: 1000
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"metrics": {
"metrics_collected": {
"collectd": {
"collectd_security_level": "none",
musa-asad marked this conversation as resolved.
Show resolved Hide resolved
"drop_original_metrics": ["collectd_drop"]
},
"cpu": {
"drop_original_metrics": ["cpu_usage_idle", "time_active"],
"measurement": [
Expand All @@ -19,8 +23,18 @@
]
},
"disk": {},
"ethtool": {
"metrics_include": [
"rx_packets",
"tx_packets"
],
"drop_original_metrics": ["tx_packets"]
},
"nvidia_gpu": {
"drop_original_metrics": ["utilization_gpu", "temperature_gpu"]
},
"statsd": {
"drop_original_metrics": ["statsd_drop"]
}
},
"aggregation_dimensions" : [["ImageId"], ["InstanceId", "InstanceType"], ["d1"], []],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,14 @@ func getDropOriginalMetrics(conf *confmap.Conf) map[string]bool {
*/
if dropMetrics := common.GetArray[any](conf, dropOriginalCfgKey); dropMetrics != nil {
for _, dropMetric := range dropMetrics {
if category == "collectd" || category == "statsd" || category == "ethtool" {
musa-asad marked this conversation as resolved.
Show resolved Hide resolved
musa-asad marked this conversation as resolved.
Show resolved Hide resolved
dropMetric, ok := dropMetric.(string)
if ok {
dropOriginalMetrics[dropMetric] = true
}
continue
}

measurements := common.GetArray[any](conf, measurementCfgKey)
if measurements == nil {
continue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ func TestTranslator(t *testing.T) {
RollupDimensions: [][]string{{"ImageId"}, {"InstanceId", "InstanceType"}, {"d1"}, {}},
DropOriginalConfigs: map[string]bool{
"CPU_USAGE_IDLE": true,
"collectd_drop": true,
"cpu_time_active": true,
"statsd_drop": true,
"tx_packets": true,
},
},
wantWindows: &cloudwatch.Config{
Expand All @@ -131,7 +134,10 @@ func TestTranslator(t *testing.T) {
RollupDimensions: [][]string{{"ImageId"}, {"InstanceId", "InstanceType"}, {"d1"}, {}},
DropOriginalConfigs: map[string]bool{
"CPU_USAGE_IDLE": true,
"collectd_drop": true,
"cpu time_active": true,
"statsd_drop": true,
"tx_packets": true,
},
},
},
Expand Down
Loading