Transformer contains a sync.Map for thread-safe access to cached results, and a function transformFunc that will do the actual relabeling. VictoriaMetrics uses function result caching for its relabeling feature, but doesn’t use it for caching database queries. As with strings interning, functions results caching works the best if number of cached variants is limited, so you can achieve high cache hit rate.