Skip to content

Commit b131bbf

Browse files
authored
Update python.mdx
adding parent inheritance info
1 parent 0a89965 commit b131bbf

File tree

1 file changed

+7
-0
lines changed
  • platform-includes/performance/traces-sampler-as-sampler

1 file changed

+7
-0
lines changed

platform-includes/performance/traces-sampler-as-sampler/python.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ def traces_sampler(sampling_context):
44
# along with anything in the global namespace to compute the sample rate
55
# or sampling decision for this transaction
66

7+
# Use the parent sampling decision if we have an incoming trace.
8+
# Note: we strongly recommend respecting the parent sampling decision,
9+
# as this ensures your traces will be complete!
10+
parent_sampling_decision = sampling_context.get("parent_sampled")
11+
if parent_sampling_decision is not None:
12+
return float(parent_sampling_decision)
13+
714
if "...":
815
# These are important - take a big sample
916
return 0.5

0 commit comments

Comments
 (0)