This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/master by this push:
     new 5bf05cc3e9 Feature/searchable tags watcher (#10758)
5bf05cc3e9 is described below

commit 5bf05cc3e90da4f88b5b6d0170616d739c32fcb4
Author: gzlicanyi <[email protected]>
AuthorDate: Thu May 4 21:07:44 2023 +0800

    Feature/searchable tags watcher (#10758)
---
 docs/en/changes/changes.md                         |  1 +
 docs/en/setup/backend/dynamic-config.md            |  1 +
 .../parser/listener/SegmentAnalysisListener.java   | 11 ++-
 .../oap/server/core/CoreModuleConfig.java          |  5 ++
 .../oap/server/core/CoreModuleProvider.java        |  3 +-
 .../oap/server/core/config/ConfigService.java      | 11 ++-
 .../core/config/SearchableTracesTagsWatcher.java   | 73 +++++++++++++++++
 .../config/SearchableTracesTagsWatcherTest.java    | 92 ++++++++++++++++++++++
 .../plugin/jdbc/common/dao/JDBCTraceQueryDAO.java  | 13 ++-
 .../tool/profile/core/MockCoreModuleProvider.java  |  7 +-
 10 files changed, 196 insertions(+), 21 deletions(-)

diff --git a/docs/en/changes/changes.md b/docs/en/changes/changes.md
index f917a97cba..676bac379a 100644
--- a/docs/en/changes/changes.md
+++ b/docs/en/changes/changes.md
@@ -39,6 +39,7 @@
 * Support ServerSide TopN for BanyanDB.
 * Add component ID for Jersey.
 * Remove OpenCensus support, the related codes and docs as [it's 
sunsetting](https://opentelemetry.io/blog/2023/sunsetting-opencensus/).
+* Support dynamic configuration of searchableTracesTags
 
 #### UI
 * Revert: cpm5d function. This feature is cancelled from backend.
diff --git a/docs/en/setup/backend/dynamic-config.md 
b/docs/en/setup/backend/dynamic-config.md
index abac9021e4..4de75d7bd5 100755
--- a/docs/en/setup/backend/dynamic-config.md
+++ b/docs/en/setup/backend/dynamic-config.md
@@ -37,6 +37,7 @@ Supported configurations are as follows:
 |core.default.apdexThreshold| The apdex threshold settings. Overrides 
`service-apdex-threshold.yml`. | Same as 
[`service-apdex-threshold.yml`](apdex-threshold.md). |
 |core.default.endpoint-name-grouping| The endpoint name grouping setting. 
Overrides `endpoint-name-grouping.yml`. | Same as 
[`endpoint-name-grouping.yml`](endpoint-grouping-rules.md). |
 |core.default.log4j-xml| The log4j xml configuration. Overrides `log4j2.xml`. 
| Same as [`log4j2.xml`](dynamical-logging.md). |
+|core.default.searchableTracesTags| The searchableTracesTags configuration. 
Override `core/default/searchableTracesTags` in the `application.yml`. | 
http.method,http.status_code,rpc.status_code,db.type,db.instance,mq.queue,mq.topic,mq.broker
 |
 |agent-analyzer.default.traceSamplingPolicy| The sampling policy for default 
and service dimension, override `trace-sampling-policy-settings.yml`. | same as 
[`trace-sampling-policy-settings.yml`](trace-sampling.md) | 
 |configuration-discovery.default.agentConfigurations| The 
ConfigurationDiscovery settings. | See 
[`configuration-discovery.md`](https://skywalking.apache.org/docs/skywalking-java/next/en/setup/service-agent/java-agent/configuration-discovery/).
 |
 
diff --git 
a/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/SegmentAnalysisListener.java
 
b/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/SegmentAnalysisListener.java
index b19bbfd968..e211709a30 100644
--- 
a/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/SegmentAnalysisListener.java
+++ 
b/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/SegmentAnalysisListener.java
@@ -18,13 +18,12 @@
 
 package 
org.apache.skywalking.oap.server.analyzer.provider.trace.parser.listener;
 
-import java.util.Arrays;
-import java.util.List;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.skywalking.apm.network.language.agent.v3.SegmentObject;
 import org.apache.skywalking.apm.network.language.agent.v3.SpanObject;
 import org.apache.skywalking.oap.server.core.analysis.manual.searchtag.TagType;
+import 
org.apache.skywalking.oap.server.core.config.SearchableTracesTagsWatcher;
 import org.apache.skywalking.oap.server.core.source.TagAutocomplete;
 import org.apache.skywalking.oap.server.library.util.StringUtil;
 import org.apache.skywalking.oap.server.analyzer.provider.AnalyzerModuleConfig;
@@ -52,7 +51,7 @@ public class SegmentAnalysisListener implements 
FirstAnalysisListener, EntryAnal
     private final TraceSegmentSampler sampler;
     private final boolean forceSampleErrorSegment;
     private final NamingControl namingControl;
-    private final List<String> searchableTagKeys;
+    private final SearchableTracesTagsWatcher searchableTagKeys;
     private final SegmentStatusAnalyzer segmentStatusAnalyzer;
 
     private final Segment segment = new Segment();
@@ -150,7 +149,7 @@ public class SegmentAnalysisListener implements 
FirstAnalysisListener, EntryAnal
 
     private void appendSearchableTags(SpanObject span) {
         span.getTagsList().forEach(tag -> {
-            if (searchableTagKeys.contains(tag.getKey())) {
+            if (searchableTagKeys.getSearchableTags().contains(tag.getKey())) {
                 final Tag spanTag = new Tag(tag.getKey(), tag.getValue());
                 if (tag.getValue().length()  > Tag.TAG_LENGTH || 
spanTag.toString().length() > Tag.TAG_LENGTH) {
                     if (log.isDebugEnabled()) {
@@ -204,7 +203,7 @@ public class SegmentAnalysisListener implements 
FirstAnalysisListener, EntryAnal
         private final TraceSegmentSampler sampler;
         private final boolean forceSampleErrorSegment;
         private final NamingControl namingControl;
-        private final List<String> searchTagKeys;
+        private final SearchableTracesTagsWatcher searchTagKeys;
         private final SegmentStatusAnalyzer segmentStatusAnalyzer;
 
         public Factory(ModuleManager moduleManager, AnalyzerModuleConfig 
config) {
@@ -212,7 +211,7 @@ public class SegmentAnalysisListener implements 
FirstAnalysisListener, EntryAnal
             final ConfigService configService = 
moduleManager.find(CoreModule.NAME)
                                                              .provider()
                                                              
.getService(ConfigService.class);
-            this.searchTagKeys = 
Arrays.asList(configService.getSearchableTracesTags().split(Const.COMMA));
+            this.searchTagKeys = configService.getSearchableTracesTags();
             this.sampler = new 
TraceSegmentSampler(config.getTraceSamplingPolicyWatcher());
             this.forceSampleErrorSegment = config.isForceSampleErrorSegment();
             this.namingControl = moduleManager.find(CoreModule.NAME)
diff --git 
a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleConfig.java
 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleConfig.java
index 158f77ea04..de7081f81c 100644
--- 
a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleConfig.java
+++ 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleConfig.java
@@ -22,6 +22,7 @@ import java.util.ArrayList;
 import java.util.List;
 import lombok.Getter;
 import lombok.Setter;
+import 
org.apache.skywalking.oap.server.core.config.SearchableTracesTagsWatcher;
 import org.apache.skywalking.oap.server.core.source.ScopeDefaultColumn;
 import org.apache.skywalking.oap.server.library.module.ModuleConfig;
 
@@ -138,6 +139,10 @@ public class CoreModuleConfig extends ModuleConfig {
     @Setter
     @Getter
     private String searchableTracesTags = DEFAULT_SEARCHABLE_TAG_KEYS;
+    @Setter
+    @Getter
+    private SearchableTracesTagsWatcher searchableTracesTagsWatcher;
+
     /**
      * Define the set of logs tag keys, which should be searchable through the 
GraphQL.
      *
diff --git 
a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleProvider.java
 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleProvider.java
index a1a6780d64..47f9a3bdb3 100755
--- 
a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleProvider.java
+++ 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleProvider.java
@@ -242,7 +242,7 @@ public class CoreModuleProvider extends ModuleProvider {
         httpServer = new HTTPServer(httpServerConfig);
         httpServer.initialize();
 
-        this.registerServiceImplementation(ConfigService.class, new 
ConfigService(moduleConfig));
+        this.registerServiceImplementation(ConfigService.class, new 
ConfigService(moduleConfig, this));
         this.registerServiceImplementation(ServerStatusService.class, new 
ServerStatusService(getManager()));
         this.registerServiceImplementation(
             DownSamplingConfigService.class, new 
DownSamplingConfigService(moduleConfig.getDownsampling()));
@@ -388,6 +388,7 @@ public class CoreModuleProvider extends ModuleProvider {
         if (moduleConfig.isEnableEndpointNameGroupingByOpenapi()) {
             
dynamicConfigurationService.registerConfigChangeWatcher(endpointNameGroupingRule4OpenapiWatcher);
         }
+        
dynamicConfigurationService.registerConfigChangeWatcher(moduleConfig.getSearchableTracesTagsWatcher());
     }
 
     @Override
diff --git 
a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/ConfigService.java
 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/ConfigService.java
index b6d36553d2..b8d74513d4 100644
--- 
a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/ConfigService.java
+++ 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/ConfigService.java
@@ -20,23 +20,28 @@ package org.apache.skywalking.oap.server.core.config;
 
 import lombok.Getter;
 import org.apache.skywalking.oap.server.core.CoreModuleConfig;
+import org.apache.skywalking.oap.server.library.module.ModuleProvider;
 import org.apache.skywalking.oap.server.library.module.Service;
 
 @Getter
 public class ConfigService implements Service {
     private final String gRPCHost;
     private final int gRPCPort;
-    private final String searchableTracesTags;
+    private final SearchableTracesTagsWatcher searchableTracesTags;
     private final String searchableLogsTags;
     private final String searchableAlarmTags;
     private final int metricsDataTTL;
     private final int recordDataTTL;
     private final int persistentPeriod;
 
-    public ConfigService(CoreModuleConfig moduleConfig) {
+    public ConfigService(CoreModuleConfig moduleConfig, ModuleProvider 
provider) {
         this.gRPCHost = moduleConfig.getGRPCHost();
         this.gRPCPort = moduleConfig.getGRPCPort();
-        this.searchableTracesTags = moduleConfig.getSearchableTracesTags();
+
+        this.searchableTracesTags =
+                new 
SearchableTracesTagsWatcher(moduleConfig.getSearchableTracesTags(), provider);
+        moduleConfig.setSearchableTracesTagsWatcher(this.searchableTracesTags);
+
         this.searchableLogsTags = moduleConfig.getSearchableLogsTags();
         this.searchableAlarmTags = moduleConfig.getSearchableAlarmTags();
         this.metricsDataTTL = moduleConfig.getMetricsDataTTL();
diff --git 
a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/SearchableTracesTagsWatcher.java
 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/SearchableTracesTagsWatcher.java
new file mode 100644
index 0000000000..42e652d803
--- /dev/null
+++ 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/SearchableTracesTagsWatcher.java
@@ -0,0 +1,73 @@
+/*
+ * 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.config;
+
+import org.apache.skywalking.oap.server.configuration.api.ConfigChangeWatcher;
+import org.apache.skywalking.oap.server.core.CoreModule;
+import org.apache.skywalking.oap.server.library.module.ModuleProvider;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicReference;
+
+public class SearchableTracesTagsWatcher extends ConfigChangeWatcher {
+
+    private AtomicReference<Set<String>> searchableTags;
+
+    private final String initialSettingsString;
+
+    private volatile String dynamicSettingsString;
+
+    public SearchableTracesTagsWatcher(String config, ModuleProvider provider) 
{
+        super(CoreModule.NAME, provider, "searchableTracesTags");
+        searchableTags = new AtomicReference<>(new HashSet<>());
+        initialSettingsString = config;
+
+        activeSetting(config);
+    }
+
+    private void activeSetting(String config) {
+        Set<String> tags = new HashSet<>();
+        String[] settings = config.split(",");
+        for (String setting : settings) {
+            tags.add(setting);
+        }
+
+        searchableTags.set(tags);
+    }
+
+    public Set<String> getSearchableTags() {
+        return searchableTags.get();
+    }
+
+    @Override
+    public void notify(ConfigChangeEvent value) {
+        if (EventType.DELETE.equals(value.getEventType())) {
+            dynamicSettingsString = null;
+            activeSetting(initialSettingsString);
+        } else {
+            dynamicSettingsString = value.getNewValue();
+            activeSetting(value.getNewValue());
+        }
+    }
+
+    @Override
+    public String value() {
+        return dynamicSettingsString;
+    }
+}
\ No newline at end of file
diff --git 
a/oap-server/server-core/src/test/java/org/apache/skywalking/oap/server/core/config/SearchableTracesTagsWatcherTest.java
 
b/oap-server/server-core/src/test/java/org/apache/skywalking/oap/server/core/config/SearchableTracesTagsWatcherTest.java
new file mode 100644
index 0000000000..5843b8b72c
--- /dev/null
+++ 
b/oap-server/server-core/src/test/java/org/apache/skywalking/oap/server/core/config/SearchableTracesTagsWatcherTest.java
@@ -0,0 +1,92 @@
+/*
+ * 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.config;
+
+import org.apache.skywalking.oap.server.configuration.api.ConfigChangeWatcher;
+import org.apache.skywalking.oap.server.core.CoreModuleConfig;
+import org.apache.skywalking.oap.server.core.CoreModuleProvider;
+import org.apache.skywalking.oap.server.library.module.ModuleProvider;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.junit.jupiter.MockitoExtension;
+
+import java.util.Arrays;
+import java.util.stream.Collectors;
+
+@ExtendWith(MockitoExtension.class)
+public class SearchableTracesTagsWatcherTest {
+
+    private ModuleProvider provider;
+    private CoreModuleConfig moduleConfig;
+
+    private SearchableTracesTagsWatcher searchableTracesTagsWatcher;
+
+    @BeforeEach
+    public void init() {
+        provider = new CoreModuleProvider();
+        moduleConfig = new CoreModuleConfig();
+
+        searchableTracesTagsWatcher = new 
SearchableTracesTagsWatcher(moduleConfig.getSearchableTracesTags(), provider);
+    }
+
+    @Test
+    public void testGetDefaultSearchableTags() {
+
+        
Assertions.assertEquals(searchableTracesTagsWatcher.getSearchableTags(),
+                
Arrays.stream(moduleConfig.getSearchableTracesTags().split(",")).collect(Collectors.toSet()));
+    }
+
+    @Test
+    public void testNotify() {
+
+        //add
+        String addSearchableTracesTagsStr = 
moduleConfig.getSearchableTracesTags() + ",userId";
+        ConfigChangeWatcher.ConfigChangeEvent addEvent =
+                new 
ConfigChangeWatcher.ConfigChangeEvent(addSearchableTracesTagsStr,
+                        ConfigChangeWatcher.EventType.ADD);
+
+        searchableTracesTagsWatcher.notify(addEvent);
+
+        
Assertions.assertEquals(searchableTracesTagsWatcher.getSearchableTags(),
+                
Arrays.stream(addSearchableTracesTagsStr.split(",")).collect(Collectors.toSet()));
+
+        //modify
+        String modifySearchableTracesTagsStr = 
moduleConfig.getSearchableTracesTags() + ",userId,orderId";
+        ConfigChangeWatcher.ConfigChangeEvent modifyEvent =
+                new 
ConfigChangeWatcher.ConfigChangeEvent(modifySearchableTracesTagsStr,
+                        ConfigChangeWatcher.EventType.MODIFY);
+
+        searchableTracesTagsWatcher.notify(modifyEvent);
+
+        
Assertions.assertEquals(searchableTracesTagsWatcher.getSearchableTags(),
+                
Arrays.stream(modifySearchableTracesTagsStr.split(",")).collect(Collectors.toSet()));
+
+        //delete
+        ConfigChangeWatcher.ConfigChangeEvent deleteEvent =
+                new ConfigChangeWatcher.ConfigChangeEvent(null,
+                        ConfigChangeWatcher.EventType.DELETE);
+        searchableTracesTagsWatcher.notify(deleteEvent);
+
+        
Assertions.assertEquals(searchableTracesTagsWatcher.getSearchableTags(),
+                
Arrays.stream(moduleConfig.getSearchableTracesTags().split(",")).collect(Collectors.toSet()));
+    }
+
+}
\ No newline at end of file
diff --git 
a/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/common/dao/JDBCTraceQueryDAO.java
 
b/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/common/dao/JDBCTraceQueryDAO.java
index b01af83985..faf37a5164 100644
--- 
a/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/common/dao/JDBCTraceQueryDAO.java
+++ 
b/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/common/dao/JDBCTraceQueryDAO.java
@@ -22,12 +22,12 @@ import com.google.common.base.Strings;
 import lombok.RequiredArgsConstructor;
 import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.skywalking.oap.server.core.Const;
 import org.apache.skywalking.oap.server.core.CoreModule;
 import org.apache.skywalking.oap.server.core.analysis.IDManager;
 import org.apache.skywalking.oap.server.core.analysis.manual.searchtag.Tag;
 import 
org.apache.skywalking.oap.server.core.analysis.manual.segment.SegmentRecord;
 import org.apache.skywalking.oap.server.core.config.ConfigService;
+import 
org.apache.skywalking.oap.server.core.config.SearchableTracesTagsWatcher;
 import org.apache.skywalking.oap.server.core.query.input.Duration;
 import org.apache.skywalking.oap.server.core.query.type.BasicTrace;
 import org.apache.skywalking.oap.server.core.query.type.QueryOrder;
@@ -47,12 +47,9 @@ import java.io.IOException;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Base64;
 import java.util.Collections;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 import java.util.stream.Collectors;
 
 import static java.util.Objects.nonNull;
@@ -66,7 +63,7 @@ public class JDBCTraceQueryDAO implements ITraceQueryDAO {
     private final JDBCClient jdbcClient;
     private final TableHelper tableHelper;
 
-    private Set<String> searchableTagKeys;
+    private SearchableTracesTagsWatcher searchableTagKeys;
 
     private static String DETAIL_SELECT_QUERY = "select " + 
SegmentRecord.SEGMENT_ID + ", " +
         SegmentRecord.TRACE_ID + ", " +
@@ -96,12 +93,12 @@ public class JDBCTraceQueryDAO implements ITraceQueryDAO {
             final ConfigService configService = manager.find(CoreModule.NAME)
                                                        .provider()
                                                        
.getService(ConfigService.class);
-            searchableTagKeys = new 
HashSet<>(Arrays.asList(configService.getSearchableTracesTags().split(Const.COMMA)));
+            searchableTagKeys = configService.getSearchableTracesTags();
         }
-        if (tags != null && 
!searchableTagKeys.containsAll(tags.stream().map(Tag::getKey).collect(toSet())))
 {
+        if (tags != null && 
!searchableTagKeys.getSearchableTags().containsAll(tags.stream().map(Tag::getKey).collect(toSet())))
 {
             log.warn(
                 "Searching tags that are not searchable: {}",
-                
tags.stream().map(Tag::getKey).filter(not(searchableTagKeys::contains)).collect(toSet()));
+                
tags.stream().map(Tag::getKey).filter(not(searchableTagKeys.getSearchableTags()::contains)).collect(toSet()));
             return new TraceBrief();
         }
 
diff --git 
a/oap-server/server-tools/profile-exporter/tool-profile-snapshot-server-mock/src/main/java/org/apache/skywalking/oap/server/tool/profile/core/MockCoreModuleProvider.java
 
b/oap-server/server-tools/profile-exporter/tool-profile-snapshot-server-mock/src/main/java/org/apache/skywalking/oap/server/tool/profile/core/MockCoreModuleProvider.java
index b5f6d16d4e..b40be4e6fd 100755
--- 
a/oap-server/server-tools/profile-exporter/tool-profile-snapshot-server-mock/src/main/java/org/apache/skywalking/oap/server/tool/profile/core/MockCoreModuleProvider.java
+++ 
b/oap-server/server-tools/profile-exporter/tool-profile-snapshot-server-mock/src/main/java/org/apache/skywalking/oap/server/tool/profile/core/MockCoreModuleProvider.java
@@ -18,8 +18,6 @@
 
 package org.apache.skywalking.oap.server.tool.profile.core;
 
-import java.io.IOException;
-import java.util.Collections;
 import org.apache.skywalking.oap.server.core.CoreModule;
 import org.apache.skywalking.oap.server.core.CoreModuleConfig;
 import org.apache.skywalking.oap.server.core.CoreModuleProvider;
@@ -73,6 +71,9 @@ import 
org.apache.skywalking.oap.server.tool.profile.core.mock.MockSourceReceive
 import 
org.apache.skywalking.oap.server.tool.profile.core.mock.MockStreamAnnotationListener;
 import 
org.apache.skywalking.oap.server.tool.profile.core.mock.MockWorkerInstancesService;
 
+import java.io.IOException;
+import java.util.Collections;
+
 public class MockCoreModuleProvider extends CoreModuleProvider {
 
     private final StorageModels storageModels;
@@ -119,7 +120,7 @@ public class MockCoreModuleProvider extends 
CoreModuleProvider {
         this.registerServiceImplementation(MeterSystem.class, new 
MeterSystem(getManager()));
 
         CoreModuleConfig moduleConfig = new CoreModuleConfig();
-        this.registerServiceImplementation(ConfigService.class, new 
ConfigService(moduleConfig));
+        this.registerServiceImplementation(ConfigService.class, new 
ConfigService(moduleConfig, this));
         this.registerServiceImplementation(
                 DownSamplingConfigService.class, new 
DownSamplingConfigService(Collections.emptyList()));
 

Reply via email to