You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2022/12/03 09:58:33 UTC
[GitHub] [skywalking] wu-sheng opened a new pull request, #10083: Add `ServerStatusService` in the core module
wu-sheng opened a new pull request, #10083:
URL: https://github.com/apache/skywalking/pull/10083
<!--
⚠️ Please make sure to read this template first, pull requests that don't accord with this template
maybe closed without notice.
Texts surrounded by `<` and `>` are meant to be replaced by you, e.g. <framework name>, <issue number>.
Put an `x` in the `[ ]` to mark the item as CHECKED. `[x]`
-->
<!-- ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👇 ====
### Fix <bug description or the bug issue number or bug issue link>
- [ ] Add a unit test to verify that the fix works.
- [ ] Explain briefly why the bug exists and how to fix it.
==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👆 ==== -->
<!-- ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👇 ====
### Improve the performance of <class or module or ...>
- [ ] Add a benchmark for the improvement, refer to [the existing ones](https://github.com/apache/skywalking/blob/master/apm-commons/apm-datacarrier/src/test/java/org/apache/skywalking/apm/commons/datacarrier/LinkedArrayBenchmark.java)
- [ ] The benchmark result.
```text
<Paste the benchmark results here>
```
- [ ] Links/URLs to the theory proof or discussion articles/blogs. <links/URLs here>
==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👆 ==== -->
<!-- ==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👇 ====
### <Feature description>
- [ ] If this is non-trivial feature, paste the links/URLs to the design doc.
- [ ] Update the documentation to include this new feature.
- [ ] Tests(including UT, IT, E2E) are added to verify the new feature.
- [ ] If it's UI related, attach the screenshots below.
==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👆 ==== -->
- [ ] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #<issue number>.
- [x] Update the [`CHANGES` log](https://github.com/apache/skywalking/blob/master/docs/en/changes/changes.md).
Add `ServerStatusService` in the core module to provide a new way to expose the booting status to other modules. This helps on #10051
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking] kezhenxu94 commented on pull request #10083: Add `ServerStatusService` in the core module
Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on PR #10083:
URL: https://github.com/apache/skywalking/pull/10083#issuecomment-1336150064
> If I follow what you are asking, do you mean other modules should react based on the telemetry module's data? That is not correct from my understanding.
I don't mean that. Let's say in another way, if you insist we should add the new service in core module, I hope finally we can rewrite the telemetry module to reuse the server status logics in core module, that should make sense right?
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking] wu-sheng commented on a diff in pull request #10083: Add `ServerStatusService` in the core module
Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #10083:
URL: https://github.com/apache/skywalking/pull/10083#discussion_r1038759023
##########
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:
I moved the logic here to keep consistent. @kezhenxu94
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking] wu-sheng commented on pull request #10083: Add `ServerStatusService` in the core module
Posted by GitBox <gi...@apache.org>.
wu-sheng commented on PR #10083:
URL: https://github.com/apache/skywalking/pull/10083#issuecomment-1336148913
If I follow what you are asking, do you mean other modules should react based on the telemetry module's data? That is not correct from my understanding.
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking] kezhenxu94 commented on a diff in pull request #10083: Add `ServerStatusService` in the core module
Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on code in PR #10083:
URL: https://github.com/apache/skywalking/pull/10083#discussion_r1038764171
##########
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:
This doesn't make sense to me. You are essentially proposing to replicate the health checker module in the core module again. What's the boundary to do or not to do this kind of stuff in your mind? You said you don't want to replace the health checker module but it can not persuade me and we have no reason to stop future contributors from doing similar things. The new server status service and the old health checker are the same to me except for the fact that they are written by different authors.
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking] wu-sheng merged pull request #10083: Add `ServerStatusService` in the core module
Posted by GitBox <gi...@apache.org>.
wu-sheng merged PR #10083:
URL: https://github.com/apache/skywalking/pull/10083
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking] wu-sheng commented on a diff in pull request #10083: Add `ServerStatusService` in the core module
Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #10083:
URL: https://github.com/apache/skywalking/pull/10083#discussion_r1038758787
##########
oap-server/server-starter/src/main/java/org/apache/skywalking/oap/server/starter/OAPServerBootstrap.java:
##########
@@ -43,12 +42,10 @@ public static void start() {
ApplicationConfiguration applicationConfiguration = configLoader.load();
manager.init(applicationConfiguration);
- manager.find(TelemetryModule.NAME)
+ manager.find(CoreModule.NAME)
.provider()
- .getService(MetricsCreator.class)
- .createGauge("uptime", "oap server start up time", MetricsTag.EMPTY_KEY, MetricsTag.EMPTY_VALUE)
- // Set uptime to second
- .setValue(System.currentTimeMillis() / 1000d);
+ .getService(ServerStatusService.class)
+ .bootedNow(System.currentTimeMillis());
Review Comment:
It is. I did this because, in https://github.com/apache/skywalking/issues/10051, you would see the booting uptime matter. So I moved this setup into the core as a unique mechanism.
I don't intend to replace the existing checker.
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking] wu-sheng commented on a diff in pull request #10083: Add `ServerStatusService` in the core module
Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #10083:
URL: https://github.com/apache/skywalking/pull/10083#discussion_r1038771150
##########
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:
> You are essentially proposing to replicate the health checker module in the core module again
I am not, I am not sure why you think this way. I just add the boot status, because I just need it for the next step. But in https://github.com/apache/skywalking/issues/10051, more status relative mechanism is going to be added.
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking] wu-sheng commented on pull request #10083: Add `ServerStatusService` in the core module
Posted by GitBox <gi...@apache.org>.
wu-sheng commented on PR #10083:
URL: https://github.com/apache/skywalking/pull/10083#issuecomment-1336150668
> I don't mean that. Let's say in another way, if you insist we should add the new service in core module, I hope finally we can rewrite the telemetry module to reuse the server status logics in core module, that should make sense right?
I am afraid I can from tech perspective. The Telemetry is the leaf of the module dependencies. That is why I am adding a layer in the core as a delegation.
https://github.com/apache/skywalking/blob/18008aa6b24ada6602d9c73e1a9d19b6105d8b59/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleProvider.java#L401-L407
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking] wu-sheng commented on a diff in pull request #10083: Add `ServerStatusService` in the core module
Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #10083:
URL: https://github.com/apache/skywalking/pull/10083#discussion_r1038759552
##########
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:
The next step we should need a registration and notification mechanism in this service for other modules, which could sense cluster module update events or latest status.
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking] kezhenxu94 commented on a diff in pull request #10083: Add `ServerStatusService` in the core module
Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on code in PR #10083:
URL: https://github.com/apache/skywalking/pull/10083#discussion_r1038758010
##########
oap-server/server-starter/src/main/java/org/apache/skywalking/oap/server/starter/OAPServerBootstrap.java:
##########
@@ -43,12 +42,10 @@ public static void start() {
ApplicationConfiguration applicationConfiguration = configLoader.load();
manager.init(applicationConfiguration);
- manager.find(TelemetryModule.NAME)
+ manager.find(CoreModule.NAME)
.provider()
- .getService(MetricsCreator.class)
- .createGauge("uptime", "oap server start up time", MetricsTag.EMPTY_KEY, MetricsTag.EMPTY_VALUE)
- // Set uptime to second
- .setValue(System.currentTimeMillis() / 1000d);
+ .getService(ServerStatusService.class)
+ .bootedNow(System.currentTimeMillis());
Review Comment:
It doesn't mean the OAP starts up **successfully** when this line is executed, no?
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking] wu-sheng commented on a diff in pull request #10083: Add `ServerStatusService` in the core module
Posted by GitBox <gi...@apache.org>.
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking] wu-sheng commented on a diff in pull request #10083: Add `ServerStatusService` in the core module
Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #10083:
URL: https://github.com/apache/skywalking/pull/10083#discussion_r1038764796
##########
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:
In next PR, I need to read boot time, I don't think this makes sense to read data from health checker.
Thr boundaries are health check is for exposing true false status and error message for out of the process. The core service is for modules in the OAP to interact or read status.
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org