Skip to content

Commit

Permalink
DDEV-1965 delete prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadim Davydenko committed Nov 20, 2024
1 parent d9aafdd commit 4499d3f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion config/prometheus.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
// ],
// or
// 'octane-cache' => [
// 'prefix' => 'metrics'
// ],
'label_middlewares' => [
// \Ensi\LaravelPrometheus\LabelMiddlewares\AppNameLabelMiddleware::class,
Expand Down
2 changes: 1 addition & 1 deletion src/MetricsBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ private function getStorage(): Adapter
case array_key_exists('memory', $this->config):
return new InMemory();
case array_key_exists('octane-cache', $this->config):
return new OctaneCache($this->config['octane-cache']['prefix']);
return new OctaneCache();
case array_key_exists('null-storage', $this->config):
return new NullStorage();
}
Expand Down
6 changes: 1 addition & 5 deletions src/Storage/OctaneCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

class OctaneCache implements Adapter
{
public const PROMETHEUS_PREFIX = 'PROMETHEUS_';

private Table $gauges;
private Table $gaugeValues;

Expand All @@ -33,7 +31,7 @@ class OctaneCache implements Adapter
* Redis constructor.
* @param mixed[] $options
*/
public function __construct(private string $prometheusPrefix = self::PROMETHEUS_PREFIX)
public function __construct()
{
$this->gauges = Octane::table('gauges');
$this->gaugeValues = Octane::table('gauge_values');
Expand Down Expand Up @@ -506,7 +504,6 @@ private function clearTable(Table $table): void
private function valueKey(array $data): string
{
return implode(':', [
$this->prometheusPrefix,
$data['type'],
$data['name'],
$this->encodeLabelValues($data['labelValues']),
Expand Down Expand Up @@ -534,7 +531,6 @@ private function implodeKeysString(string $keys, string $key): string
protected function metaKey(array $data): string
{
return implode(':', [
$this->prometheusPrefix,
$data['type'],
$data['name'],
'meta',
Expand Down

0 comments on commit 4499d3f

Please sign in to comment.