You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/index.rst
+24-4Lines changed: 24 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -312,23 +312,43 @@ Advanced Usage
312
312
Trace Filtering
313
313
~~~~~~~~~~~~~~~
314
314
315
-
It is possible to filter or modify traces before they are sent to the agent by configuring the tracer with a processing pipeline. For instance to filter out all traces of incoming requests to a specific url::
315
+
It is possible to filter or modify traces before they are sent to the agent by
316
+
configuring the tracer with a processing pipeline. For instance to filter out
317
+
all traces of incoming requests to a specific url::
All the processors in the processing pipeline will be evaluated sequentially for each trace and the resulting trace will either be sent to the agent or discarded depending on the output of the pipeline.
322
+
All the processors in the processing pipeline will be evaluated sequentially
323
+
for each trace and the resulting trace will either be sent to the agent or
324
+
discarded depending on the output of the pipeline.
321
325
322
326
**Use the standard processors**
323
327
324
-
The library comes with a FilterRequestsOnUrl processor that can be used to filter out incoming requests to specific urls:
328
+
The library comes with a FilterRequestsOnUrl processor that can be used to
Creating your own processors is as simple as implementing a class with a process_trace method and adding it to the processing pipeline parameter of Tracer.configure. process_trace should either return a trace to be fed to the next step of the pipeline or None if the trace should be discarded. (see processors.py for example implementations)
336
+
Creating your own processors is as simple as implementing a class with a
337
+
process_trace method and adding it to the processing pipeline parameter of
338
+
Tracer.configure. process_trace should either return a trace to be fed to the
339
+
next step of the pipeline or None if the trace should be discarded::
340
+
341
+
class ProcessorExample(object):
342
+
def process_trace(self, trace):
343
+
# write here your logic to return the `trace` or None;
344
+
# `trace` instance is owned by the thread and you can alter
0 commit comments