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

Remove custom_sampling_context #3747

Merged
merged 18 commits into from
Nov 12, 2024
Merged

Remove custom_sampling_context #3747

merged 18 commits into from
Nov 12, 2024

Conversation

sentrivana
Copy link
Contributor

@sentrivana sentrivana commented Nov 7, 2024

  • Add support for the sampled flag for start_span and respect it when making sampling decisions.
  • Rework sampling_context in traces_sampler to work with span attributes instead. Make sure we still have the same data accessible as now.

We could go one step further and change the format of sampling_context to just be the actual span attributes without any postprocessing into the current format. I kept the format in line with what we have now to make it easier to update.

See #3746
Closes #3739

This is a breaking change since we're removing custom_sampling_context. It'll break multiple integrations until we fix them (see #3746).

@sentrivana sentrivana mentioned this pull request Nov 7, 2024
12 tasks
Copy link

codecov bot commented Nov 7, 2024

❌ 1863 Tests Failed:

Tests completed Failed Passed Skipped
19899 1863 18036 4412
View the top 3 failed tests by shortest run time
tests.test_scope test_with_isolation_scope_data
Stack Traces | 0.001s run time
tests/test_scope.py:387: in test_with_isolation_scope_data
    assert scope._tags == {"before_isolation_scope": 1}
E   AssertionError: assert {} == {'before_isolation_scope': 1}
E     
E     Right contains 1 more item:
E     {'before_isolation_scope': 1}
E     
E     Full diff:
E     + {}
E     - {
E     -     'before_isolation_scope': 1,
E     - }
tests.test_utils test_datetime_from_isoformat[2021-01-01T00:00:00.000000-0000-expected_output6]
Stack Traces | 0.001s run time
tests/test_utils.py:109: in test_datetime_from_isoformat
    assert datetime_from_isoformat(input_str) == expected_output, input_str
E   NameError: name 'datetime_from_isoformat' is not defined
tests.test_utils test_datetime_from_isoformat[2021-01-01T00:00:00.000000-00:00-expected_output4]
Stack Traces | 0.001s run time
tests/test_utils.py:109: in test_datetime_from_isoformat
    assert datetime_from_isoformat(input_str) == expected_output, input_str
E   NameError: name 'datetime_from_isoformat' is not defined

To view more test analytics, go to the Test Analytics Dashboard
Got feedback? Let us know on Github

@sentrivana sentrivana marked this pull request as ready for review November 12, 2024 12:03
@sentrivana
Copy link
Contributor Author

This is what this would effectively look like for an integration: https://github.com/getsentry/sentry-python/pull/3764/files

@sentrivana sentrivana merged commit afd8cc5 into potel-base Nov 12, 2024
26 of 125 checks passed
@sentrivana sentrivana deleted the ivana/sampling-context branch November 12, 2024 14: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.

2 participants