This repository was archived by the owner on Apr 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change
1
+ Tag opentracing spans for federation requests with the name of the worker serving the request.
Original file line number Diff line number Diff line change 32
32
from synapse .http import get_request_user_agent
33
33
from synapse .http .site import SynapseRequest
34
34
from synapse .logging .opentracing import (
35
- SynapseTags ,
36
35
active_span ,
37
36
force_tracing ,
38
37
start_active_span ,
@@ -162,12 +161,6 @@ async def get_user_by_req(
162
161
parent_span .set_tag (
163
162
"authenticated_entity" , requester .authenticated_entity
164
163
)
165
- # We tag the Synapse instance name so that it's an easy jumping
166
- # off point into the logs. Can also be used to filter for an
167
- # instance that is under load.
168
- parent_span .set_tag (
169
- SynapseTags .INSTANCE_NAME , self .hs .get_instance_name ()
170
- )
171
164
parent_span .set_tag ("user_id" , requester .user .to_string ())
172
165
if requester .device_id is not None :
173
166
parent_span .set_tag ("device_id" , requester .device_id )
Original file line number Diff line number Diff line change @@ -466,8 +466,16 @@ def init_tracer(hs: "HomeServer") -> None:
466
466
STRIP_INSTANCE_NUMBER_SUFFIX_REGEX , "" , hs .get_instance_name ()
467
467
)
468
468
469
+ jaeger_config = hs .config .tracing .jaeger_config
470
+ tags = jaeger_config .setdefault ("tags" , {})
471
+
472
+ # tag the Synapse instance name so that it's an easy jumping
473
+ # off point into the logs. Can also be used to filter for an
474
+ # instance that is under load.
475
+ tags [SynapseTags .INSTANCE_NAME ] = hs .get_instance_name ()
476
+
469
477
config = JaegerConfig (
470
- config = hs . config . tracing . jaeger_config ,
478
+ config = jaeger_config ,
471
479
service_name = f"{ hs .config .server .server_name } { instance_name_by_type } " ,
472
480
scope_manager = LogContextScopeManager (),
473
481
metrics_factory = PrometheusMetricsFactory (),
You can’t perform that action at this time.
0 commit comments