Skip to content

Commit

Permalink
sfxexporter: Update disk.summary_utilization translation rule to acco…
Browse files Browse the repository at this point in the history
…modate new labels (#1258)

Update translation rules to mean over "mode" and "mountpoint"  which are recently added
labels to the filesystems scraper in hostmetrics receiver. This will ensure utilization
is not double counted across mountpoints of a single device. Also, add "type"
(also a newly added label) to existing translation rules to sum across fs types as well
apart from device name.
  • Loading branch information
asuresh4 authored Oct 15, 2020
1 parent f1b6b1a commit c36d7a0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion exporter/signalfxexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func TestCreateMetricsExporterWithDefaultTranslaitonRules(t *testing.T) {

// Validate that default translation rules are loaded
// Expected values has to be updated once default config changed
assert.Equal(t, 49, len(config.TranslationRules))
assert.Equal(t, 51, len(config.TranslationRules))
assert.Equal(t, translation.ActionRenameDimensionKeys, config.TranslationRules[0].Action)
assert.Equal(t, 33, len(config.TranslationRules[0].Mapping))
}
Expand Down
16 changes: 15 additions & 1 deletion exporter/signalfxexporter/translation/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,12 +376,19 @@ translation_rules:
- action: copy_metrics
mapping:
system.filesystem.usage: disk.summary_total
- action: aggregate_metric
metric_name: disk.summary_total
aggregation_method: avg
without_dimensions:
- mode
- mountpoint
- action: aggregate_metric
metric_name: disk.summary_total
aggregation_method: sum
without_dimensions:
- state
- device
- type
# convert filesystem metrics
- action: split_metric
Expand All @@ -401,12 +408,19 @@ translation_rules:
# df_complex.used_total
- action: copy_metrics
mapping:
df_complex.used: df_complex.used_total
df_complex.used: df_complex.used_total
- action: aggregate_metric
metric_name: df_complex.used_total
aggregation_method: avg
without_dimensions:
- mode
- mountpoint
- action: aggregate_metric
metric_name: df_complex.used_total
aggregation_method: sum
without_dimensions:
- device
- type
# disk utilization
- action: calculate_new_metric
Expand Down

0 comments on commit c36d7a0

Please sign in to comment.