Description
Hi!
Got problem when using counters for future exponsing for prometheus with Redis adapter
Scenario
I've has config with redis prefix ($redis->setOption(\Redis::OPT_PREFIX, 'a')
)
Increment some counter via lib getOrCreateCounter('space', 'name', 'help')->inc()
In redis db counter persisted in similiar name - aPROMETHEUS_counter_METRIC_KEYS, and hash table - aPROMETHEUS_:counter:space_name
Want to get all metrics via controller $registry->getMetricFamilySamples()
but got no samples in result
With debug I found strange code - $raw = $this->redis->hGetAll(str_replace($this->redis->_prefix(''), '', $key));
That str_replace in total will replace all symbols a
with emptyness - so I got PROMETHEUS_:counter:spce_nme
instead of PROMETHEUS_:counter:space_name
I think possible solution is use ltrim($key, $this->redis->_prefix('')) instead of str_replace