Support `Scratch The OAP Config Dump`. (#11579)
This commit is contained in:
parent
0fdac95fea
commit
dd09d08c0c
|
|
@ -461,9 +461,11 @@ The following components are provided under the MIT License. See project link fo
|
|||
The text of each license is also included in licenses/LICENSE-[project].txt.
|
||||
|
||||
https://npmjs.com/package/@babel/parser/v/7.23.0 7.23.0 MIT
|
||||
https://npmjs.com/package/@ctrl/tinycolor/v/3.5.0 3.5.0 MIT
|
||||
https://npmjs.com/package/@ctrl/tinycolor/v/3.6.1 3.6.1 MIT
|
||||
https://npmjs.com/package/@egjs/hammerjs/v/2.0.17 2.0.17 MIT
|
||||
https://npmjs.com/package/@element-plus/icons-vue/v/1.1.4 1.1.4 MIT
|
||||
https://npmjs.com/package/@element-plus/icons-vue/v/2.1.0 2.1.0 MIT
|
||||
https://npmjs.com/package/@floating-ui/core/v/0.7.3 0.7.3 MIT
|
||||
https://npmjs.com/package/@floating-ui/dom/v/0.5.4 0.5.4 MIT
|
||||
https://npmjs.com/package/@interactjs/actions/v/1.10.17 1.10.17 MIT
|
||||
https://npmjs.com/package/@interactjs/auto-scroll/v/1.10.17 1.10.17 MIT
|
||||
https://npmjs.com/package/@interactjs/auto-start/v/1.10.17 1.10.17 MIT
|
||||
|
|
@ -484,10 +486,10 @@ The text of each license is also included in licenses/LICENSE-[project].txt.
|
|||
https://npmjs.com/package/@intlify/message-compiler/v/9.2.2 9.2.2 MIT
|
||||
https://npmjs.com/package/@intlify/shared/v/9.2.2 9.2.2 MIT
|
||||
https://npmjs.com/package/@intlify/vue-devtools/v/9.2.2 9.2.2 MIT
|
||||
https://npmjs.com/package/@popperjs/core/v/2.11.6 2.11.6 MIT
|
||||
https://npmjs.com/package/@popperjs/core/v/2.11.7 2.11.7 MIT
|
||||
https://npmjs.com/package/@types/hammerjs/v/2.0.41 2.0.41 MIT
|
||||
https://npmjs.com/package/@types/lodash/v/4.14.191 4.14.191 MIT
|
||||
https://npmjs.com/package/@types/lodash-es/v/4.17.6 4.17.6 MIT
|
||||
https://npmjs.com/package/@types/lodash-es/v/4.17.11 4.17.11 MIT
|
||||
https://npmjs.com/package/@vue/compiler-core/v/3.2.45 3.2.45 MIT
|
||||
https://npmjs.com/package/@vue/compiler-dom/v/3.2.45 3.2.45 MIT
|
||||
https://npmjs.com/package/@vue/compiler-sfc/v/3.2.45 3.2.45 MIT
|
||||
|
|
@ -502,21 +504,28 @@ The text of each license is also included in licenses/LICENSE-[project].txt.
|
|||
https://npmjs.com/package/@vue/server-renderer/v/3.2.45 3.2.45 MIT
|
||||
https://npmjs.com/package/@vue/shared/v/3.2.45 3.2.45 MIT
|
||||
https://npmjs.com/package/async-validator/v/4.2.5 4.2.5 MIT
|
||||
https://npmjs.com/package/axios/v/0.24.0 0.24.0 MIT
|
||||
https://npmjs.com/package/asynckit/v/0.4.0 0.4.0 MIT
|
||||
https://npmjs.com/package/axios/v/1.6.0 1.6.0 MIT
|
||||
https://npmjs.com/package/axios/node_modules/form-data/v/4.0.0 4.0.0 MIT
|
||||
https://npmjs.com/package/axios/node_modules/proxy-from-env/v/1.1.0 1.1.0 MIT
|
||||
https://npmjs.com/package/batch-processor/v/1.0.0 1.0.0 MIT
|
||||
https://mvnrepository.com/artifact/com.graphql-java-kickstart/graphql-java-tools/13.0.1 MIT
|
||||
https://mvnrepository.com/artifact/com.graphql-java/graphql-java/21.0 MIT
|
||||
https://mvnrepository.com/artifact/com.graphql-java/graphql-java-extended-scalars/18.1 MIT
|
||||
https://npmjs.com/package/combined-stream/v/1.0.8 1.0.8 MIT
|
||||
https://npmjs.com/package/component-emitter/v/1.3.0 1.3.0 MIT
|
||||
https://npmjs.com/package/cssfilter/v/0.0.10 0.0.10 MIT
|
||||
https://npmjs.com/package/csstype/v/2.6.21 2.6.21 MIT
|
||||
https://npmjs.com/package/d3-dsv/node_modules/commander/v/7.2.0 7.2.0 MIT
|
||||
https://npmjs.com/package/d3-tip/v/0.9.1 0.9.1 MIT
|
||||
https://npmjs.com/package/dayjs/v/1.11.7 1.11.7 MIT
|
||||
https://npmjs.com/package/element-plus/v/2.1.0 2.1.0 MIT
|
||||
https://npmjs.com/package/element-plus/node_modules/@vueuse/core/v/7.7.1 7.7.1 MIT
|
||||
https://npmjs.com/package/element-plus/node_modules/@vueuse/core/node_modules/@vueuse/shared/v/7.7.1 7.7.1 MIT
|
||||
https://npmjs.com/package/element-plus/node_modules/@vueuse/core/node_modules/vue-demi/v/0.13.11 0.13.11 MIT
|
||||
https://npmjs.com/package/delayed-stream/v/1.0.0 1.0.0 MIT
|
||||
https://npmjs.com/package/element-plus/v/2.2.5 2.2.5 MIT
|
||||
https://npmjs.com/package/element-plus/node_modules/@types/web-bluetooth/v/0.0.14 0.0.14 MIT
|
||||
https://npmjs.com/package/element-plus/node_modules/@vueuse/core/v/8.9.4 8.9.4 MIT
|
||||
https://npmjs.com/package/element-plus/node_modules/@vueuse/core/node_modules/@vueuse/shared/v/8.9.4 8.9.4 MIT
|
||||
https://npmjs.com/package/element-plus/node_modules/@vueuse/core/node_modules/vue-demi/v/0.14.6 0.14.6 MIT
|
||||
https://npmjs.com/package/element-plus/node_modules/@vueuse/metadata/v/8.9.4 8.9.4 MIT
|
||||
https://npmjs.com/package/element-resize-detector/v/1.2.4 1.2.4 MIT
|
||||
https://npmjs.com/package/escape-html/v/1.0.3 1.0.3 MIT
|
||||
https://npmjs.com/package/estree-walker/v/2.0.2 2.0.2 MIT
|
||||
|
|
@ -527,6 +536,8 @@ The text of each license is also included in licenses/LICENSE-[project].txt.
|
|||
https://npmjs.com/package/lodash-es/v/4.17.21 4.17.21 MIT
|
||||
https://npmjs.com/package/lodash-unified/v/1.0.3 1.0.3 MIT
|
||||
https://npmjs.com/package/memoize-one/v/6.0.0 6.0.0 MIT
|
||||
https://npmjs.com/package/mime-db/v/1.52.0 1.52.0 MIT
|
||||
https://npmjs.com/package/mime-types/v/2.1.35 2.1.35 MIT
|
||||
https://npmjs.com/package/mitt/v/2.1.0 2.1.0 MIT
|
||||
https://npmjs.com/package/moment/v/2.29.4 2.29.4 MIT
|
||||
https://npmjs.com/package/monaco-editor/v/0.34.1 0.34.1 MIT
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
* Repleace go2sky E2E to GO agent.
|
||||
* Replace Metrics v2 protocol with MQE in UI templates and E2E Test.
|
||||
* Fix incorrect apisix metrics otel rules.
|
||||
* Support `Scratch The OAP Config Dump`.
|
||||
|
||||
#### UI
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,74 @@
|
|||
# Scratch The OAP Config Dump
|
||||
|
||||
SkyWalking OAP behaviors could be controlled through hundreds of configurations. It is hard to know what is the final
|
||||
configuration as all the configurations could be overrided by system environments.
|
||||
|
||||
The core config file [application.yml](../../../oap-server/server-starter/src/main/resources/application.yml) lists all
|
||||
the configurations
|
||||
and their default values. However, it is still hard to know the runtime value.
|
||||
|
||||
Scratch is a tool to dump the final configuration. It is provided within OAP rest server, which could be accessed
|
||||
through HTTP GET `http://{core restHost}:{core restPort}/debugging/config/dump`.
|
||||
|
||||
```shell
|
||||
> curl http://127.0.0.1:12800/debugging/config/dump
|
||||
cluster.provider=standalone
|
||||
core.provider=default
|
||||
core.default.prepareThreads=2
|
||||
core.default.restHost=0.0.0.0
|
||||
core.default.searchableLogsTags=level,http.status_code
|
||||
core.default.role=Mixed
|
||||
core.default.persistentPeriod=25
|
||||
core.default.syncPeriodHttpUriRecognitionPattern=10
|
||||
core.default.restIdleTimeOut=30000
|
||||
core.default.dataKeeperExecutePeriod=5
|
||||
core.default.topNReportPeriod=10
|
||||
core.default.gRPCSslTrustedCAPath=
|
||||
core.default.downsampling=[Hour, Day]
|
||||
core.default.serviceNameMaxLength=70
|
||||
core.default.gRPCSslEnabled=false
|
||||
core.default.restPort=12800
|
||||
core.default.serviceCacheRefreshInterval=10
|
||||
...
|
||||
```
|
||||
|
||||
All booting configurations with their runtime values are listed, including the selected provider for each module.
|
||||
|
||||
## Protect The Secrets
|
||||
|
||||
Some of the configurations contain sensitive values, such as username, password, token, etc. These values would be
|
||||
masked
|
||||
in the dump result. For example, the `storage.elasticsearch.password` in the following configurations,
|
||||
|
||||
```yaml
|
||||
storage:
|
||||
selector: ${SW_STORAGE:h2}
|
||||
elasticsearch:
|
||||
password: ${SW_ES_PASSWORD:""}
|
||||
```
|
||||
|
||||
It would be masked and shown as `********` in the dump result.
|
||||
|
||||
```shell
|
||||
> curl http://127.0.0.1:12800/debugging/config/dump
|
||||
...
|
||||
storage.elasticsearch.password=********
|
||||
...
|
||||
```
|
||||
|
||||
By default, we mask the config keys through the following configurations.
|
||||
|
||||
```yaml
|
||||
# Include the list of keywords to filter configurations including secrets. Separate keywords by a comma.
|
||||
keywords4MaskingSecretsOfConfig: ${SW_CORE_KEYWORDS_FOR_MASKING_SECRETS:user,password,token,accessKey,secretKey}
|
||||
```
|
||||
|
||||
## Disable The Config Dump Service
|
||||
|
||||
By default, this service is open for helping users to debug and diagnose. If you want to disable it, you need to diable the whole
|
||||
`debugging-query` module through setting `selector=-`.
|
||||
|
||||
```yaml
|
||||
debugging-query:
|
||||
selector: ${SW_DEBUGGING_QUERY:-}
|
||||
```
|
||||
|
|
@ -308,6 +308,8 @@ The Configuration Vocabulary lists all available configurations provided by `app
|
|||
| - | - | kafkaTopicLog | Kafka topic name for log. | SW_EXPORTER_KAFKA_TOPIC_LOG | skywalking-export-log |
|
||||
| - | - | exportErrorStatusTraceOnly | Export error status trace segments through the Kafka channel. | SW_EXPORTER_KAFKA_TRACE_FILTER_ERROR | false |
|
||||
| health-checker | default | checkIntervalSeconds | The period of checking OAP internal health status (in seconds). | SW_HEALTH_CHECKER_INTERVAL_SECONDS | 5 |
|
||||
| debugging-query | default | | | | |
|
||||
| - | - | keywords4MaskingSecretsOfConfig | Include the list of keywords to filter configurations including secrets. Separate keywords by a comma. | SW_DEBUGGING_QUERY_KEYWORDS_FOR_MASKING_SECRETS | user,password,token,accessKey,secretKey,authentication |
|
||||
| configuration-discovery | default | disableMessageDigest | If true, agent receives the latest configuration every time, even without making any changes. By default, OAP uses the SHA512 message digest mechanism to detect changes in configuration. | SW_DISABLE_MESSAGE_DIGEST | false |
|
||||
| receiver-event | default | gRPC services that handle events data. | - | - | |
|
||||
| aws-firehose-receiver | default | host | Binding IP of HTTP server | SW_RECEIVER_AWS_FIREHOSE_HTTP_HOST | 0.0.0.0 |
|
||||
|
|
|
|||
|
|
@ -323,6 +323,10 @@ catalog:
|
|||
path: "/en/api/logql-service"
|
||||
- name: "Security Notice"
|
||||
path: "/en/security/readme"
|
||||
- name: "Debugging"
|
||||
catalog:
|
||||
- name: "Scratch The OAP Config Dump"
|
||||
path: "en/debugging/config_dump"
|
||||
- name: "Academy"
|
||||
catalog:
|
||||
- name: "Scaling SkyWalking server automatically in kubernetes"
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ public class CoreModuleProvider extends ModuleProvider {
|
|||
httpServer.initialize();
|
||||
|
||||
this.registerServiceImplementation(ConfigService.class, new ConfigService(moduleConfig, this));
|
||||
this.registerServiceImplementation(ServerStatusService.class, new ServerStatusService(getManager()));
|
||||
this.registerServiceImplementation(ServerStatusService.class, new ServerStatusService(getManager(), moduleConfig));
|
||||
this.registerServiceImplementation(
|
||||
DownSamplingConfigService.class, new DownSamplingConfigService(moduleConfig.getDownsampling()));
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.skywalking.oap.server.core.CoreModuleConfig;
|
||||
import org.apache.skywalking.oap.server.library.module.ApplicationConfiguration;
|
||||
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;
|
||||
|
|
@ -38,6 +40,7 @@ import org.apache.skywalking.oap.server.telemetry.api.MetricsTag;
|
|||
@RequiredArgsConstructor
|
||||
public class ServerStatusService implements Service {
|
||||
private final ModuleManager manager;
|
||||
private final CoreModuleConfig moduleConfig;
|
||||
@Getter
|
||||
private BootingStatus bootingStatus = new BootingStatus();
|
||||
@Getter
|
||||
|
|
@ -45,7 +48,9 @@ public class ServerStatusService implements Service {
|
|||
|
||||
private List<ServerStatusWatcher> statusWatchers = new ArrayList<>();
|
||||
|
||||
public void bootedNow(long uptime) {
|
||||
private List<ApplicationConfiguration.ModuleConfiguration> configurations;
|
||||
|
||||
public void bootedNow(List<ApplicationConfiguration.ModuleConfiguration> configurations, long uptime) {
|
||||
bootingStatus.setBooted(true);
|
||||
bootingStatus.setUptime(uptime);
|
||||
manager.find(TelemetryModule.NAME)
|
||||
|
|
@ -55,6 +60,7 @@ public class ServerStatusService implements Service {
|
|||
// Set uptime to second
|
||||
.setValue(uptime / 1000d);
|
||||
this.statusWatchers.forEach(watcher -> watcher.onServerBooted(bootingStatus));
|
||||
this.configurations = configurations;
|
||||
}
|
||||
|
||||
public void rebalancedCluster(long rebalancedTime) {
|
||||
|
|
@ -62,7 +68,10 @@ public class ServerStatusService implements Service {
|
|||
manager.find(TelemetryModule.NAME)
|
||||
.provider()
|
||||
.getService(MetricsCreator.class)
|
||||
.createGauge("cluster_rebalanced_time", "oap cluster rebalanced time after scale", MetricsTag.EMPTY_KEY, MetricsTag.EMPTY_VALUE)
|
||||
.createGauge(
|
||||
"cluster_rebalanced_time", "oap cluster rebalanced time after scale", MetricsTag.EMPTY_KEY,
|
||||
MetricsTag.EMPTY_VALUE
|
||||
)
|
||||
.setValue(rebalancedTime / 1000d);
|
||||
|
||||
this.statusWatchers.forEach(watcher -> watcher.onClusterRebalanced(clusterStatus));
|
||||
|
|
@ -71,4 +80,47 @@ public class ServerStatusService implements Service {
|
|||
public void registerWatcher(ServerStatusWatcher watcher) {
|
||||
this.statusWatchers.add(watcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a complete list of booting configurations with effected values.
|
||||
* @since 9.7.0
|
||||
*/
|
||||
public String dumpBootingConfigurations(String keywords4MaskingSecretsOfConfig) {
|
||||
if (configurations == null || configurations.isEmpty()) {
|
||||
return "No available booting configurations.";
|
||||
}
|
||||
final String[] keywords = keywords4MaskingSecretsOfConfig.split(",");
|
||||
StringBuilder configList = new StringBuilder();
|
||||
for (ApplicationConfiguration.ModuleConfiguration configuration : configurations) {
|
||||
final String moduleName = configuration.getModuleName();
|
||||
if (configuration.getProviders().size() == 1) {
|
||||
configList.append(moduleName)
|
||||
.append(".provider=")
|
||||
.append(configuration.getProviders().keySet().iterator().next())
|
||||
.append("\n");
|
||||
}
|
||||
configuration.getProviders().forEach(
|
||||
(providerName, providerConfiguration) ->
|
||||
providerConfiguration.getProperties().forEach(
|
||||
(key, value) -> {
|
||||
for (final String keyword : keywords) {
|
||||
if (key.toString().toLowerCase().contains(keyword.toLowerCase())) {
|
||||
value = "******";
|
||||
}
|
||||
}
|
||||
|
||||
configList.append(moduleName)
|
||||
.append(".")
|
||||
.append(providerName)
|
||||
.append(".")
|
||||
.append(key)
|
||||
.append("=")
|
||||
.append(value)
|
||||
.append("\n");
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
return configList.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ package org.apache.skywalking.oap.server.library.module;
|
|||
|
||||
import java.util.HashMap;
|
||||
import java.util.Properties;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Modularization configurations. The {@link ModuleManager} is going to start, lookup, start modules based on this.
|
||||
|
|
@ -32,7 +33,7 @@ public class ApplicationConfiguration {
|
|||
}
|
||||
|
||||
public ModuleConfiguration addModule(String moduleName) {
|
||||
ModuleConfiguration newModule = new ModuleConfiguration();
|
||||
ModuleConfiguration newModule = new ModuleConfiguration(moduleName);
|
||||
modules.put(moduleName, newModule);
|
||||
return newModule;
|
||||
}
|
||||
|
|
@ -49,9 +50,13 @@ public class ApplicationConfiguration {
|
|||
* The configurations about a certain module.
|
||||
*/
|
||||
public static class ModuleConfiguration {
|
||||
@Getter
|
||||
private final String moduleName;
|
||||
@Getter
|
||||
private HashMap<String, ProviderConfiguration> providers = new HashMap<>();
|
||||
|
||||
private ModuleConfiguration() {
|
||||
private ModuleConfiguration(String moduleName) {
|
||||
this.moduleName = moduleName;
|
||||
}
|
||||
|
||||
public Properties getProviderConfiguration(String name) {
|
||||
|
|
@ -73,14 +78,11 @@ public class ApplicationConfiguration {
|
|||
* The configuration about a certain provider of a module.
|
||||
*/
|
||||
public static class ProviderConfiguration {
|
||||
@Getter
|
||||
private Properties properties;
|
||||
|
||||
ProviderConfiguration(Properties properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
private Properties getProperties() {
|
||||
return properties;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ 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.
|
||||
~
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>server-query-plugin</artifactId>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<version>9.7.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>debugging-query-plugin</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<artifactId>server-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* 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.query.debug;
|
||||
|
||||
import com.linecorp.armeria.server.annotation.Get;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.skywalking.oap.server.core.CoreModule;
|
||||
import org.apache.skywalking.oap.server.core.status.ServerStatusService;
|
||||
import org.apache.skywalking.oap.server.library.module.ModuleManager;
|
||||
|
||||
@Slf4j
|
||||
public class DebuggingHTTPHandler {
|
||||
private final ServerStatusService serverStatusService;
|
||||
final DebuggingQueryConfig config;
|
||||
|
||||
public DebuggingHTTPHandler(final ModuleManager manager, final DebuggingQueryConfig config) {
|
||||
serverStatusService = manager.find(CoreModule.NAME)
|
||||
.provider()
|
||||
.getService(ServerStatusService.class);
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
@Get("/debugging/config/dump")
|
||||
public String dumpConfigurations() {
|
||||
return serverStatusService.dumpBootingConfigurations(config.getKeywords4MaskingSecretsOfConfig());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* 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.query.debug;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.apache.skywalking.oap.server.library.module.ModuleConfig;
|
||||
|
||||
@Getter
|
||||
public class DebuggingQueryConfig extends ModuleConfig {
|
||||
/**
|
||||
* Include the list of keywords to filter configurations including secrets. Separate keywords by a comma.
|
||||
*
|
||||
* @since 9.7.0
|
||||
*/
|
||||
private String keywords4MaskingSecretsOfConfig = "user,password,token,accessKey,secretKey,authentication";
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* 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.query.debug;
|
||||
|
||||
import org.apache.skywalking.oap.server.library.module.ModuleDefine;
|
||||
|
||||
public class DebuggingQueryModule extends ModuleDefine {
|
||||
public static final String NAME = "debugging-query";
|
||||
|
||||
public DebuggingQueryModule() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
public Class[] services() {
|
||||
return new Class[0];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* 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.query.debug;
|
||||
|
||||
import com.linecorp.armeria.common.HttpMethod;
|
||||
import java.util.Collections;
|
||||
import org.apache.skywalking.oap.server.core.CoreModule;
|
||||
import org.apache.skywalking.oap.server.core.server.HTTPHandlerRegister;
|
||||
import org.apache.skywalking.oap.server.library.module.ModuleConfig;
|
||||
import org.apache.skywalking.oap.server.library.module.ModuleDefine;
|
||||
import org.apache.skywalking.oap.server.library.module.ModuleProvider;
|
||||
import org.apache.skywalking.oap.server.library.module.ModuleStartException;
|
||||
import org.apache.skywalking.oap.server.library.module.ServiceNotProvidedException;
|
||||
|
||||
public class DebuggingQueryProvider extends ModuleProvider {
|
||||
public static final String NAME = "default";
|
||||
|
||||
private DebuggingQueryConfig config;
|
||||
|
||||
public String name() {
|
||||
return NAME;
|
||||
}
|
||||
|
||||
public Class<? extends ModuleDefine> module() {
|
||||
return DebuggingQueryModule.class;
|
||||
}
|
||||
|
||||
public ConfigCreator<? extends ModuleConfig> newConfigCreator() {
|
||||
return new ConfigCreator<DebuggingQueryConfig>() {
|
||||
@Override
|
||||
public Class<DebuggingQueryConfig> type() {
|
||||
return DebuggingQueryConfig.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInitialized(final DebuggingQueryConfig initialized) {
|
||||
config = initialized;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public void prepare() throws ServiceNotProvidedException {
|
||||
|
||||
}
|
||||
|
||||
public void start() throws ServiceNotProvidedException {
|
||||
HTTPHandlerRegister service = getManager().find(CoreModule.NAME)
|
||||
.provider()
|
||||
.getService(HTTPHandlerRegister.class);
|
||||
service.addHandler(
|
||||
new DebuggingHTTPHandler(getManager(), config),
|
||||
Collections.singletonList(HttpMethod.GET)
|
||||
);
|
||||
}
|
||||
|
||||
public void notifyAfterCompleted() throws ServiceNotProvidedException, ModuleStartException {
|
||||
|
||||
}
|
||||
|
||||
public String[] requiredModules() {
|
||||
return new String[] {CoreModule.NAME};
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
#
|
||||
|
||||
org.apache.skywalking.oap.query.debug.DebuggingQueryModule
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
#
|
||||
|
||||
org.apache.skywalking.oap.query.debug.DebuggingQueryProvider
|
||||
|
|
@ -23,6 +23,20 @@
|
|||
<groupId>org.apache.skywalking</groupId>
|
||||
<version>9.7.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<artifactId>library-module</artifactId>
|
||||
<version>9.7.0-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<artifactId>server-core</artifactId>
|
||||
<version>9.7.0-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>server-query-plugin</artifactId>
|
||||
|
|
@ -32,5 +46,6 @@
|
|||
<module>zipkin-query-plugin</module>
|
||||
<module>promql-plugin</module>
|
||||
<module>logql-plugin</module>
|
||||
<module>debugging-query-plugin</module>
|
||||
</modules>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -111,6 +111,11 @@
|
|||
<artifactId>zipkin-query-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<artifactId>debugging-query-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<artifactId>envoy-metrics-receiver-plugin</artifactId>
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public class OAPServerBootstrap {
|
|||
manager.find(CoreModule.NAME)
|
||||
.provider()
|
||||
.getService(ServerStatusService.class)
|
||||
.bootedNow(System.currentTimeMillis());
|
||||
.bootedNow(configLoader.getResolvedConfigurations(), System.currentTimeMillis());
|
||||
|
||||
if (RunningMode.isInitMode()) {
|
||||
log.info("OAP starts up in init mode successfully, exit now...");
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
|
||||
package org.apache.skywalking.oap.server.starter.config;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.skywalking.oap.server.library.module.ApplicationConfiguration;
|
||||
import org.apache.skywalking.oap.server.library.module.ProviderNotFoundException;
|
||||
|
|
@ -47,10 +49,13 @@ public class ApplicationConfigLoader implements ConfigLoader<ApplicationConfigur
|
|||
|
||||
private final TerminalFriendlyTable bootingParameters;
|
||||
private final Yaml yaml;
|
||||
@Getter
|
||||
private final List<ApplicationConfiguration.ModuleConfiguration> resolvedConfigurations;
|
||||
|
||||
public ApplicationConfigLoader(final TerminalFriendlyTable bootingParameters) {
|
||||
this.bootingParameters = bootingParameters;
|
||||
this.yaml = new Yaml();
|
||||
this.resolvedConfigurations = new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -97,6 +102,7 @@ public class ApplicationConfigLoader implements ConfigLoader<ApplicationConfigur
|
|||
});
|
||||
}
|
||||
moduleConfiguration.addProviderConfiguration(providerName, properties);
|
||||
resolvedConfigurations.add(moduleConfiguration);
|
||||
});
|
||||
} else {
|
||||
log.warn(
|
||||
|
|
|
|||
|
|
@ -535,6 +535,12 @@ health-checker:
|
|||
default:
|
||||
checkIntervalSeconds: ${SW_HEALTH_CHECKER_INTERVAL_SECONDS:5}
|
||||
|
||||
debugging-query:
|
||||
selector: ${SW_DEBUGGING_QUERY:default}
|
||||
default:
|
||||
# Include the list of keywords to filter configurations including secrets. Separate keywords by a comma.
|
||||
keywords4MaskingSecretsOfConfig: ${SW_DEBUGGING_QUERY_KEYWORDS_FOR_MASKING_SECRETS:user,password,token,accessKey,secretKey,authentication}
|
||||
|
||||
configuration-discovery:
|
||||
selector: ${SW_CONFIGURATION_DISCOVERY:default}
|
||||
default:
|
||||
|
|
|
|||
Loading…
Reference in New Issue