yangxikun/opentelemetry-lua

[feature request]: tailsampling support

Closed this issue · 5 comments

Hi, is tail sampling predictable? Full sampling for 5xx requests and ratio sampling for other requests, it has a greater meaning in practice.

I think "tail sampling" is properly done within the collector, when you are tail sampling the entire trace.

If you want to make decisions about keeping or dropping OpenResty spans after OpenResty gets a response back from upstream, I've had luck writing a custom span processor that keeps the spans until OpenResty's log phase, then throws them away or keeps them based on the response code from upstream.

See also open-telemetry/opentelemetry-specification#2914

@yangxikun @plantfansam Get it, thank you for your reply!