ParentBasedSampler

zio.blocks.telemetry.ParentBasedSampler
final case class ParentBasedSampler(root: Sampler) extends Sampler

A sampler that delegates to the parent span's sampling decision.

If no parent exists, delegates to the provided root sampler. If a parent exists, the decision follows the parent's sampled flag.

Value parameters

root

the sampler to use when there is no parent span

Attributes

Source
Sampler.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Sampler
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def shouldSample(parentContext: Option[SpanContext], traceIdHi: Long, traceIdLo: Long, name: String, kind: SpanKind, attributes: Attributes, links: Seq[SpanLink]): SamplingResult

Determines whether a span should be sampled.

Determines whether a span should be sampled.

Value parameters

attributes

the initial attributes of the span being created

kind

the kind of the span being created

links

the links associated with the span being created

name

the name of the span being created

parentContext

the parent span context, if any

traceIdHi

the high 64 bits of the trace ID

traceIdLo

the low 64 bits of the trace ID

Attributes

Returns

the sampling result

Source
Sampler.scala

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala

Concrete fields

val description: String

Returns a human-readable description of this sampler.

Returns a human-readable description of this sampler.

Attributes

Source
Sampler.scala