Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trace-per-test mode? #33

Open
xmo-odoo opened this issue Nov 21, 2024 · 1 comment · May be fixed by #34
Open

trace-per-test mode? #33

xmo-odoo opened this issue Nov 21, 2024 · 1 comment · May be fixed by #34

Comments

@xmo-odoo
Copy link

xmo-odoo commented Nov 21, 2024

Currently pytest-opentelemetry creates a trace for the entire test suite, possibly a span per worker for xdist, and then a span per test.

This means within a worker the tests are a sequence of spans, creating massive traces for e.g. large test suites with lots of fixtures.

An other issue is span management might be less advanced than the rest e.g. for simple local work (which seems something pytest-opentelemetry would be useful for) Opentelemetry Desktop Viewer has a menu of traces but no real interaction with spans (it's lacking both search & fold on that front), which makes traces which are both wide (lots of concurrent spans e.g. when there are lots of xdist workers) and long (lots of spans in a sequence) hard to work with.

Although it doesn't have a search / filter feature for traces either, that each trace is a unit that can be opened feels like it would make looking at tests a lot more practical in that tool (and possibly others).

FWIW I tested a POC locally and as far as I can tell it just consists of extracting a few things from the current otel plugin (basically splitting out everything touching session_span and has_error), without that it Just Works, with no need to adapt for xdist either.

@xmo-odoo xmo-odoo linked a pull request Nov 22, 2024 that will close this issue
@LarsMichelsen
Copy link

Sounds interesting. I think I would also be interested in this mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants