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

fix-3885 propagate traceId through asynchronous jobs #3886

Merged
merged 10 commits into from
Feb 8, 2024

Conversation

dillonstreator
Copy link
Contributor

@dillonstreator dillonstreator commented Feb 4, 2024

Fixes #3885

This is based off of #3877 to include the work done to better support traceparent and slight variations seen in the wild but it does not need to depend on it.

  • subscriptions: rest-hooks
  • subscriptions: bots lambda
  • subscriptions: bots vmcontext
  • downloads

Questions:

  • Thoughts on including changes to the documentation to specify that bots and rest subscription calls would be receiving an x-trace-id & traceparent header? Could be a future documentation change consideration.
  • How to handle crons? I feel like it makes less sense to propagate the initial traceId that creates a cron to all future cron executions. Should this just be ignored?

Copy link

vercel bot commented Feb 4, 2024

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

3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
medplum-app ⬜️ Ignored (Inspect) Visit Preview Feb 8, 2024 6:40pm
medplum-storybook ⬜️ Ignored (Inspect) Visit Preview Feb 8, 2024 6:40pm
medplum-www ⬜️ Ignored (Inspect) Visit Preview Feb 8, 2024 6:40pm

Copy link

vercel bot commented Feb 4, 2024

@dillonstreator is attempting to deploy a commit to the Medplum Team on Vercel.

A member of the Team first needs to authorize it.

@dillonstreator dillonstreator changed the title Fix 3885 propagate traceId through asynchronous jobs fix-3885 propagate traceId through asynchronous jobs Feb 4, 2024
packages/server/src/workers/subscription.test.ts Dismissed Show dismissed Hide dismissed
packages/server/src/workers/subscription.test.ts Dismissed Show dismissed Hide dismissed
@codyebberson
Copy link
Member

Questions:

  • Thoughts on including changes to the documentation to specify that bots and rest subscription calls would be receiving an x-trace-id & traceparent header? Could be a future documentation change consideration.

Good question. I think we need to add more documentation on tracing in general, so I'm ok to punt to future work.

  • How to handle crons? I feel like it makes less sense to propagate the initial traceId that creates a cron to all future cron executions. Should this just be ignored?

Agree, I think cron is out of scope for trace ID, let's just ignore.

Thanks @dillonstreator !

Copy link
Member

@codyebberson codyebberson left a comment

Choose a reason for hiding this comment

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

Thanks @dillonstreator - this all looks good to me. My focus was on the download and subscription workers, as those are quite critical to production workflows.

@mattwiller - can you double check the request ID and trace ID parts? They look good to me, but you're the expert on those.

Copy link
Member

@mattwiller mattwiller left a comment

Choose a reason for hiding this comment

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

All looks good to me! One thing to consider for the future is how we might centralize some of the async job handling, since this PR required changing multiple places to ensure everything got wired up correctly

@codyebberson codyebberson added this pull request to the merge queue Feb 8, 2024
Merged via the queue into medplum:main with commit d89db56 Feb 8, 2024
18 checks passed
medplumbot added a commit that referenced this pull request Feb 8, 2024
fix-3885 propagate `traceId` through asynchronous jobs (#3886)
Expand profile operation (#3875)
feat: Support OperationDefinition inputs for patient-everything (#3908)
Remove TURBO_REMOTE_ONLY from build step (#3907)
Server config setting for accurate count threshold (#3902)
Remove global systemRepo (#3884)
Maintain full `traceparent` header value for `traceId` (#3877)
fix-3807 rectify fhirpath `exists` and `empty` (#3808)
Fix return documentation for client read methods (#3891)
Document how to switch to super admin project in projects (#3873)
Refactor elements context and slicing logic (#3869)
Dependency upgrades (#3874)
No longer need to build core for @medplum/react npm run dev (#3871)
Fixes to ResourceDiffTable with arrays (#3870)
feat(agent): add `ping` via `Agent/$push` (#3846)
Fix token search with pipe in value (#3867)
Revert nested transactions (#3866)
Evict connection on rollback (#3865)
@medplumbot medplumbot mentioned this pull request Feb 8, 2024
github-merge-queue bot pushed a commit that referenced this pull request Feb 8, 2024
fix-3885 propagate `traceId` through asynchronous jobs (#3886)
Expand profile operation (#3875)
feat: Support OperationDefinition inputs for patient-everything (#3908)
Remove TURBO_REMOTE_ONLY from build step (#3907)
Server config setting for accurate count threshold (#3902)
Remove global systemRepo (#3884)
Maintain full `traceparent` header value for `traceId` (#3877)
fix-3807 rectify fhirpath `exists` and `empty` (#3808)
Fix return documentation for client read methods (#3891)
Document how to switch to super admin project in projects (#3873)
Refactor elements context and slicing logic (#3869)
Dependency upgrades (#3874)
No longer need to build core for @medplum/react npm run dev (#3871)
Fixes to ResourceDiffTable with arrays (#3870)
feat(agent): add `ping` via `Agent/$push` (#3846)
Fix token search with pipe in value (#3867)
Revert nested transactions (#3866)
Evict connection on rollback (#3865)
@reshmakh reshmakh added this to the February 29th, 2024 milestone Feb 13, 2024
@reshmakh reshmakh added the audit-logging Commits related to audit logging and observability label Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audit-logging Commits related to audit logging and observability
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Propagate trace ID through to asynchronous jobs
4 participants