diff --git a/lib/private/OpenMetrics/Exporters/AppInfo.php b/lib/private/OpenMetrics/Exporters/AppInfo.php index 3b70657e695..c55ae058072 100644 --- a/lib/private/OpenMetrics/Exporters/AppInfo.php +++ b/lib/private/OpenMetrics/Exporters/AppInfo.php @@ -50,7 +50,7 @@ class AppInfo implements IMetricFamily { $apps = []; $enabledApps = $this->appManager->getEnabledApps(); foreach ($this->appManager->getAppInstalledVersions(false) as $appId => $version) { - yield new Metric(in_array($appId, $enabledApps, true) ? 1 : 0, ['app_name' => $appId, 'version' => $version]); + yield new Metric(in_array($appId, $enabledApps, true) ? 1 : 0, ['app_id' => $appId, 'version' => $version]); } } } diff --git a/tests/lib/OpenMetrics/Exporters/AppInfoTest.php b/tests/lib/OpenMetrics/Exporters/AppInfoTest.php index 79a4eb525de..59737294cde 100644 --- a/tests/lib/OpenMetrics/Exporters/AppInfoTest.php +++ b/tests/lib/OpenMetrics/Exporters/AppInfoTest.php @@ -39,14 +39,14 @@ class AppInfoTest extends ExporterTestCase { public function testMetrics(): void { $this->assertCount(4, $this->metrics); - foreach ($this->appList as $appName => $appVersion) { - $metricForApp = array_find($this->metrics, function (Metric $metric) use ($appName) { - return $metric->label('app_name') === $appName; + foreach ($this->appList as $appId => $appVersion) { + $metricForApp = array_find($this->metrics, function (Metric $metric) use ($appId) { + return $metric->label('app_id') === $appId; }); - $expectedMetricValue = in_array($appName, $this->installedAppsList) ? 1 : 0; + $expectedMetricValue = in_array($appId, $this->installedAppsList) ? 1 : 0; $this->assertEquals($expectedMetricValue, $metricForApp->value); - $this->assertSame(['app_name' => $appName, 'version' => $appVersion], $metricForApp->labels); + $this->assertSame(['app_id' => $appId, 'version' => $appVersion], $metricForApp->labels); } } }