autometrics-dev / autometrics-py

Easily add metrics to your code that actually help you spot and debug issues in production. Built on Prometheus and OpenTelemetry.
https://autometrics.dev
Apache License 2.0
214 stars 7 forks source link

Pytest should clear collected metrics after each test runs #36

Closed brettimus closed 6 months ago

brettimus commented 1 year ago

Right now it's possible for the metrics generated by one test to be picked up by another test.

Each test should somehow "clear" the collected metrics, so that their actions do not pollute the result of (e.g.) generate_latest

brettimus commented 1 year ago

I think I hit this issue when working on #54 — some tests passed that should have failed because they were comparing against metrics generated by other tests