File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
docs/platforms/javascript/guides/cloudflare/features Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -9,10 +9,18 @@ You can use the `instrumentWorkflowWithSentry` method to instrument [Cloudflare
99Workflows] ( https://developers.cloudflare.com/workflows/ ) .
1010
1111Because workflows can be hibernated and lose all state, we use the workflows
12- ` instanceId ` as the Sentry ` trace_id ` to link all steps together. We also use
13- the last 4 characters of the ` instanceId ` for sampling to ensure all steps have
14- the same sampling decision. If you are starting your workflows with a custom
15- ` instanceId ` , ensure you use valid random UUIDs either with or without dashes.
12+ ` instanceId ` to generate the Sentry ` trace_id ` to link all steps together into a
13+ single trace. If ` instanceId ` is a UUID (with or without dashes), it will be
14+ used directly as the ` trace_id ` . If not, we SHA1 hash the ` instanceId ` to
15+ generate a deterministic ` trace_id ` .
16+
17+ We use the last 4 characters of the ` trace_id ` for sampling to ensure all steps
18+ have the same sampling decision.
19+
20+ Because the ` instanceId ` is used for both the ` trace_id ` and for sampling
21+ decisions, you should ensure that the ` instanceId ` is unique for each workflow
22+ instance. If you are using custom UUIDs, you should ensure the last 4 digits are
23+ sufficiently random to ensure a good distribution of sampling decisions.
1624
1725``` typescript
1826import { WorkflowEntrypoint , WorkflowStep , WorkflowEvent } from ' cloudflare:workers' ;
You can’t perform that action at this time.
0 commit comments