[METRICS-390] Fix string handling for TSDB prefix and tags