Skip to content

Commit 98f5d7c

Browse files
committed
Workaround tsdb not supporting bool dimension
1 parent 4d03f98 commit 98f5d7c

File tree

1 file changed

+9
-0
lines changed
  • exporter/elasticsearchexporter/internal/objmodel

1 file changed

+9
-0
lines changed

exporter/elasticsearchexporter/internal/objmodel/objmodel.go

+9
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,15 @@ func (v *Value) iterJSON(w *json.Visitor, dedot bool, otel bool) error {
497497
case KindNil:
498498
return w.OnNil()
499499
case KindBool:
500+
if otel {
501+
// FIXME: workaround for TSDB not supporting bool dimension
502+
// https://github.com/elastic/elasticsearch/issues/111338
503+
if v.primitive == 1 {
504+
return w.OnString("true")
505+
} else {
506+
return w.OnString("false")
507+
}
508+
}
500509
return w.OnBool(v.primitive == 1)
501510
case KindInt:
502511
return w.OnInt64(int64(v.primitive))

0 commit comments

Comments
 (0)