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

Auto instrument JSON.parse #11795

Open
timfish opened this issue Apr 25, 2024 · 3 comments
Open

Auto instrument JSON.parse #11795

timfish opened this issue Apr 25, 2024 · 3 comments

Comments

@timfish
Copy link
Collaborator

timfish commented Apr 25, 2024

Problem Statement

While instrumenting one of my projects I wrapped JSON.parse and JSON.stringify so they would be automatically included in traces so I could see their impact in requests. Then today I saw @anonrig post this.

Since these are synchronous I guess they have quite an impact if they're blocking for a long time.

Solution Brainstorm

Wrap parse and maybe even stringify with proxies that automatically add spans.

@AbhiPrasad
Copy link
Member

So we attempted this on the frontend but it got really noisy so I ended up reverting it. I wonder if there's a good way to reduce the noise 🤔

Maybe require min duration?

getsentry/sentry#63503

@timfish
Copy link
Collaborator Author

timfish commented Apr 25, 2024

Noisy, as in just too many json spans?

We could make an integration with a configurable threshold and then only enable it be default for Node? Or enabled by default for all SDKs and vary the threshold by SDK?

@AbhiPrasad
Copy link
Member

Noisy, as in just too many json spans?

Yes too many spans - which is a problem of itself with our app, but something we ran into.

I'd start with making it opt-in everywhere, and then rolling it out in Node first. configurable threshold makes sense to me!

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

No branches or pull requests

2 participants