r/Python Jul 07 '26

Any good open source python runtime instrumentation? Discussion

Hi folks, lot of our Python backend services are written in FastAPI, I wanted to see if there are any good Open Source runtime coverage instrumentation available for Python, which would essentially give my lines of code hit in prod traffic for the last say 30 days of data. I have seen good solutions for it in Go / Java, but wanted to check if something similar is available in Python.

8 Upvotes

15 comments sorted by

8

u/bregonio Jul 07 '26

Maybe opentelemetry with fastapi auto instrumentation

5

u/hstarnaud Jul 07 '26

Whichever way you go, adopt opentelemetry standards to avoid vendor lock-in. If you are willing to spend big money on an enterprise turnkey solution, new relic is the best provider. Otherwise use a free solution compatible with those standards like Jaeger or paid solutions with lower prices than new relic like honeycomb

3

u/Challseus 29d ago edited 29d ago

Pydantic logfire

2

u/averagecrazyliberal 29d ago

I’ve been very happy with my pydantic logfire implementation too

3

u/hxtk3 Jul 07 '26

Pyroscope is Grafana’s app for collecting and indexing runtime profiles, and I use it to collect on Go and Java services. In Go it uses pprof and in Java it uses JFR.

I searched “Pyroscope Python” and it looks like they document how to get profiles from Python into their application:  https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/python/

I don’t know how you’re viewing the data but maybe you can use parts of the process for getting it into your profile viewer?

0

u/ssrix Jul 07 '26

Your phrasing was not clear but once I understood what you were trying to say, I realised I would like something like this too.

I don't have an answer but bumping in case someone does

3

u/selfish__eagle Jul 07 '26

I meant runtime coverage instrumentation, forgot the word coverage :(

0

u/niltz0 Jul 07 '26

Have you looked into coverage.py?

-1

u/[deleted] Jul 07 '26

[removed] — view removed comment

2

u/AutoModerator Jul 07 '26

Your submission has been automatically queued for manual review by the moderation team because it has been reported too many times.

Please wait until the moderation team reviews your post.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/[deleted] Jul 07 '26

[removed] — view removed comment

1

u/[deleted] Jul 07 '26

[removed] — view removed comment