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(node): Add trace context to checkin #8503

Merged
merged 1 commit into from Jul 12, 2023
Merged

Conversation

AbhiPrasad
Copy link
Member

ref #8352

This PR adds trace context to checkin bodies (see https://develop.sentry.dev/sdk/check-ins/) as well as to the checkin envelope header.

There are a couple things to note here.

  1. I elected to duplicate this logic instead of refactoring into a single function because ideally node/edge should inherit from a common package themselves. I think duplicating this twice for now is fine until we can make that change.
  2. I purposefully made it so that the checkins don't use prepareEvent. This is because I didn't want to introduce async code into the checkIn pipeline, but maybe this is the wrong decision

In general the solution here does introduce some tech debt, but I think it's worth the cost to just get this shipped. In addition, it provides additional reasons why we should refactor the client processing pipeline in a more comprehensive way for v8.

@AbhiPrasad AbhiPrasad requested a review from a team July 11, 2023 17:46
@AbhiPrasad AbhiPrasad self-assigned this Jul 11, 2023
@AbhiPrasad AbhiPrasad requested review from mydea and Lms24 and removed request for a team July 11, 2023 17:46
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.

Nice! I think the duplication is fine as long as we don't have that common package for Node and Edge.

}

if (dynamicSamplingContext) {
headers.trace = dropUndefinedKeys(dynamicSamplingContext) as DynamicSamplingContext;
Copy link
Member

Choose a reason for hiding this comment

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

l: Do we really need the typecast here?

Copy link
Member Author

Choose a reason for hiding this comment

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

yup unfortunately we do because this is a Partial<DynamicSamplingContext>

I general we need stronger types, but thats a refactor for later.

@AbhiPrasad AbhiPrasad merged commit f0afc37 into develop Jul 12, 2023
67 checks passed
@AbhiPrasad AbhiPrasad deleted the abhi-twp-cron-trace branch July 12, 2023 12:28
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

2 participants