I have a simple Starlark script which checks if field values are not numeric and moves them to tags if so.
My problem is that whenever I copy an entry to tags and delete it in field it also disappears in tags even though I only pop in the field dict.
def apply(metric):
new_tags = {}
for k, v in metric.fields.items():
if type(v) != "float" and type(v) != "int":
new_tags.update({k:v})
metric.fields.pop(k)
metric.tags.update(new_tags.items())
return metric
Deleting the field entries at the end results in the same behaviour.