Skip to content

Commit 8242ff6

Browse files
authored
Fix: remove the dependency from VirtualServiceAnalysisListener if GenAIAnalyzerModule is disabled. (#13838)
1 parent 315defe commit 8242ff6

2 files changed

Lines changed: 17 additions & 13 deletions

File tree

docs/en/changes/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
* Fix LAL `layer: auto` mode dropping logs after extractor set the layer. Codegen now propagates `layer "..."` assignments to `LogMetadata.layer` so `FilterSpec.doSink()` sees the script-decided layer.
3737
* Fix MetricKit histogram percentile metrics being reported at 1000× their true value — the listener now marks its `SampleFamily` with `defaultHistogramBucketUnit(MILLISECONDS)` so MAL's default SECONDS→MS rescale of `le` labels is not applied.
3838
* Add WeChat and Alipay Mini Program monitoring via the SkyAPM mini-program-monitor SDK (SWIP-12). Two new layers (`WECHAT_MINI_PROGRAM`, `ALIPAY_MINI_PROGRAM`); two new JavaScript componentIds (`WeChat-MiniProgram: 10002`, `AliPay-MiniProgram: 10003`). Service / instance / endpoint entities are produced by MAL + LAL, not trace analysis — mini-programs are client-side (exit-only) so `RPCAnalysisListener` stays unchanged (same pattern as browser and iOS). MAL rules per platform × scope under `otel-rules/miniprogram/` with explicit `.service(...)` / `.endpoint(...)` chains (empty `expSuffix` so endpoint-scope rules aren't overridden), histogram percentile via `.histogram("le", TimeUnit.MILLISECONDS)` to keep ms bucket bounds intact, and request-cpm derived from the histogram `_count` family. LAL `layer: auto` rule produces both layers via `miniprogram.platform` dispatch and emits error-count samples consumed by per-platform log-MAL rules. Per-layer menu entries and service / instance / endpoint dashboards with Trace and Log sub-tabs.
39+
* Fix: remove `VirtualServiceAnalysisListener`'s dependency on `GenAIAnalyzerModule` if it is disabled.
3940
* MAL: register `TimeUnit` in `MALCodegenHelper.ENUM_FQCN` so rule YAML can write `.histogram("le", TimeUnit.MILLISECONDS)` for SDKs that emit histogram bucket bounds in ms (default `SECONDS` unit applies a ×1000 rescale that would otherwise inflate stored `le` labels 1000×).
4041

4142
#### UI

oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/VirtualServiceAnalysisListener.java

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
package org.apache.skywalking.oap.server.analyzer.provider.trace.parser.listener;
2020

21-
import java.util.Arrays;
21+
import java.util.ArrayList;
2222
import java.util.List;
2323

2424
import lombok.RequiredArgsConstructor;
@@ -82,22 +82,25 @@ public Factory(ModuleManager moduleManager) {
8282
this.namingControl = moduleManager.find(CoreModule.NAME)
8383
.provider()
8484
.getService(NamingControl.class);
85-
this.genAIMeterAnalyzerService = moduleManager.find(GenAIAnalyzerModule.NAME)
86-
.provider()
87-
.getService(IGenAIMeterAnalyzerService.class);
85+
if (moduleManager.has(GenAIAnalyzerModule.NAME)) {
86+
this.genAIMeterAnalyzerService = moduleManager.find(GenAIAnalyzerModule.NAME)
87+
.provider()
88+
.getService(IGenAIMeterAnalyzerService.class);
89+
} else {
90+
this.genAIMeterAnalyzerService = null;
91+
}
8892
}
8993

9094
@Override
9195
public AnalysisListener create(ModuleManager moduleManager, AnalyzerModuleConfig config) {
92-
return new VirtualServiceAnalysisListener(
93-
sourceReceiver,
94-
Arrays.asList(
95-
new VirtualCacheProcessor(namingControl, config),
96-
new VirtualDatabaseProcessor(namingControl, config),
97-
new VirtualMQProcessor(namingControl),
98-
new VirtualGenAIProcessor(genAIMeterAnalyzerService)
99-
)
100-
);
96+
List<VirtualServiceProcessor> processors = new ArrayList<>();
97+
processors.add(new VirtualCacheProcessor(namingControl, config));
98+
processors.add(new VirtualDatabaseProcessor(namingControl, config));
99+
processors.add(new VirtualMQProcessor(namingControl));
100+
if (genAIMeterAnalyzerService != null) {
101+
processors.add(new VirtualGenAIProcessor(genAIMeterAnalyzerService));
102+
}
103+
return new VirtualServiceAnalysisListener(sourceReceiver, processors);
101104
}
102105
}
103106

0 commit comments

Comments
 (0)