mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-01-13 02:35:39 +00:00
Merge pull request #2779 from WesleyAC/get_audience_more_telemetry
Add more information to get_audience telemetry
This commit is contained in:
commit
5272786fbb
1 changed files with 7 additions and 0 deletions
|
@ -105,8 +105,15 @@ class ActivityStream(RedisStore):
|
||||||
"""go from zero to a timeline"""
|
"""go from zero to a timeline"""
|
||||||
self.populate_store(self.stream_id(user.id))
|
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
|
def _get_audience(self, status): # pylint: disable=no-self-use
|
||||||
"""given a status, what users should see it"""
|
"""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
|
# direct messages don't appear in feeds, direct comments/reviews/etc do
|
||||||
if status.privacy == "direct" and status.status_type == "Note":
|
if status.privacy == "direct" and status.status_type == "Note":
|
||||||
return []
|
return []
|
||||||
|
|
Loading…
Reference in a new issue