Skip to content

[Feature] Trace Pipeline Support in BanyanDB #13634

Closed

Description

@wu-sheng

Search before asking

  • I had searched in the issues and found no similar feature requirement.

Description

🌟 Feature Request: Trace Pipeline Support in BanyanDB (Target: v0.11)

Summary

Introduce a trace pipeline framework into BanyanDB to enable trace-oriented processing, sampling, and enrichment directly within the database layer.
The pipeline will serve as the foundation for intelligent, context-aware trace handling—allowing dynamic update, analysis, and retention decisions while preserving schema and performance guarantees.


Background

BanyanDB currently supports efficient ingestion and querying of trace data, but processing is span-oriented and lacks capabilities for post-ingestion, trace-level operations.

Modern observability scenarios—such as tail-based sampling, cross-service trace enrichment, or behavioral trace analysis—require the database to treat a group of spans (sharing the same trace ID) as one logical unit.

Introducing a trace pipeline provides a structured mechanism to:

  • Analyze and modify trace data after ingestion.
  • Aggregate spans consistently, regardless of their reported order or source.
  • Make smarter data retention decisions based on complete trace context.

Goal

Deliver a trace-level pipeline mechanism that:

  1. Processes collected spans as unified trace entities in best-effort strategy(No 100% guaranteed).
  2. Supports runtime enrichment and analysis of existing tag values, further considering to declear trace-level schema, e.g. trace latency.
  3. Maintains persistent file-based processor context across ingestion batches for continuity and scale.
  4. Enables tail-based sampling via a reserved deletion/retention flag.
  5. Integrates cleanly with OAP for schema declaration, dynamic loading, and test validation.

Use case

This issue includes several key features and use cases, mostly around trace post-analysis, e.g., tail sampling.

Most things were discussed between @hanahmily and me at a high level. No detail is confirmed yet.

Related issues

No response

Are you willing to submit a pull request to implement this on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

Activity

  1. added this to the BanyanDB - 0.11.0 milestone on Dec 25, 2025
  2. wu-sheng commented on Jan 4, 2026

    @wu-sheng
    MemberAuthor

    🧭 Additional Proposal: Metrics-Driven Sampling and Caching Design

    Design Intent

    To improve the precision and adaptability of trace sampling, BanyanDB should enable the trace pipeline to make decisions based on live system and service performance metrics.
    By aligning sampling logic with real-time latency, error characteristics, and resource utilization, the system can intelligently balance observability quality and data volume.

    This approach moves the system from rigid, threshold-based sampling toward a context-aware, self-adjusting mechanism that continuously reflects the actual operating conditions of distributed systems.


    Core Design Tenets

    1. Metrics-Centric Sampling Logic
      Introduce a metrics-aware decision layer within the trace pipeline. Sampling will factor in telemetry data such as latency percentiles, throughput, and failure ratios.
      This enables the database to prioritize traces that highlight critical performance states or anomalies rather than relying on static numeric thresholds.

    2. Unified Metrics Access Layer
      Incorporate a unified layer for reading aggregated metrics that can serve multiple purposes within the pipeline.
      This layer provides a consistent interface to access metric data, whether it originates from BanyanDB’s internal metric storage or external observability systems, ensuring flexibility and coherence in decision-making.

    3. Caching
      Introduce a caching mechanism above the metrics access layer to store recently used or recurrently needed metric values. This is different from the flagged
      The cache will maintain lightweight persistence across trace-processing batches, improving performance and stability while ensuring the data remains sufficiently fresh for high-throughput, streaming environments.

    4. Adaptive Sampling Policy
      Shift from static threshold-based policies to context-aware evaluators that can respond to live performance data.
      For instance, the policy might choose to:

      • Retain traces contributing to current P95 or P99 latency outliers.
      • Emphasize the slowest or most error-prone API endpoints.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

databaseBanyanDB - SkyWalking native databasefeatureNew feature

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions