Skip to content

Commit ef264a1

Browse files
committed
add bool support
Signed-off-by: Markus Blaschke <[email protected]>
1 parent 0865563 commit ef264a1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

config/config.go

+12
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,12 @@ func (m *MetricPathConfig) ParseLabel(val interface{}) (ret string) {
187187
ret = fmt.Sprintf("%d", v)
188188
case string:
189189
ret = v
190+
case bool:
191+
if v {
192+
ret = "true"
193+
} else {
194+
ret = "false"
195+
}
190196
}
191197

192198
return m.DoConvertLabel(ret)
@@ -201,6 +207,12 @@ func (m *MetricPathConfig) ParseValue(val interface{}) (ret *float64) {
201207
valueString = fmt.Sprintf("%d", v)
202208
case string:
203209
valueString = v
210+
case bool:
211+
if v {
212+
valueString = "1"
213+
} else {
214+
valueString = "0"
215+
}
204216
}
205217

206218
return m.DoConvertValue(valueString)

0 commit comments

Comments
 (0)