Skip to content

Commit 1322bef

Browse files
authored
Signalfx exporter: add translations for filesystem metrics (#584)
1 parent 368adbd commit 1322bef

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

exporter/signalfxexporter/factory_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func TestCreateMetricsExporterWithDefaultTranslaitonRules(t *testing.T) {
176176

177177
// Validate that default translation rules are loaded
178178
// Expected values has to be updated once default config changed
179-
assert.Equal(t, 12, len(config.TranslationRules))
179+
assert.Equal(t, 14, len(config.TranslationRules))
180180
assert.Equal(t, translation.ActionRenameDimensionKeys, config.TranslationRules[0].Action)
181181
assert.Equal(t, 20, len(config.TranslationRules[0].Mapping))
182182
}

exporter/signalfxexporter/translation/constants.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,21 @@ translation_rules:
182182
free: memory.free
183183
slab_reclaimable: memory.slab_recl
184184
slab_unreclaimable: memory.slab_unrecl
185-
used: memory.used
185+
used: memory.used
186+
187+
# convert filesystem metrics
188+
- action: split_metric
189+
metric_name: system.filesystem.usage
190+
dimension_key: state
191+
mapping:
192+
free: df_complex.free
193+
reserved: df_complex.reserved
194+
used: df_complex.used
195+
- action: split_metric
196+
metric_name: system.filesystem.inodes.usage
197+
dimension_key: state
198+
mapping:
199+
free: df_inodes.free
200+
used: df_inodes.used
186201
`
187202
)

0 commit comments

Comments
 (0)