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): Add spanToJSON() method to get span properties #10074

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

mydea
Copy link
Member

@mydea mydea commented Jan 5, 2024

This is supposed to be an internal API and not necessarily to be used by users.

Naming wise, it's a bit tricky... I went with JSON to make it very clear what this is for, but 🤷

@mydea mydea requested review from lforst, Lms24 and AbhiPrasad January 5, 2024 11:07
@mydea mydea self-assigned this Jan 5, 2024
Copy link
Contributor

github-actions bot commented Jan 5, 2024

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) - Webpack (gzipped) 76.2 KB (+0.07% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 67.58 KB (+0.07% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped) 61.21 KB (+0.1% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 32.18 KB (+1.25% 🔺)
@sentry/browser (incl. Feedback) - Webpack (gzipped) 30.54 KB (+0.11% 🔺)
@sentry/browser - Webpack (gzipped) 22.25 KB (+1.74% 🔺)
@sentry/browser (incl. Tracing, Replay, Feedback) - ES6 CDN Bundle (gzipped) 73.64 KB (-0.17% 🔽)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 65.28 KB (-0.22% 🔽)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 31.47 KB (-0.42% 🔽)
@sentry/browser - ES6 CDN Bundle (gzipped) 23.4 KB (-0.53% 🔽)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 204.64 KB (-0.24% 🔽)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 94.53 KB (-0.53% 🔽)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 69.35 KB (-0.78% 🔽)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 34.45 KB (-0.26% 🔽)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 67.99 KB (+0.12% 🔺)
@sentry/react - Webpack (gzipped) 22.28 KB (+1.72% 🔺)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 84.65 KB (+0.02% 🔺)
@sentry/nextjs Client - Webpack (gzipped) 49.25 KB (+0.57% 🔺)
@sentry-internal/feedback - Webpack (gzipped) 16.78 KB (+1.47% 🔺)

Comment on lines +59 to +65
"madge": {
"detectiveOptions": {
"ts": {
"skipTypeImports": true
}
}
},
Copy link
Member

Choose a reason for hiding this comment

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

Circ deps (even types) are usually very smelly. Is this 100% necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, it is - as we need the util in spanUtils, and we need spanUtils in span, and for the util we need the span class from span 😬 at least I couldn't think of a way to make this work properly :( we can remove it in v8 though, then we don't need to import from spanUtils in span anymore!

Copy link
Member

@lforst lforst Jan 5, 2024

Choose a reason for hiding this comment

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

Alright then! Let's add a comment/todo somewhere then to remove this opt-out again (if you also think that it's worth keeping in general in the future).

Copy link
Member Author

Choose a reason for hiding this comment

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

(or open for other ideas, of course)

* Convert a span to a JSON representation.
* Note that all fields returned here are optional and need to be guarded against.
*
* Note: Because of this, we currently have a circular type dependency (which we opted out of in package.json).
Copy link
Member Author

Choose a reason for hiding this comment

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

@lforst added this comment here for the future!

This is supposed to be an internal API and not necessarily to be used by users.

add comment for circular dependency
@mydea mydea enabled auto-merge (squash) January 5, 2024 13:28
@mydea mydea merged commit 5aac890 into develop Jan 8, 2024
95 checks passed
@mydea mydea deleted the fn/spanToJSON branch January 8, 2024 08:39
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.

3 participants