mirror of
https://github.com/element-hq/synapse.git
synced 2026-11-12 03:27:42 +00:00
Report Python's spans through the Rust reporter
One emitter now sends both Python's and Rust's spans to the Jaeger agent. `init_tracer` sets the tracer up as before, with `initialize_tracer` (its sampler, remote or not, its throttler, its logging reporter, and the first-homeserver-wins guard), then swaps jaeger-client's reporter for one whose `report_span` converts the finished span into the Rust reporter's form, with the GIL held (a few attribute reads), and queues it. The encoding and the UDP send happen on the reporter thread, as for Rust's spans. Support for the external `rust_python_jaeger_reporter` package is removed. If tracing in Rust cannot start, jaeger-client's reporter stays. The conversion follows jaeger-client's `make_jaeger_batch`, so the datagrams are what jaeger-client sent, trace IDs from a remote context wider than 128 bits included: a test encodes spans of every shape (all tag types, logs, follows-from references, IDs at or above 2^63) both ways and compares the bytes. A failure to convert is logged with its traceback once, then at debug level. One jaeger `PrometheusMetricsFactory` serves the process, as each registers its metrics globally. jaeger-client's `reporter_*` options and metrics no longer apply: the docs say what the Rust reporter does instead. Tests run `init_tracer` and check that a Python span and a Rust span under it arrive in one datagram, and that `logging: true` keeps jaeger-client's logging reporter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W4zxygfJC93SsugxskhoJG
This commit is contained in:
1 parent
1d812b46c2
commit
fdb062d9ec
7 files changed
+477
-55
No files matched your search
@@ -108,6 +108,16 @@ configure. A Rust span with a Python parent follows the parent's sampling
|
||||
decision. A trace that starts in Rust is sampled according to the `const` or
|
||||
`probabilistic` sampler. Under any other sampler, such traces are not sampled.
|
||||
|
||||
The same reporter also sends the Python spans, in place of jaeger-client's own
|
||||
reporter and of the optional `rust_python_jaeger_reporter` package, which is no
|
||||
longer used. The rest of `jaeger_config` (the sampler, remote or not, the
|
||||
throttler, `logging`) applies as before. Its `reporter_queue_size`,
|
||||
`reporter_batch_size` and `reporter_flush_interval` options and jaeger-client's
|
||||
`jaeger:reporter_*` metrics no longer apply: the Rust reporter queues up to
|
||||
1000 spans, sends a batch at 100 spans, at 65000 bytes or after a second, and
|
||||
exports `synapse_rust_tracing_*` metrics instead. If tracing in Rust cannot
|
||||
start, jaeger-client's reporter sends the Python spans.
|
||||
|
||||
The Rust reporter's counters are exported as Prometheus metrics named
|
||||
`synapse_rust_tracing_*`. A growing `synapse_rust_tracing_spans_dropped_total`
|
||||
means spans are finishing faster than they can be sent.
|
||||
Reference in new issue
Block a user