wu-sheng commented on code in PR #10083:
URL: https://github.com/apache/skywalking/pull/10083#discussion_r1038765267


##########
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/status/ServerStatusService.java:
##########
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.status;
+
+import lombok.RequiredArgsConstructor;
+import org.apache.skywalking.oap.server.library.module.ModuleManager;
+import org.apache.skywalking.oap.server.library.module.Service;
+import org.apache.skywalking.oap.server.telemetry.TelemetryModule;
+import org.apache.skywalking.oap.server.telemetry.api.MetricsCreator;
+import org.apache.skywalking.oap.server.telemetry.api.MetricsTag;
+
+/**
+ * The server status service provides the indicators for the current server 
status.
+ * Notice, this should not be treated as a kind of health checker or self 
telemetry.
+ * For more, this helps modules to be aware of current OAP server status.
+ *
+ * @since 9.4.0
+ */
+@RequiredArgsConstructor
+public class ServerStatusService implements Service {
+    private final ModuleManager manager;
+    private BootingStatus bootingStatus = new BootingStatus();
+
+    public void bootedNow(long uptime) {
+        bootingStatus.setBooted(true);
+        bootingStatus.setUptime(uptime);
+        manager.find(TelemetryModule.NAME)
+               .provider()
+               .getService(MetricsCreator.class)
+               .createGauge("uptime", "oap server start up time", 
MetricsTag.EMPTY_KEY, MetricsTag.EMPTY_VALUE)
+               // Set uptime to second
+               .setValue(uptime / 1000d);

Review Comment:
   At least, when @hanahmily added health checker, it only cares the OAP is 
running or not, rather than inside details. 
   For example, we are not going to expose cluster information to checker, or 
out of process. Right?
   
   From data point, uptime is already  both in health check and telemetry, two 
components. .



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to