Merge pull request #2779 from WesleyAC/get_audience_more_telemetry

Add more information to get_audience telemetry
This commit is contained in:
Mouse Reeve 2023-04-07 07:12:41 -07:00 committed by GitHub
commit 5272786fbb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -105,8 +105,15 @@ class ActivityStream(RedisStore):
"""go from zero to a timeline"""
self.populate_store(self.stream_id(user.id))
@tracer.start_as_current_span("ActivityStream._get_audience")
def _get_audience(self, status): # pylint: disable=no-self-use
"""given a status, what users should see it"""
trace.get_current_span().set_attribute("status_type", status.status_type)
trace.get_current_span().set_attribute("status_privacy", status.privacy)
trace.get_current_span().set_attribute(
"status_reply_parent_privacy",
status.reply_parent.privacy if status.reply_parent else None,
)
# direct messages don't appear in feeds, direct comments/reviews/etc do
if status.privacy == "direct" and status.status_type == "Note":
return []