ThundraSpanListener
interface, and that have onSpanStarted
and onSpanFinished
methods. When you register a span listener to Thundra, Thundra calls this span listener’s onSpanStarted
and onSpanFinished
methods whenever a span is started and finished. This enables you to perform custom operations using a span listener during the life cycle of a span.“Error injected by Thundra!”
.False
.100
.FilteringSpanListener
, then it is sent to the span listener given by the listener parameter. The default value is None
.listener
parameter, meaning it is basically an object that has an accept method. Before delegating the given span to the listener
parameter, FilteringSpanListener
first passes the given span to the filterer
object if the filterer’s accept method returns True. If it does, the given span is passed to the listener
parameter; if it does not, the given span is not passed to the listener. The default value is None
.thundra_agent_lambda_trace_span_listener
environment variable. The basic structure is similar to the following:listener=LatencyInjectorSpanListener
, we state the type of the listener that FilteringSpanListener
is going to use. You can also use ErrorInjectorSpanListener
when you need to inject an error.config.
prefix is going to be passed to the listener parameter (which in this case is LatencyInjectorSpanListener
) as parameters. It has a structure like this: config.parameterName
. Note that we are using camel case whenever we need it. For example, if you used ErrorInjectorSpanListener
as the listener argument, then you would pass the error_message
parameter like this: config.errorMessage=”Hello world!”
filter1.className=AWS-Lambda
, filter1.tag.aws.lambda.name=upstream-lambda
correspond to the following filter:class_name
and the tags
of the spans. If the given span has a different class_name
than “AWS-Lambda
” or the given span does not have the tag aws.lambda.name
with the value “upstream-lambda
”, then the span will be rejected and won’t be sent to the listener
. If it does have both properties, then the filterer
accepts the span and FilteringSpanListener
propagates the span to its listener
parameter (which in this case is a LatencyInjectorSpanListener
).FilteringSpanListener
calls the ThundraSpanFilterer
’s accept method to decide whether or not to accept the given span, ThundraSpanFilterer
internally calls the accept(span)
method of each of the filters in the spanFilters
. If at least one of the filters in the spanFilters
accepts the span, or if the spanFilters
list is empty, then the given span is accepted and returned True. Otherwise, ThundraSpanFilterer
’s accept method returns False
. The default value is []
.None
.None
.None
.ThundraSpanFilter
checks to ensure that each of the key-value pairs in this dictionary also exists in the given span’s tags. If at least one of the key-value pairs is not in the span’s tags or exists with a different value, then the ThundraSpanFilter
rejects the span. The default value is None
.