chrisguidry / pytest-opentelemetry

A pytest plugin for instrumenting test runs via OpenTelemetry
MIT License
23 stars 7 forks source link

Ability to control traces such that push trace data only for pytest functions that exceed a particular run time limit #31

Open jayakumar-mohan-fk opened 8 months ago

jayakumar-mohan-fk commented 8 months ago

This is a suggestion to have a threshold so that trace data is pushed only for pytest functions that exceed a particular run time limit.

Background : I have a test suite that has 6000 odd pytest functions that are run by a single pytest process.

90% of these are quite fast. However the rest take longer.

Using pytest-opentelemetry we were able push the traces to Jaegar UI, but analysing the statistics to identify some of the most used test helper operations was difficult due to the volume of spans under a single trace.

I understand this is a drawback on Jaeger UI, but if we have a control to push only the traces for long running test functions it would be helpful.

A sample snapshot of Jaeger UI statistics that I am trying to view.

image
LarsMichelsen commented 6 days ago

You may try to use the otel collector (jaeger 2.x is built on top of it) to do filtering of spans. I haven't done it yet, but maybe it is possible to filter it out on that level with existing features: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/filterprocessor/README.md