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

chore: set platform on stack frame #1495

Merged
merged 3 commits into from
Oct 24, 2024
Merged

chore: set platform on stack frame #1495

merged 3 commits into from
Oct 24, 2024

Conversation

daibhin
Copy link
Contributor

@daibhin daibhin commented Oct 24, 2024

Changes

We need to know what language an individual frame is so that we can avoid an untagged enum switching as part of the Rust service.

For now this assumes all stacks in the JS SDK are javascript

Copy link

vercel bot commented Oct 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
posthog-js ✅ Ready (Inspect) Visit Preview Oct 24, 2024 3:30pm

@daibhin daibhin requested a review from a team October 24, 2024 09:22
Copy link

github-actions bot commented Oct 24, 2024

Size Change: +154 B (+0.01%)

Total Size: 2.89 MB

Filename Size Change
dist/all-external-dependencies.js 182 kB +22 B (+0.01%)
dist/array.full.es5.js 248 kB +22 B (+0.01%)
dist/array.full.js 335 kB +22 B (+0.01%)
dist/array.full.no-external.js 334 kB +22 B (+0.01%)
dist/exception-autocapture.js 8.77 kB +22 B (+0.25%)
dist/module.full.js 335 kB +22 B (+0.01%)
dist/module.full.no-external.js 334 kB +22 B (+0.01%)
ℹ️ View Unchanged
Filename Size
dist/array.js 156 kB
dist/array.no-external.js 155 kB
dist/external-scripts-loader.js 2.19 kB
dist/main.js 157 kB
dist/module.js 156 kB
dist/module.no-external.js 155 kB
dist/recorder-v2.js 102 kB
dist/recorder.js 103 kB
dist/surveys-preview.js 56.7 kB
dist/surveys.js 62.1 kB
dist/tracing-headers.js 1.33 kB
dist/web-vitals.js 10.3 kB

compressed-size-action

@@ -33,6 +33,7 @@ export type StackLineParserFn = (line: string) => StackFrame | undefined
export type StackLineParser = [number, StackLineParserFn]

export interface StackFrame {
lang: string
Copy link
Collaborator

Choose a reason for hiding this comment

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

i think this is same as platform (and useful to re-use imo when we extend because s£ntry SDKs should populate this)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm good point. The docs aren't super clear

This can override the platform for a single frame. Otherwise, the platform of the event is assumed. This can be used for multi-platform stack traces, such as in React Native.

My worry with platform is that it ends up populating something like "iPadOS", in which case we don't know whether it is a Swift or Objective-C frame 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looking through the code it seems like platform is set to the language or something like node. In our instance the "platform" values are only ever javascript or python.

Will rename this and go with platform to maintain consistency but use serde to map from platform to lang when deserializing

@daibhin daibhin changed the title chore: add lang to stack frames chore: set platform on stack frame Oct 24, 2024
@daibhin daibhin added the bump patch Bump patch version when this PR gets merged label Oct 24, 2024
@daibhin daibhin merged commit 0de431c into main Oct 24, 2024
17 checks passed
@daibhin daibhin deleted the dn-chore/add-frame-lang branch October 24, 2024 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump patch Bump patch version when this PR gets merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants