You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wa...@apache.org on 2026/08/07 04:19:04 UTC

(skywalking-showcase) 01/01: BanyanDB support trace tail-sampling, bump up BanyanDB/OAP/UI

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

wankai123 pushed a commit to branch tail-sampling
in repository https://gitbox.apache.org/repos/asf/skywalking-showcase.git

commit 657437d77d01c16856d8efa8bd444c0076307b88
Author: wankai123 <wa...@foxmail.com>
AuthorDate: Fri Aug 7 12:18:48 2026 +0800

    BanyanDB support trace tail-sampling, bump up BanyanDB/OAP/UI
---
 Makefile.in                                        | 11 ++-
 .../docker-compose.banyandb-tail-sampling.yaml     | 92 ++++++++++++++++++++++
 deploy/platform/kubernetes/Chart.yaml              |  2 +-
 deploy/platform/kubernetes/values.yaml             | 13 +++
 4 files changed, 114 insertions(+), 4 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 800fc1d..3686c04 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -26,17 +26,22 @@ HUB ?= ghcr.io/apache/skywalking-showcase
 TAG ?= $(shell git rev-parse --short HEAD)
 
 BANYANDB_IMAGE ?= ghcr.io/apache/skywalking-banyandb
-BANYANDB_IMAGE_TAG ?= b1fc90553296510ec787c755411abe83ac12527e
+# banyandb-tail-sampling resolves the "-plugins" / "-plugins-carrier" variants of this tag. Both
+# must exist AND the carrier must ship the first-party samplers (sw-trace-sampler.so,
+# zipkin-trace-sampler.so), which land in d552528a — an earlier tag carries only the reference
+# latencystatussampler.so, and the sampler then fails to load with "realpath failed".
+BANYANDB_IMAGE_TAG ?= 8eda9bb7cff6e5ba6f1d4411012947fdcbea40d6
 STORAGE_CLASS ?= ""
 
 ES_IMAGE ?= docker.elastic.co/elasticsearch/elasticsearch-oss
 ES_IMAGE_TAG ?= 7.10.2
 
 SW_OAP_IMAGE ?= ghcr.io/apache/skywalking/oap
-SW_OAP_IMAGE_TAG ?= 5f6496e72c9acab1ce6ef107f3a168f6eaff8f40
+# banyandb-tail-sampling needs the bydb.yml `pipeline` block, which lands in c66a476a (#13965).
+SW_OAP_IMAGE_TAG ?= c59f7b410b20596a1effa09161d334cb081eea33
 
 SW_UI_IMAGE ?= ghcr.io/apache/skywalking-horizon-ui
-SW_UI_IMAGE_TAG ?= d30321509e49dcde2f76023f9b6dbef4948f8589
+SW_UI_IMAGE_TAG ?= e1c1363fe6c598a148648531653e9f72a423614e
 
 SW_CLI_IMAGE ?= ghcr.io/apache/skywalking-cli/skywalking-cli:bce7faaabbd57ed1f40156af8a8eb6c3eccea4ae
 SW_EVENT_EXPORTER_IMAGE ?= ghcr.io/apache/skywalking-kubernetes-event-exporter/skywalking-kubernetes-event-exporter:8a012a3f968cb139f817189afb9b3748841bba22
