Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 083a659

Browse files
author
David Robertson
committed
Define a proper SynapseTag
1 parent e498806 commit 083a659

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

synapse/federation/federation_server.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
start_active_span_from_edu,
6868
tag_args,
6969
trace,
70+
SynapseTags,
7071
)
7172
from synapse.metrics.background_process_metrics import wrap_as_background_process
7273
from synapse.replication.http.federation import (
@@ -679,7 +680,10 @@ async def on_send_join_request(
679680
room_id: str,
680681
caller_supports_partial_state: bool = False,
681682
) -> Dict[str, Any]:
682-
set_tag("partial_state", caller_supports_partial_state)
683+
set_tag(
684+
SynapseTags.SEND_JOIN_RESPONSE_IS_PARTIAL_STATE,
685+
caller_supports_partial_state,
686+
)
683687
await self._room_member_handler._join_rate_per_room_limiter.ratelimit( # type: ignore[has-type]
684688
requester=None,
685689
key=room_id,

synapse/logging/opentracing.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,11 @@ class SynapseTags:
322322
# The name of the external cache
323323
CACHE_NAME = "cache.name"
324324

325+
# Boolean. Present on /v2/send_join requests, omitted from all others.
326+
# True iff partial state was requested and we provided (or intended to provide)
327+
# partial state in the response.
328+
SEND_JOIN_RESPONSE_IS_PARTIAL_STATE = "send_join.partial_state_response"
329+
325330
# Used to tag function arguments
326331
#
327332
# Tag a named arg. The name of the argument should be appended to this prefix.

0 commit comments

Comments
 (0)