Skip to content

Commit

Permalink
Workaround tsdb not supporting bool dimension
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonip committed Jul 26, 2024
1 parent 4d03f98 commit 98f5d7c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions exporter/elasticsearchexporter/internal/objmodel/objmodel.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,15 @@ func (v *Value) iterJSON(w *json.Visitor, dedot bool, otel bool) error {
case KindNil:
return w.OnNil()
case KindBool:
if otel {
// FIXME: workaround for TSDB not supporting bool dimension
// https://github.com/elastic/elasticsearch/issues/111338
if v.primitive == 1 {
return w.OnString("true")
} else {
return w.OnString("false")
}
}
return w.OnBool(v.primitive == 1)
case KindInt:
return w.OnInt64(int64(v.primitive))
Expand Down

0 comments on commit 98f5d7c

Please sign in to comment.