import org.sonar.ce.issue.index.NoAsyncIssueIndexing;
import org.sonar.ce.logging.CeProcessLogging;
import org.sonar.ce.monitoring.CEQueueStatusImpl;
-import org.sonar.ce.monitoring.DistributedCEQueueStatusImpl;
import org.sonar.ce.platform.CECoreExtensionsInstaller;
import org.sonar.ce.platform.ComputeEngineExtensionInstaller;
import org.sonar.ce.platform.DatabaseCompatibility;
// System
ServerLogging.class,
+ CEQueueStatusImpl.class,
// SonarSource editions
PlatformEditionProvider.class,
// no cleaning job on sonarcloud and no distributed information
container.add(
NoopCeCleaningSchedulerImpl.class,
- StandaloneCeDistributedInformation.class,
- CEQueueStatusImpl.class);
+ StandaloneCeDistributedInformation.class);
} else if (props.valueAsBoolean(CLUSTER_ENABLED.getKey())) {
container.add(
new CeCleaningModule(),
// system info
DbSection.class,
- ProcessInfoProvider.class,
-
- DistributedCEQueueStatusImpl.class);
+ ProcessInfoProvider.class);
} else {
container.add(
new CeCleaningModule(),
- StandaloneCeDistributedInformation.class,
- CEQueueStatusImpl.class);
+ StandaloneCeDistributedInformation.class);
}
}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2022 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.ce.monitoring;
-
-import org.sonar.api.utils.System2;
-import org.sonar.db.DbClient;
-
-public class DistributedCEQueueStatusImpl extends CEQueueStatusImpl {
- public DistributedCEQueueStatusImpl(DbClient dbClient, System2 system2) {
- super(dbClient, system2);
- }
-
- @Override
- public long getPendingCount() {
- return 0;
- }
-}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2022 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.ce.monitoring;
-
-import org.junit.Test;
-import org.mockito.Mockito;
-import org.sonar.api.utils.System2;
-import org.sonar.db.DbClient;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verifyNoInteractions;
-
-public class DistributedCEQueueStatusImplTest extends CommonCEQueueStatusImplTest {
- private DistributedCEQueueStatusImpl underTest = new DistributedCEQueueStatusImpl(getDbClient(), mock(System2.class));
-
- public DistributedCEQueueStatusImplTest() {
- super(mock(DbClient.class, Mockito.RETURNS_DEEP_STUBS));
- }
-
- @Override
- protected CEQueueStatusImpl getUnderTest() {
- return underTest;
- }
-
- @Test
- public void getPendingCount_returns_0_without_querying_database() {
- assertThat(underTest.getPendingCount()).isZero();
-
- verifyNoInteractions(getDbClient());
- }
-}
| ---|---
| ProcessingTime | Measure the time (in ms) spent to process Background Tasks since the last restart of SonarQube. Its value will always increase and will be reset by a restart of SonarQube. This measure is very powerful when combined with SuccessCount and ErrorCount measures to get the average time to handle a Background Task, or when used to understand how much time the SonarQube Server is spending during a day to handle Background Tasks. It gives you an indication of the load on your server.
| ErrorCount | Number of Background Tasks which failed since the last restart of SonarQube
-| PendingCount | Number of Background Tasks waiting to be processed since the last restart of SonarQube
+| PendingCount | Number of Background Tasks waiting to be processed since the last restart of SonarQube. This measure is the same for all Compute Engine workers since Background Tasks are waiting in a common queue.
| InProgressCount | Number of Background Tasks currently under processing. Its value is either 1 or 0, since SonarQube can process only one task at a time.
| SuccessCount | Number of Background Tasks successfully processed since the last restart of SonarQube
| WorkerCount | Number of Background Tasks that can be processed at the same time
Note: on `jmxremote.password`, you should apply `chmod 600` or `400` for security reasons.
-## Kubernetes Monitoring
+## Prometheus Monitoring
You can monitor your SonarQube instance using SonarQube's native integration with Prometheus. Through this integration, you can ensure your instance is running properly and know if you need to take action to prevent future issues.
Prometheus monitors your SonarQube instance by collecting metrics from the `/api/monitoring/metrics` endpoint. Results are returned in OpenMetrics text format. See Prometheus' documentation on [Exposition Formats](https://prometheus.io/docs/instrumenting/exposition_formats/) for more information on the OpenMetrics text format.