You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for before_send_span in span streaming mode.
before_send_span is different from before_send_metric and before_send_log in that:
it doesn't allow users to drop a span (i.e., return None)
it only allows to modify specific parts of the span (name and attributes)
To that end, we're exposing a copy of the span in the callback instead of the real thing. Alternatively, we could just expose a simplified dictionary snapshot of the span ({"name": "name", "attributes": {}}), but that'd then bypass any extra logic we have in the span public API (like set_attribute(), which currently stringifies values if not serializable).
Looks like we have some unserializable stuff on spans. Need to figure out what it is and why it's there. If we can't get rid of it it might need a stripped down version of the span or a snapshot after all
File:tests.integrations.aiohttp.test_aiohttp Suite:py3.9-aiohttp-v3.7.4 Error: ValueError: not enough values to unpack (expected 1, got 0)
Stack Trace
tests/integrations/aiohttp/test_aiohttp.py:1273: in test_sensitive_header_passthrough_with_pii_span_streaming
(server_span,) = [item.payload for item in items]
E ValueError: not enough values to unpack (expected 1, got 0)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add support for
before_send_spanin span streaming mode.before_send_spanis different frombefore_send_metricandbefore_send_login that:None)To that end, we're exposing a copy of the span in the callback instead of the real thing. Alternatively, we could just expose a simplified dictionary snapshot of the span (
{"name": "name", "attributes": {}}), but that'd then bypass any extra logic we have in the span public API (likeset_attribute(), which currently stringifies values if not serializable).See https://develop.sentry.dev/sdk/telemetry/spans/scrubbing-data/ for spec.
TODO
Issues
before_send_span#5388