Repository navigation
Move the native trace analysis from Java listeners to TAL rules (SWIP-17) - #14208
Merged
Merged
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
The native-trace migration spans generated TAL execution and module startup ordering, requiring maintainer validation of output parity and boot behavior unavailable in this source-only review.
No open issues 🎉
What changed in this PR
Moves SkyWalking’s native trace analysis into the TAL-based trace-analyzer, while retaining the Java listeners as a test-only comparison baseline.
Changes:
- Routes native segments through TAL rules, with native execution state, output builders and function extension points.
- Adds comparison-checker support and compiler/runtime test fixtures.
- Updates configuration, module dependencies and tracing documentation.
| File | Description |
|---|---|
| test/script-cases/trace-analysis-v1-v2-checker/src/test/resources/checker-allowed-misses.yml | Updated as part of this pull request. |
| test/script-cases/trace-analysis-v1-v2-checker/src/test/java/org/apache/skywalking/oap/trace/analysis/checker/CheckerWireIndex.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-v1-v2-checker/src/test/java/org/apache/skywalking/oap/trace/analysis/checker/CheckerNamingControl.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-v1-v2-checker/src/test/java/org/apache/skywalking/oap/trace/analysis/checker/CheckerFrameClassifier.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-v1-v2-checker/src/test/java/org/apache/skywalking/oap/trace/analysis/checker/CheckerEvaluationService.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-v1-v2-checker/src/test/java/org/apache/skywalking/oap/trace/analysis/checker/CheckerDifference.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-v1-v2-checker/src/test/java/org/apache/skywalking/oap/trace/analysis/checker/CheckerApplicationYml.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-v1-v2-checker/src/test/java/org/apache/skywalking/oap/server/core/cache/CheckerAliasCacheLoader.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-listener-v1/src/test/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/MockReceiver.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-listener-v1/src/main/resources/META-INF/services/org.apache.skywalking.oap.server.analyzer.provider.trace.parser.listener.AnalysisListenerFactory | Updated as part of this pull request. |
| test/script-cases/trace-analysis-listener-v1/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/SpanTags.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-listener-v1/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/SegmentParserServiceImpl.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-listener-v1/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/SegmentParserListenerManager.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-listener-v1/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/ListenerManagerAssembly.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-listener-v1/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/vservice/VirtualServiceProcessor.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-listener-v1/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/vservice/VirtualGenAIProcessor.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-listener-v1/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/SegmentListener.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-listener-v1/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/LocalAnalysisListener.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-listener-v1/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/FirstAnalysisListener.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-listener-v1/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/ExitAnalysisListener.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-listener-v1/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/EntryAnalysisListener.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-listener-v1/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/EndpointSourceBuilder.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-listener-v1/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/EndpointDependencyBuilder.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-listener-v1/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/CommonAnalysisListener.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-listener-v1/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/AnalysisListenerFactory.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-listener-v1/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/AnalysisListener.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-listener-v1/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/ISegmentParserListenerManager.java | Updated as part of this pull request. |
| test/script-cases/trace-analysis-listener-v1/pom.xml | Updated as part of this pull request. |
| test/script-cases/pom.xml | Updated as part of this pull request. |
| test/e2e-v2/cases/storage/expected/config-dump.yml | Updated as part of this pull request. |
| pom.xml | Updated as part of this pull request. |
| oap-server/server-tools/data-generator/src/main/resources/application.yml | Updated as part of this pull request. |
| oap-server/server-tools/data-generator/src/main/java/org/apache/skywalking/restapi/SegmentGeneratorHandler.java | Updated as part of this pull request. |
| oap-server/server-tools/data-generator/src/main/java/org/apache/skywalking/module/DataGeneratorModuleProvider.java | Updated as part of this pull request. |
| oap-server/server-starter/src/main/resources/tal/native-network-alias.yaml | Updated as part of this pull request. |
| oap-server/server-starter/src/main/resources/tal/native-ai-evaluation.yaml | Updated as part of this pull request. |
| oap-server/server-starter/src/main/resources/application.yml | Updated as part of this pull request. |
| oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/TraceModuleProvider.java | Updated as part of this pull request. |
| oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/handler/v8/rest/TraceSegmentReportHandler.java | Updated as part of this pull request. |
| oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/handler/v8/grpc/TraceSegmentReportServiceHandler.java | Updated as part of this pull request. |
| oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/pom.xml | Updated as part of this pull request. |
| oap-server/server-receiver-plugin/otel-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/otel/otlp/ShippedRuleOverRecordedTraceTest.java | Updated as part of this pull request. |
| oap-server/server-fetcher-plugin/kafka-fetcher-plugin/src/main/java/org/apache/skywalking/oap/server/analyzer/agent/kafka/provider/KafkaFetcherProvider.java | Updated as part of this pull request. |
| oap-server/server-fetcher-plugin/kafka-fetcher-plugin/src/main/java/org/apache/skywalking/oap/server/analyzer/agent/kafka/provider/handler/TraceSegmentHandler.java | Updated as part of this pull request. |
| oap-server/server-fetcher-plugin/kafka-fetcher-plugin/pom.xml | Updated as part of this pull request. |
| oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/TALOutputBuilder.java | Updated as part of this pull request. |
| oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/TALFunctionProvider.java | Updated as part of this pull request. |
| oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/TALFunctionContext.java | Updated as part of this pull request. |
| oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/DefaultScopeDefine.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/test/resources/tal-native-files/third.yaml | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/test/resources/tal-native-files/second.yaml | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/test/resources/tal-native-files/otlp-rule.yaml | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/test/resources/tal-native-files/first.yaml | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/test/resources/tal-native-files/duplicate.yaml | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/test/java/org/apache/skywalking/oap/trace/analyzer/v2/provider/NativeRuleFilesTest.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/test/java/org/apache/skywalking/oap/trace/analyzer/v2/dsl/TestTypedOutput.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/test/java/org/apache/skywalking/oap/trace/analyzer/v2/dsl/TestSpanSourceTypeProvider.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/test/java/org/apache/skywalking/oap/trace/analyzer/v2/dsl/TestSpanChild.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/test/java/org/apache/skywalking/oap/trace/analyzer/v2/dsl/TestRefineProvider.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/test/java/org/apache/skywalking/oap/trace/analyzer/v2/dsl/TestNestedSpanInput.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/test/java/org/apache/skywalking/oap/trace/analyzer/v2/dsl/TestNativeTwiceProvider.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/test/java/org/apache/skywalking/oap/trace/analyzer/v2/dsl/TestNativeSideProvider.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/test/java/org/apache/skywalking/oap/trace/analyzer/v2/dsl/TestNativeRecord.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/test/java/org/apache/skywalking/oap/trace/analyzer/v2/dsl/TestMetadataSideProvider.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/test/java/org/apache/skywalking/oap/trace/analyzer/v2/dsl/TestInputProvider.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/test/java/org/apache/skywalking/oap/trace/analyzer/v2/dsl/TestFunctionProvider.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/test/java/org/apache/skywalking/oap/trace/analyzer/v2/dsl/TestDuplicateFunctionProvider.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/test/java/org/apache/skywalking/oap/trace/analyzer/v2/dsl/TALWorkedExampleTest.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/test/java/org/apache/skywalking/oap/trace/analyzer/v2/dsl/TALTestModules.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/test/java/org/apache/skywalking/oap/trace/analyzer/v2/dsl/TALExecutionTest.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/main/resources/META-INF/services/org.apache.skywalking.oap.trace.analyzer.v2.spi.TALSourceTypeProvider | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/main/java/org/apache/skywalking/oap/trace/analyzer/v2/spi/TALConstruct.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/main/java/org/apache/skywalking/oap/trace/analyzer/v2/provider/TraceAnalyzerModuleProvider.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/main/java/org/apache/skywalking/oap/trace/analyzer/v2/provider/TraceAnalyzerModuleConfig.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/main/java/org/apache/skywalking/oap/trace/analyzer/v2/provider/nativetrace/SwNativeSegmentState.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/main/java/org/apache/skywalking/oap/trace/analyzer/v2/provider/nativetrace/NetworkAliasMatch.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/main/java/org/apache/skywalking/oap/trace/analyzer/v2/provider/nativetrace/ISegmentParserService.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/main/java/org/apache/skywalking/oap/trace/analyzer/v2/provider/nativetrace/GenAIModelMatch.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/main/java/org/apache/skywalking/oap/trace/analyzer/v2/module/TraceAnalyzerModule.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/main/java/org/apache/skywalking/oap/trace/analyzer/v2/dsl/TalExpression.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/main/java/org/apache/skywalking/oap/trace/analyzer/v2/dsl/TalDSL.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/main/java/org/apache/skywalking/oap/trace/analyzer/v2/dsl/QueuedBuild.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/main/java/org/apache/skywalking/oap/trace/analyzer/v2/compiler/TALRuntimeRoles.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/main/java/org/apache/skywalking/oap/trace/analyzer/v2/compiler/TALRootResolver.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/main/java/org/apache/skywalking/oap/trace/analyzer/v2/compiler/TALOutputBuilders.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/main/java/org/apache/skywalking/oap/trace/analyzer/v2/compiler/TALLocalVar.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/main/java/org/apache/skywalking/oap/trace/analyzer/v2/compiler/TALInputs.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/main/java/org/apache/skywalking/oap/trace/analyzer/v2/compiler/rt/TalNativeOutputs.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/main/java/org/apache/skywalking/oap/trace/analyzer/v2/compiler/ExprType.java | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/main/antlr4/org/apache/skywalking/tal/rt/grammar/TALParser.g4 | Updated as part of this pull request. |
| oap-server/analyzer/trace-analyzer/src/main/antlr4/org/apache/skywalking/tal/rt/grammar/TALLexer.g4 | Updated as part of this pull request. |
| oap-server/analyzer/ai-evaluation/src/main/resources/META-INF/services/org.apache.skywalking.oap.server.core.source.TALOutputBuilder | Updated as part of this pull request. |
| oap-server/analyzer/ai-evaluation/src/main/resources/META-INF/services/org.apache.skywalking.oap.server.core.source.TALFunctionProvider | Updated as part of this pull request. |
| oap-server/analyzer/ai-evaluation/src/main/java/org/apache/skywalking/oap/server/ai/evaluation/listener/GenAIEvaluationSampleBuilder.java | Updated as part of this pull request. |
| oap-server/analyzer/ai-evaluation/src/main/java/org/apache/skywalking/oap/server/ai/evaluation/AIEvaluationTALFunctions.java | Updated as part of this pull request. |
| oap-server/analyzer/ai-evaluation/src/main/java/org/apache/skywalking/oap/server/ai/evaluation/AIEvaluationSamplingConfig.java | Updated as part of this pull request. |
| oap-server/analyzer/ai-evaluation/src/main/java/org/apache/skywalking/oap/server/ai/evaluation/AIEvaluationProvider.java | Updated as part of this pull request. |
| oap-server/analyzer/ai-evaluation/src/main/java/org/apache/skywalking/oap/server/ai/evaluation/AIEvaluationModule.java | Updated as part of this pull request. |
| oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/NativeTraceAnalysisConfigImpl.java | Updated as part of this pull request. |
| oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/NativeTraceAnalysisConfig.java | Updated as part of this pull request. |
| oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/AnalyzerModuleProvider.java | Updated as part of this pull request. |
| oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/module/AnalyzerModule.java | Updated as part of this pull request. |
| docs/menu.yml | Updated as part of this pull request. |
| docs/en/swip/readme.md | Updated as part of this pull request. |
| docs/en/setup/backend/zipkin-trace.md | Updated as part of this pull request. |
| docs/en/setup/backend/uninstrumented-gateways.md | Updated as part of this pull request. |
| docs/en/setup/backend/tracing-overview.md | Updated as part of this pull request. |
| docs/en/setup/backend/trace-sampling.md | Updated as part of this pull request. |
| docs/en/setup/backend/server-clusters.md | Updated as part of this pull request. |
| docs/en/setup/backend/otlp-trace.md | Updated as part of this pull request. |
| docs/en/setup/backend/otlp-trace-practices/message-queue.md | Updated as part of this pull request. |
| docs/en/setup/backend/otlp-trace-practices/gateway-overview.md | Updated as part of this pull request. |
| docs/en/setup/backend/native-trace.md | Updated as part of this pull request. |
| docs/en/setup/backend/configuration-vocabulary.md | Updated as part of this pull request. |
| docs/en/setup/backend/backend-wechat-mini-program-monitoring.md | Updated as part of this pull request. |
| docs/en/setup/backend/backend-alipay-mini-program-monitoring.md | Updated as part of this pull request. |
| docs/en/changes/changes.md | Updated as part of this pull request. |
Review effort: Balanced
wu-sheng
force-pushed
the
swip-17-tal-native-trace
branch
3 times, most recently
from
November 10, 2026 03:55
4bd9b4c to
282437e
Compare
…-17)
The analysis of SkyWalking agents' segments now runs as seven TAL rule files
(config/tal/native-*.yaml, listed in trace-analyzer's nativeTalFiles) on a new
sw-native input whose span is the agent's protobuf SpanObject. trace-analyzer
hosts the runner and ISegmentParserService. The listeners and the
AnalysisListenerFactory SPI leave production and stay as the comparison
baseline in test/script-cases/trace-analysis-listener-v1.
TAL gains assignment, foreach, log, typed Layer/enum values, requiredModules,
more functions and source {} for every input, and for the native input
build {}, first {}, segmentDef and writeNetworkAlias, with function extension
points for inputs (TALSourceTypeProvider) and modules (TALFunctionProvider).
Records are sources: the OTLP outputType key, sink {} and TALOutputBuilder are
removed, the shipped otlp-slow-sql rule writes source DatabaseSlowStatement {},
and AI evaluation samples are a GenAIEvaluationSample source that
ai-evaluation's dispatcher takes. The new otlp-ai-evaluation rule samples
natively stored OTLP GenAI spans in place of the span listener's OTLP path,
for services that set service.layer=OTLP_GENERAL; Zipkin keeps the listener.
Metrics, topology and stored traces stay the same, except that tag lookups and
tag maps keep the first value of a repeated key, and native AI evaluation
samples are deferred to the build phase, so a failure before their builds run
emits none. A failure while an OTLP rule dispatches a source fails that rule, as
any rule failure does.
A bare host now matches a gateway listed at port 80 for agent traces, as it
already did for OpenTelemetry traces. A custom OTLP rule file that uses
outputType or sink {} fails to load until its record moves to source {}.
The v1-v2 checker compares the listeners and the rules at TAL's outputs across
21 profiles with a JaCoCo branch gate, and NativeTraceBenchmark compares their
throughput and allocation: in the recorded JMH run, TAL's mean throughput
ranged from 6.4% lower to 8.1% higher than the listeners, while allocation fell
by 4.4-19.7%. The tracing docs are reorganized by source, SWIP-17 is synced to
what was built, and a tal contributor skill is added.
wu-sheng
force-pushed
the
swip-17-tal-native-trace
branch
from
November 10, 2026 04:29
282437e to
382f5e6
Compare
wankai123
approved these changes
Nov 10, 2026
3 of 4 tasks
wu-sheng
added a commit
that referenced
this pull request
Nov 10, 2026
…nload hardening Docs: - tal.md: blocks or rules that share a metric must also agree on its labelLimit; an omitted one counts as 50. - tal-otlp.md: the meta table states the service.instance fallback of serviceInstance, the start and end time fallbacks, and the latency clamp. - trace-sampling.md: the setting is named default.rate throughout; the duration.rate and default.rare typos are fixed, and the example rates are 3500 and 5500 at the 1/10000 precision. - virtual-genai.md, trace-analyzer.md: AI evaluation of natively stored OTLP spans needs service.layer=OTLP_GENERAL, the layer otlp-ai-evaluation is declared for; the Virtual GenAI metrics and the Zipkin-path evaluation do not. trace-analyzer.md's instance row names the service.instance fallback. The changelog's otlp-ai-evaluation line no longer says every OpenTelemetry rule needs OTLP_GENERAL. - new-monitoring-feature skill: iOS does get service_cpm and the other core OAL metrics, from IOSHTTPSpanListener; browser has its own OAL metrics (browser_app_*); the anti-pattern note points at the mini-program pattern. Code: - AliasRegistrar.hostOf checks the port in place instead of through a substring and a character stream, with the same result for every input; a new AliasRegistrarTest case pins it. Tests: - OtlpAIEvaluationAnalysisTest runs the shipped otlp-ai-evaluation rule through TraceAnalyzerServiceImpl: another rule's drop vote does not stop the sample, a span sent again is sampled once while the dedup window remembers it, and a failed dispatch fails only its rule, whose persist vote is then not counted. - OTLPAnalysisBeforeStorageHandlerTest: a span that a span listener vetoes still reaches the TAL analysis, and only the other span is stored. E2E: - download-mysql.sh makes up to five download attempts, 5 seconds apart, each with curl --fail and --max-time 60, and exits non-zero when all fail, so an HTTP error such as a 429 is not saved as the driver jar. After curl is installed, the download takes at most about 320 seconds, and if every attempt fails the OAP does not start. curl's --retry is not used: it sleeps for as long as a 429's Retry-After asks.
wu-sheng
added a commit
that referenced
this pull request
Nov 10, 2026
…nload hardening (#14209) Docs: - tal.md: blocks or rules that share a metric must also agree on its labelLimit; an omitted one counts as 50. - tal-otlp.md: the meta table states the service.instance fallback of serviceInstance, the start and end time fallbacks, and the latency clamp. - trace-sampling.md: the setting is named default.rate throughout; the duration.rate and default.rare typos are fixed, and the example rates are 3500 and 5500 at the 1/10000 precision. - virtual-genai.md, trace-analyzer.md: AI evaluation of natively stored OTLP spans needs service.layer=OTLP_GENERAL, the layer otlp-ai-evaluation is declared for; the Virtual GenAI metrics and the Zipkin-path evaluation do not. trace-analyzer.md's instance row names the service.instance fallback. The changelog's otlp-ai-evaluation line no longer says every OpenTelemetry rule needs OTLP_GENERAL. - new-monitoring-feature skill: iOS does get service_cpm and the other core OAL metrics, from IOSHTTPSpanListener; browser has its own OAL metrics (browser_app_*); the anti-pattern note points at the mini-program pattern. Code: - AliasRegistrar.hostOf checks the port in place instead of through a substring and a character stream, with the same result for every input; a new AliasRegistrarTest case pins it. Tests: - OtlpAIEvaluationAnalysisTest runs the shipped otlp-ai-evaluation rule through TraceAnalyzerServiceImpl: another rule's drop vote does not stop the sample, a span sent again is sampled once while the dedup window remembers it, and a failed dispatch fails only its rule, whose persist vote is then not counted. - OTLPAnalysisBeforeStorageHandlerTest: a span that a span listener vetoes still reaches the TAL analysis, and only the other span is stored. E2E: - download-mysql.sh makes up to five download attempts, 5 seconds apart, each with curl --fail and --max-time 60, and exits non-zero when all fail, so an HTTP error such as a 429 is not saved as the driver jar. After curl is installed, the download takes at most about 320 seconds, and if every attempt fails the OAP does not start. curl's --retry is not used: it sleeps for as long as a 429's Retry-After asks.
Moutia-Ben-Yahia
pushed a commit
to HotOpenSourcing/skywalking
that referenced
this pull request
Nov 10, 2026
…2e download hardening (apache#14209)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move the SkyWalking native trace analysis from Java listeners to TAL rules
docs/en/swip/SWIP-17.md, synced to what was built), discussed in [SWIP-17] [DISCUSS] Move the Native Trace Analysis from Java Listeners to TAL #14205.What changed
sw-nativeinput: segment, RPC entry/exit/logic endpoints, cross-thread endpoints, network alias, virtual cache/database/MQ/GenAI, and AI evaluation. The rules ship asconfig/tal/native-*.yaml, listed in the newtrace-analyzersettingnativeTalFiles(SW_TRACE_NATIVE_TAL_FILES).trace-analyzerhosts the runner, andISegmentParserServicemoved there. The listeners and theAnalysisListenerFactorySPI left production and are kept as the comparison baseline intest/script-cases/trace-analysis-listener-v1.spanis the agent's protobufSpanObject. The segment issegment(), and the runner's segment-wide results are functions:segmentStartTime(),segmentLatency(),segmentIsError(),segmentTags(),segmentSampled(),segmentBytes().=,foreach,log, typedas Layer/as <Enum>,requiredModules,source {}(an existing source, an OAL source or a record such asDatabaseSlowStatement), and more functions (isEmpty,toJson,formatServiceName, …).build {}, where a native rule makes its outputs,first {},segmentDefandwriteNetworkAlias.source {}. The OTLPoutputTypekey,sink {}and theTALOutputBuilderinterface are removed; the shippedotlp-slow-sqlrule writessource DatabaseSlowStatement {}. AI evaluation samples are a newGenAIEvaluationSamplesource, whichai-evaluation's dispatcher hands to its evaluation service.otlp-ai-evaluationrule (tal/otlp-ai-evaluation.yaml, added to the defaulttalFiles) samples natively stored OTLP GenAI spans in place of the span listener's OTLP path. Zipkin, and OTLP stored as Zipkin spans, keep the listener.meta.traceStoragetells a rule how the span is stored;matchGenAIModeland the twoai-evaluationfunctions serve every input.TALSourceTypeProvidergains constructs, helper functions andbind(ModuleManager).TALFunctionProvider(server-core) lets other modules contribute functions, each provider declaring the inputs it serves;ai-evaluationcontributesevaluationActive()andevaluationSampleRate(). A module takes an output of its own as a source with itsSourceDispatcher.tal-otlp.mdandtal-sw-native.mdbeside the sharedtal.md,native-trace.md,native-trace-analysis.mdandtracing-overview.md.Behaviour
Metrics, topology and stored traces stay the same, apart from:
tag()) and tag maps keep the first value of a repeated key, and a duplicate key no longer aborts the cache analysis. Rules that iterate the raw tag list keep their previous behavior.org.apache.skywalking.trace.analysis.script.<file>; runner and shared-service diagnostics use Java logger names.SW_TRACE_ANALYZER=-stops the boot while the native trace receiver or the Kafka fetcher needs the module.outputTypeorsink {}fails to load until its record moves tosource {}. The shipped slow-statement record is unchanged.otlp-ai-evaluationsees the spans of services that setservice.layer=OTLP_GENERAL; a GenAI application that sets no layer is no longer evaluated. A deployment that overridestalFilesaddsotlp-ai-evaluation. Zipkin spans, and OTLP spans stored as Zipkin spans, are evaluated as before. The rule runs with the other TAL rules, before the receiver checks the span listeners' veto and the rules'persist {}votes, where the listener ran inside the native store after both: a span that a custom rule or listener keeps out of storage is now evaluated, though no shipped rule or listener vetoes a GenAI span. WithdedupWindowabove 0, a span sent again to the same node, while that node's dedup set still holds it, is not evaluated again. A failure while an evaluation sample is handed over no longer drops the span, as the native store's catch did when the listener threw.persist {}vote is not counted; the runner used to write the slow-statement record after the rule and keep the vote on a failed write.Verification
test/script-cases/trace-analysis-v1-v2-checker): the listeners and the rules run the same constructed segments across 21 configuration profiles, cold and warm. The comparison is at TAL's outputs: every source and record, stateful collaborator call, log line and failure. The documented differences have explicit expectations. A JaCoCo gate requires every branch of the moved listener classes to be reached, except 5 allowlisted unreachable ones (exact counts). The v1 events are written totarget/for logic review.TraceAnalyzer. They match, apart from the documented differences above.otlp-slow-sqlrule before this change, with theSlowSQLbuilder written as the OTLP runner wrote it, and after, withsource DatabaseSlowStatement {}, ran the same 32 constructed OTLP spans in two worktrees. They cover every peer-naming fallback, the server-cluster lookup, the cache and kind aborts, latency and statement edges, cutting, unicode, an over-long peer name and timestamp edges. EveryDatabaseSlowStatement(25 written, 7 refused) and every persist vote matched.otlp-ai-evaluationrule with the real dispatcher after ran the same 79 constructed OTLP spans in two worktrees, at rate 1,000,000, at rate 500,000 over 60 seeded trace ids, and inactive. All 237 outcomes matched (76, 43 and 0 sampled), with everyAIEvaluationContextfield equal, including a span with a zero start time.storage/banyandb,otlp-traces/native/banyandb(the slow-statement source),virtual-genai,mixed-virtual-genai,otlp-virtual-genai/native,otlp-virtual-genai,zipkin-virtual-genai. The two cases with natively stored OTLP GenAI spans now setservice.layer=OTLP_GENERALon their OTLP application, whichotlp-ai-evaluationneeds.storage/banyandb,gateway,virtual-mq,server-clusters/native;virtual-genai,mixed-virtual-genai;banyandb/trace-sampling,kafka/simple-so11y;lua,python,go.Performance
NativeTraceBenchmark(JMH, in the checker module) runs both engines in the same run, with two forks and logging off. It uses plain module lookups, and every emitted source is consumed by a per-thread blackhole. Results are segments per second, and bytes allocated per segment.The measurements cover the native analysis. The changes behind them:
==/equals; a built-inLayerliteral compiles to its constant.The OTLP runner is unchanged apart from no longer writing records itself; the shipped OTLP slow-SQL rule writes the same record through
source {}.TAL skill
A new contributor skill,
.claude/skills/tal/SKILL.md, summarizes how to work with TAL:SW_DYNAMIC_CLASS_ENGINE_DEBUG) and decompiling them;Follow-ups (out of scope)
The shared
AliasRegistrar.hostOfstill uses a character stream when it checks a single-colon port suffix; that helper is unchanged.Older doc inaccuracies that remain unresolved: the OTLP meta-table fallbacks, the
labelLimitsentence, the iOS advice in the new-monitoring-feature skill, and typos in the trace sampling doc.If this pull request closes/resolves/fixes an existing issue, replace the issue number. Not applicable; this PR does not close an issue.
Update the
CHANGESlog.