diff --git a/deploy/platform/docker/docker-compose.banyandb-tail-sampling.yaml b/deploy/platform/docker/docker-compose.banyandb-tail-sampling.yaml
new file mode 100644
index 0000000..f2edfe8
--- /dev/null
+++ b/deploy/platform/docker/docker-compose.banyandb-tail-sampling.yaml
@@ -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.
+#
+
+# Trace tail sampling: BanyanDB drops whole traces AFTER they are stored, during its own
+# compaction, using a native sampler plugin loaded in the data node (the standalone service
+# also satisfies the data-node role). Unlike the ingest-side trace sampling this reclaims
+# space already written and sees the whole trace rather than one segment as it arrives; the
+# two are independent gates, so enabling both multiplies the drop rate.
+#
+# Use with the `single-node` feature, listing this flag after it so this overlay wins the merge.
+# It does not apply to `cluster`: a no-init OAP defers all boot-time DDL to the dedicated init
+# OAP, so there it is oap-init that creates the group and therefore pushes the pipeline config —
+# the settings below would have to move onto that service to take effect.
+version: '2.1'
+
+services:
+  # Delivers the sampler .so into a shared volume and exits. Must be the "-plugins-carrier"
+  # image at the SAME tag as the host image below: plugin.Open requires the .so and the host
+  # binary to share an exact toolchain/module-graph/libc, and both are built from one commit in
+  # one CI run. A tag skew is rejected at load time (fail-open, so nothing gets dropped).
+  banyandb-plugin-carrier:
+    image: ${BANYANDB_IMAGE}:${BANYANDB_IMAGE_TAG}-plugins-carrier
+    networks: [ sw ]
+    command: sh -c "cp /plugins/*.so /shared/ && ls -l /shared"
+    volumes:
+      - banyandb-plugins:/shared
+
+  banyandb:
+    # The plugin-capable host image. Go plugins need a CGO-enabled, dynamically linked host, so
+    # the default and "-slim" images (static, CGO_ENABLED=0) can load no plugin at all — they
+    # ignore the pipeline config silently. This one ships /plugins empty; the carrier fills it.
+    image: ${BANYANDB_IMAGE}:${BANYANDB_IMAGE_TAG}-plugins
+    # The last two flags exist only to make the verdict observable in a demo, and are not
+    # representative of a real deployment: the filter runs during compaction, and compaction is
+    # driven by part count, so with node defaults a low-traffic showcase can go a long time
+    # before any trace is judged at all. Merging as soon as a second part lands makes a filtering
+    # merge fire promptly instead. Upstream's e2e for this feature uses the same two knobs.
+    command: >-
+      standalone
+      --trace-pipeline-native-plugin-enabled=true
+      --trace-pipeline-trusted-plugin-dir=/plugins
+      --trace-max-merge-parts=2
+      --trace-flush-timeout=500ms
+    volumes:
+      - banyandb-plugins:/plugins
+    # The "-plugins" image is distroless (no shell, no nc), so the inherited healthcheck cannot
+    # run. Dependents wait on service_started instead — see the oap override below.
+    healthcheck:
+      disable: true
+    depends_on:
+      banyandb-plugin-carrier:
+        condition: service_completed_successfully
+
+  oap:
+    environment:
+      # The only settings the showcase overrides: enabling a group's pipeline in bydb.yml is what
+      # activates the plugin, since OAP then pushes it onto that group as a TracePipelineConfig and
+      # the data node reconciles and loads the .so. Everything else — which events run the chain,
+      # the grace windows, and the sampler rules (duration threshold, keepErrors, healthy sample
+      # rate) — is left at OAP's own bydb.yml defaults, so this overlay demonstrates the
+      # out-of-the-box behaviour rather than a tuned one. See the BanyanDB storage guide for the
+      # full SW_STORAGE_BANYANDB_{TRACE,ZIPKIN_TRACE}_{PIPELINE,SAMPLER}_* list.
+      #
+      # The two groups are independent, each with its own plugin: sw-trace-sampler.so reads the
+      # native segment columns (is_error, the flattened "tags" array), zipkin-trace-sampler.so
+      # reads the Zipkin span schema ("query" array, error-as-tag). Both ship in the carrier.
+      SW_STORAGE_BANYANDB_TRACE_PIPELINE_ENABLED: "true"
+      SW_STORAGE_BANYANDB_ZIPKIN_TRACE_PIPELINE_ENABLED: "true"
+    depends_on:
+      banyandb:
+        condition: service_started
+
+volumes:
+  banyandb-plugins:
+
+networks:
+  sw:
diff --git a/deploy/platform/kubernetes/Chart.yaml b/deploy/platform/kubernetes/Chart.yaml
index cf885aa..d0e5dfa 100644
--- a/deploy/platform/kubernetes/Chart.yaml
+++ b/deploy/platform/kubernetes/Chart.yaml
@@ -24,7 +24,7 @@ sources:
 dependencies:
   - name: skywalking-helm
     alias: skywalking
-    version: 0.0.0-3f93c510b62b9e56b4c6161195b25c6a5aaa7cf4
+    version: 0.0.0-b67901a2abf385ace84934f0c9c249d322d972d4
     repository: oci://ghcr.io/apache/skywalking-helm
 
     # @feature: java-agent-injector; the java agent injector is a component of the swck operator, so we need to deploy the swck operator firstly
diff --git a/deploy/platform/kubernetes/values.yaml b/deploy/platform/kubernetes/values.yaml
index 3c952a1..6fc84e4 100644
--- a/deploy/platform/kubernetes/values.yaml
+++ b/deploy/platform/kubernetes/values.yaml
@@ -96,6 +96,13 @@ skywalking:
       SW_STORAGE_BANYANDB_METRICS_DAY_COLD_TTL_DAYS: "30"
       SW_STORAGE_BANYANDB_METADATA_TTL_DAYS: "60"
       SW_STORAGE_BANYANDB_COMPATIBLE_SERVER_API_VERSIONS: "0.9,0.10"
+      # Trace tail sampling: enabling a group's pipeline is what activates the sampler, since OAP
+      # pushes it onto that group as a TracePipelineConfig and the data node loads the matching
+      # .so (sw-trace-sampler.so / zipkin-trace-sampler.so). Everything else — the events, the
+      # grace windows and the sampler rules — is left at OAP's bydb.yml defaults. Needs
+      # skywalking.banyandb.plugins.enabled above, or the config is accepted and never applied.
+      SW_STORAGE_BANYANDB_TRACE_PIPELINE_ENABLED: "true"
+      SW_STORAGE_BANYANDB_ZIPKIN_TRACE_PIPELINE_ENABLED: "true"
       SW_TRACEQL: default
       SW_TRACEQL_ENABLE_DATASOURCE_ZIPKIN: "true"
       SW_TRACEQL_ENABLE_DATASOURCE_SKYWALKING: "true"
@@ -174,6 +181,12 @@ skywalking:
     image:
       repository: ~
       tag: ~
+    # Trace tail sampling: switch the data nodes to the "-plugins" host image, mount the lockstep
+    # "-plugins-carrier" .so at /plugins, and pass the two loader flags. Liaison never hosts
+    # plugins. This only makes the node capable of filtering; the OAP env below is what activates
+    # it per group. Requires a BanyanDB subchart with sampler-plugin support.
+    plugins:
+      enabled: true
     standalone:
       enabled: false
     cluster: