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 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
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
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
Loading