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

feat(core): Update span performance API names #8971

Merged
merged 5 commits into from Sep 7, 2023

Conversation

AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented Sep 7, 2023

As per the new changes in RFC 101 in getsentry/rfcs#113, update the span performance API names.

  • startActiveSpan -> startSpan
  • startSpan -> startInactiveSpan

https://github.com/getsentry/rfcs/blob/main/text/0101-revamping-the-sdk-performance-api.md

startActiveSpan is deprecated, while startInactiveSpan is being introduced. The breaking change is that startSpan is being changed, but considering that basically no-one is using the startSpan API, we should be fine to break here for correctness reasons. Better break now than to have everyone refactor their code in v8.

This is a breaking change, so maybe we decide against doing the rename in JavaScript - thoughts? #8970 also brought up that I forgot to export the span creator methods in browser SDKs, so perhaps we can get away with the change.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2023

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 75.36 KB (-0.01% 🔽)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 31.27 KB (0%)
@sentry/browser - Webpack (gzipped) 21.87 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 70.09 KB (+0.29% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 28.42 KB (+0.75% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped) 20.48 KB (+1.38% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 221.53 KB (+0.32% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 85.82 KB (+0.82% 🔺)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 60.66 KB (+1.5% 🔺)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 31.3 KB (+0.62% 🔺)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 75.39 KB (-0.01% 🔽)
@sentry/react - Webpack (gzipped) 21.9 KB (0%)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 93.26 KB (+0.01% 🔺)
@sentry/nextjs Client - Webpack (gzipped) 50.83 KB (-0.01% 🔽)

@ssanderson
Copy link

#8970 also brought up that I forgot to export the span creator methods in browser SDKs, so perhaps we can get away with the change.

re: this, FYI, these APIs are exposed from @sentry/core at the moment, which is the workaround I started using after figuring out what was going on in the linked issue. If there are others doing similar workarounds, then the rename might cause some real breakage, since a user who was using only startSpan will have their code start silently behaving differently after upgrading.

It's easy enough for me to update my changes since I've only just started trying to use this (and also I'm only using startActiveSpan anyway, so I'll at least get a compilation error from typescript), but pure JS users, or typescript users who are using startSpan might see this as a larger brekage.

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM. As for merging this:

Let's chat about it in Daily. I think it'd be reasonable to break, especially since the original APIs were out for a little over a week. If we decide to hold off, then let's still do this in v8 because I think ultimately, we want to align with the amended RFC/what we discussed yesterday.

@AbhiPrasad
Copy link
Member Author

I thought about this more, considering the current names map exactly to OTEL let's just keep them around until we properly break in v8.

Better not risk it since it was added to docs.

@AbhiPrasad
Copy link
Member Author

AbhiPrasad commented Sep 7, 2023

After chatting in our daily we decided that we're going to change the behavior for just startSpan. Although it's a breaking change, most people are using startActiveSpan anyway.

We'll deprecate the startActiveSpan export and replace it with startSpan.

@AbhiPrasad AbhiPrasad merged commit cf75ffe into develop Sep 7, 2023
78 checks passed
@AbhiPrasad AbhiPrasad deleted the abhi-rename-span-apis branch September 7, 2023 15:17
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 this pull request may close these issues.

None yet

3 participants