mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-12 15:24:21 -05:00
Cleanup opentracing logging for syncs (#10828)
We added a bunch of spans in #10704, but this ended up adding a lot of redundant spans for rooms where nothing changed, so instead we only start the span if there might be something interesting going on.
This commit is contained in:
parent
474edce1c4
commit
9a6f4a684f
1
changelog.d/10828.bugfix
Normal file
1
changelog.d/10828.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Added opentrace logging to help debug #9424.
|
@ -1533,9 +1533,6 @@ class SyncHandler:
|
|||||||
newly_left_rooms = room_changes.newly_left_rooms
|
newly_left_rooms = room_changes.newly_left_rooms
|
||||||
|
|
||||||
async def handle_room_entries(room_entry: "RoomSyncResultBuilder"):
|
async def handle_room_entries(room_entry: "RoomSyncResultBuilder"):
|
||||||
with start_active_span("generate_room_entry"):
|
|
||||||
set_tag("room_id", room_entry.room_id)
|
|
||||||
log_kv({"events": len(room_entry.events or [])})
|
|
||||||
logger.debug("Generating room entry for %s", room_entry.room_id)
|
logger.debug("Generating room entry for %s", room_entry.room_id)
|
||||||
res = await self._generate_room_entry(
|
res = await self._generate_room_entry(
|
||||||
sync_result_builder,
|
sync_result_builder,
|
||||||
@ -1960,6 +1957,11 @@ class SyncHandler:
|
|||||||
room_id = room_builder.room_id
|
room_id = room_builder.room_id
|
||||||
since_token = room_builder.since_token
|
since_token = room_builder.since_token
|
||||||
upto_token = room_builder.upto_token
|
upto_token = room_builder.upto_token
|
||||||
|
|
||||||
|
with start_active_span("generate_room_entry"):
|
||||||
|
set_tag("room_id", room_id)
|
||||||
|
log_kv({"events": len(events or ())})
|
||||||
|
|
||||||
log_kv(
|
log_kv(
|
||||||
{
|
{
|
||||||
"since_token": since_token,
|
"since_token": since_token,
|
||||||
@ -2013,21 +2015,34 @@ class SyncHandler:
|
|||||||
account_data_events.append({"type": "m.tag", "content": {"tags": tags}})
|
account_data_events.append({"type": "m.tag", "content": {"tags": tags}})
|
||||||
|
|
||||||
for account_data_type, content in account_data.items():
|
for account_data_type, content in account_data.items():
|
||||||
account_data_events.append({"type": account_data_type, "content": content})
|
account_data_events.append(
|
||||||
|
{"type": account_data_type, "content": content}
|
||||||
|
)
|
||||||
|
|
||||||
account_data_events = sync_config.filter_collection.filter_room_account_data(
|
account_data_events = (
|
||||||
|
sync_config.filter_collection.filter_room_account_data(
|
||||||
account_data_events
|
account_data_events
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
|
||||||
ephemeral = sync_config.filter_collection.filter_room_ephemeral(ephemeral)
|
ephemeral = sync_config.filter_collection.filter_room_ephemeral(ephemeral)
|
||||||
|
|
||||||
if not (
|
if not (
|
||||||
always_include or batch or account_data_events or ephemeral or full_state
|
always_include
|
||||||
|
or batch
|
||||||
|
or account_data_events
|
||||||
|
or ephemeral
|
||||||
|
or full_state
|
||||||
):
|
):
|
||||||
return
|
return
|
||||||
|
|
||||||
state = await self.compute_state_delta(
|
state = await self.compute_state_delta(
|
||||||
room_id, batch, sync_config, since_token, now_token, full_state=full_state
|
room_id,
|
||||||
|
batch,
|
||||||
|
sync_config,
|
||||||
|
since_token,
|
||||||
|
now_token,
|
||||||
|
full_state=full_state,
|
||||||
)
|
)
|
||||||
|
|
||||||
summary: Optional[JsonDict] = {}
|
summary: Optional[JsonDict] = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user