Skip to content

Commit

Permalink
remove php metric
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Jun 3, 2023
1 parent 3b8990f commit e8dd10d
Show file tree
Hide file tree
Showing 20 changed files with 7 additions and 56 deletions.
5 changes: 4 additions & 1 deletion src/Actions/RenderCollectorsAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class RenderCollectorsAction
{
public function __construct(protected CollectorRegistry $registry)
{

}

public function execute(array $collectors): string
Expand All @@ -24,7 +25,9 @@ protected function renderRegistry(): string
{
$renderer = new RenderTextFormat();

$result = $renderer->render($this->registry->getMetricFamilySamples());
$metricSamples = $this->registry->getMetricFamilySamples();

$result = $renderer->render($metricSamples);

$this->registry->wipeStorage();

Expand Down
2 changes: 1 addition & 1 deletion src/PrometheusServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function packageRegistered()
$this->app->alias(Prometheus::class, 'prometheus');

$this->app->scoped(CollectorRegistry::class, function () {
return new CollectorRegistry(new InMemory());
return new CollectorRegistry(new InMemory(), false);
});
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# HELP app_horizon_master_supervisors The number of master supervisors
# TYPE app_horizon_master_supervisors gauge
app_horizon_master_supervisors 0
# HELP php_info Information about the PHP environment.
# TYPE php_info gauge
php_info{version="8.2.0"} 1
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# HELP php_info Information about the PHP environment.
# TYPE php_info gauge
php_info{version="8.2.0"} 1

Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# HELP app_horizon_failed_jobs_per_hour The number of recently failed jobs
# TYPE app_horizon_failed_jobs_per_hour gauge
app_horizon_failed_jobs_per_hour 0
# HELP php_info Information about the PHP environment.
# TYPE php_info gauge
php_info{version="8.2.0"} 1
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# HELP app_horizon_status The status of Horizon, -1 = inactive, 0 = paused, 1 = running
# TYPE app_horizon_status gauge
app_horizon_status -1
# HELP php_info Information about the PHP environment.
# TYPE php_info gauge
php_info{version="8.2.0"} 1
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# HELP app_horizon_jobs_per_minute The number of jobs per minute
# TYPE app_horizon_jobs_per_minute gauge
app_horizon_jobs_per_minute 0
# HELP php_info Information about the PHP environment.
# TYPE php_info gauge
php_info{version="8.2.0"} 1
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@
# TYPE app_my_gauge gauge
app_my_gauge{label_name="label_value"} 123
app_my_gauge{label_name="label_value_2"} 456
# HELP php_info Information about the PHP environment.
# TYPE php_info gauge
php_info{version="8.2.0"} 1
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@
# TYPE app_my_gauge gauge
app_my_gauge{label_name="label_value"} 123
app_my_gauge{label_name="label_value_2"} 456
# HELP php_info Information about the PHP environment.
# TYPE php_info gauge
php_info{version="8.2.0"} 1
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# HELP app_my_gauge
# TYPE app_my_gauge gauge
app_my_gauge{label_name="label_value"} 123
# HELP php_info Information about the PHP environment.
# TYPE php_info gauge
php_info{version="8.2.0"} 1
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# HELP app_my_gauge
# TYPE app_my_gauge gauge
app_my_gauge 123.45
# HELP php_info Information about the PHP environment.
# TYPE php_info gauge
php_info{version="8.2.0"} 1
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# HELP other_namespace_alternative_name This is the help text
# TYPE other_namespace_alternative_name gauge
other_namespace_alternative_name 123.45
# HELP php_info Information about the PHP environment.
# TYPE php_info gauge
php_info{version="8.2.0"} 1
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@
# TYPE other_namespace_my_gauge gauge
other_namespace_my_gauge{label_name_1="label_value_1",label_name_2="label_value_2"} 123
other_namespace_my_gauge{label_name_1="label_value_3",label_name_2="label_value_4"} 124
# HELP php_info Information about the PHP environment.
# TYPE php_info gauge
php_info{version="8.2.0"} 1
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# HELP app_my_gauge
# TYPE app_my_gauge gauge
app_my_gauge 123.45
# HELP php_info Information about the PHP environment.
# TYPE php_info gauge
php_info{version="8.2.0"} 1
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# HELP custom_namespace_my_gauge
# TYPE custom_namespace_my_gauge gauge
custom_namespace_my_gauge 123.45
# HELP php_info Information about the PHP environment.
# TYPE php_info gauge
php_info{version="8.2.0"} 1
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# HELP app_my_gauge
# TYPE app_my_gauge gauge
app_my_gauge 123.45
# HELP php_info Information about the PHP environment.
# TYPE php_info gauge
php_info{version="8.2.0"} 1
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# HELP php_info Information about the PHP environment.
# TYPE php_info gauge
php_info{version="8.2.0"} 1

Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# HELP app_my_default_gauge
# TYPE app_my_default_gauge gauge
app_my_default_gauge 123.45
# HELP php_info Information about the PHP environment.
# TYPE php_info gauge
php_info{version="8.2.0"} 1
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# HELP app_horizon_status The status of Horizon, -1 = inactive, 0 = paused, 1 = running
# TYPE app_horizon_status gauge
app_horizon_status -1
# HELP php_info Information about the PHP environment.
# TYPE php_info gauge
php_info{version="8.2.0"} 1
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# HELP app_horizon_recent_jobs The number of recent jobs
# TYPE app_horizon_recent_jobs gauge
app_horizon_recent_jobs 0
# HELP php_info Information about the PHP environment.
# TYPE php_info gauge
php_info{version="8.2.0"} 1

0 comments on commit e8dd10d

Please sign in to comment.