Skip to content

Conversation

@lobsterkatie
Copy link
Member

@lobsterkatie lobsterkatie commented Oct 16, 2020

This adds (but doesn't yet use) the types and attributes necessary for adding the traces_sampler option which is specced here. Extracted from the larger PR on that topic, #863.

  • Types for the traces_sampler itself (the function and its input)
  • A new attribute on the Transaction class tracking the parent sampling decision separately from the sampling decision of the transaction itself, since part of the traces_sampler spec is that there needs to be a difference between an inherited decision and an explicitly set decision.


class Transaction(Span):
__slots__ = ("name",)
__slots__ = ("name", "parent_sampled")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to store this value in every transaction?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because there's no other way (that I can see) to get it to the traces_sampler. The only link between from_traceparent and start_transaction is the Transaction object itself.

It's true that once it's been used, I could delete it off of the transaction object, but is that necessary/worth it?

@lobsterkatie lobsterkatie force-pushed the kmclb-add-traces-sampler-types branch from 3ab81a0 to 832593c Compare October 19, 2020 17:01
Copy link
Member

@untitaker untitaker left a comment

Choose a reason for hiding this comment

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

I have zero context on this PR, I don't know how to review this

@lobsterkatie lobsterkatie force-pushed the kmclb-add-traces-sampler-types branch from 832593c to 3d0f8e7 Compare October 20, 2020 06:11
@lobsterkatie
Copy link
Member Author

I have zero context on this PR, I don't know how to review this

Yeah, sorry - Rodolfo just went through helping me with the JS version of this, so I probably didn't explain as much as I should have in the PR description since he was originally going to be the one reviewing. I've added more context above.

@lobsterkatie lobsterkatie force-pushed the kmclb-add-traces-sampler-types branch from 3d0f8e7 to 6ccab61 Compare October 20, 2020 15:13
@lobsterkatie lobsterkatie merged commit 4137a8d into master Oct 21, 2020
@lobsterkatie lobsterkatie deleted the kmclb-add-traces-sampler-types branch October 21, 2020 17:19
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.

4 participants