Mark dimension properties as tags in influx
@@ -174,6 +174,9 @@ public class DataLakeInfluxDbClient {
Point.Builder p = Point.measurement(measureName).time(timestampValue, TimeUnit.MILLISECONDS);
for (Map.Entry<String, Object> pair : event.getRaw().entrySet()) {
+ if (tagFields != null && tagFields.stream().anyMatch(tag -> tag.equals(pair.getKey()))) {
+ p.tag(pair.getKey(), pair.getValue().toString());
+ } else {
if (pair.getValue() instanceof Integer) {
p.addField(DataLake.prepareString(pair.getKey()), (Integer) pair.getValue());
} else if (pair.getValue() instanceof Long) {
@@ -186,6 +189,7 @@ public class DataLakeInfluxDbClient {
p.addField(DataLake.prepareString(pair.getKey()), pair.getValue().toString());
}
}
+ }
influxDb.write(p.build());
}
