Add more information to get_audience telemetry
This will assist with debugging #2720, by letting us see which kinds of requests take the longest.
This commit is contained in:
parent
d35b1d91ba
commit
118b5bfda7
1 changed files with 7 additions and 0 deletions
|
@ -102,8 +102,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 appeard in feeds, direct comments/reviews/etc do
|
# direct messages don't appeard 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…
Add table
Add a link
Reference in a new issue