sw-trace-sampler

command
v0.11.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command sw-trace-sampler is the first-party post-trace sampler for the SkyWalking-native segment schema (group sw_trace, BanyanDB trace "segment"). It implements the Scenario 6.1 keep logic from docs/design/post-trace-pipeline.md on the real segment columns:

  • trace duration from the envelope of the segment "start_time"/"latency" tags (ms),
  • keepErrors from the first-class is_error tag,
  • keepTagRules matched against the flattened searchable-tag array "tags" (entries "key=value", e.g. "db.type=PostgreSQL"),
  • and a deterministic healthySampleRate hash of the trace id.

Config JSON (from SamplerPlugin.config):

{
  "durationThresholdMs": 500,
  "keepErrors": true,
  "healthySampleRate": 0.1,
  "keepTagRules": [
    { "tagKey": "db.type",  "equals": "PostgreSQL" },
    { "tagKey": "mq.queue", "equals": "queue-songs-ping" }
  ]
}

Build it as a Go plugin with `make build-plugins`; it must use the same Go toolchain and pinned pkg/pipeline/sdk as the data node (see plugins/README.md).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL