-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ref(tracing): Make metadata
property on Transaction
class public
#3557
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
Conversation
size-limit report
|
/** JSDoc */ | ||
export class Transaction extends SpanClass implements TransactionInterface { | ||
public name: string; | ||
|
||
private _metadata: TransactionMetadata = {}; | ||
public metadata: TransactionMetadata; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to the previous comment. If we already have a setter, do we want to make it public? IMO it seems unnecessary and misleading. I'd either go with the getter/setter or the public attribute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The setter above as you mentioned "merges", so it's helpful method. But I do agree that we could skip it if we'd go with get/set only, and not merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels way simpler to me to just have it public. Honestly, IDK why I made it private to begin with.
One thing we might think about (in the long list of things we're thinking about for v7) is having a more coherent strategy for what's public and what's private with setters and getters. I don't feel like I have a great intuitive sense for which is better in cases like this.
06054b0
to
d7fb1fd
Compare
d7fb1fd
to
bf75a3d
Compare
Pulling this in from https://github.com/getsentry/sentry-javascript/tree/kmclb-dynamic-sampling-data-in-envelopes. It makes the
metadata
property on theTransaction
class public, and allows it to be passed in at transaction creation time, which at this moment would be helpful for nextjs tracing work.