zipkin-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 zipkin-trace-sampler is the first-party post-trace sampler for the Zipkin schema (group sw_zipkinTrace, BanyanDB trace "zipkin_span"). It implements the Scenario 6.2 keep logic from docs/design/post-trace-pipeline.md on the real Zipkin columns:

  • trace duration from the envelope of the "timestamp_millis"/"duration" tags (duration is µs),
  • keepTagRules matched against the flattened "query" array, whose entries include both bare keys and "key=value" such as "http.status_code=500",
  • and a deterministic healthySampleRate hash of the trace id.

The Zipkin schema has no is_error column. keepErrors instead detects Zipkin's conventional "error" span tag, which OAP flattens into "query" as both a bare key and "error=<message>". That is a tag convention, not an authoritative field: instrumentations that only signal failure through http.status_code 5xx or otel.status_code need an explicit rule, e.g. 'http.status_code=~5\d\d'.

Config JSON (from SamplerPlugin.config):

{
  "durationThresholdMs": 1000,
  "keepErrors": true,
  "healthySampleRate": 0.05,
  "keepTagRules": [
    { "tagKey": "query", "regex": "http\\.status_code=5\\d\\d" }
  ]
}

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