shouldSample abstract method

SamplingResult shouldSample({
  1. required Context parentContext,
  2. required String traceId,
  3. required String name,
  4. required SpanKind spanKind,
  5. required Attributes? attributes,
  6. required List<SpanLink>? links,
})

Makes a sampling decision based on the provided parameters.

This method is called when a span is started to determine whether it should be sampled.

@param parentContext The parent context containing the parent span @param traceId The trace ID of the span @param name The name of the span @param spanKind The kind of the span @param attributes The attributes of the span @param links The links to other spans @return A sampling result containing the decision and other information

Implementation

SamplingResult shouldSample({
  required Context parentContext,
  required String traceId,
  required String name,
  required SpanKind spanKind,
  required Attributes? attributes,
  required List<SpanLink>? links,
});