Commit 0573086
authored
feat(coprocessor): standardize tracing/OTEL spans across workers (#1976)
* feat(coprocessor): migrate Phases C/D/H/J spans to tracing
Migrate remaining coprocessor workers from legacy OtelTracer to the
tracing + OTEL bridge pattern established in Phase A/B:
- Phase C: zkproof-worker verify_task spans (verifier.rs)
- Phase D: tfhe-worker high-signal execution loop spans (tfhe_worker.rs)
- Phase H: host-listener DB propagation spans (tfhe_event_propagate.rs)
- Phase J: transaction-sender op spans (add_ciphertext, allow_handle,
delegate_user_decrypt, verify_proof)
Also cleans up telemetry.rs by removing the now-unused OtelTracer
wrapper and legacy span helpers, fixes a pre-existing clippy lint in
chain_id.rs, and fixes minor sns-worker span hygiene from Phase B.
Closes zama-ai/fhevm-internal#935
Closes zama-ai/fhevm-internal#1008
Closes zama-ai/fhevm-internal#1009
Closes zama-ai/fhevm-internal#1034
Closes zama-ai/fhevm-internal#1036
* refactor(coprocessor): use idiomatic #[tracing::instrument] everywhere
Address PR review feedback:
- Replace manual info_span!() + .enter() with #[tracing::instrument]
on functions (host-listener, transaction-sender, zkproof-worker,
tfhe-worker)
- Remove all set_parent() calls in zkproof-worker — tracing-opentelemetry
layer handles parent propagation automatically via #[instrument]
- Remove span: tracing::Span parameter threading in verify_proof and
create_ciphertext
- Use .instrument(loop_span) for async parent context in tfhe-worker
instead of passing loop_span as a function parameter
- Revert out-of-scope chain_id.rs clippy fix
* refactor(coprocessor): remove last non-cross-boundary set_parent, document remaining
- Replace set_parent(t.context()) with parent: &t in batch_store span
(same execution context, not cross-boundary)
- Add comments on the two remaining set_parent calls explaining they
restore OTel context across async/thread boundaries
* refactor(coprocessor): migrate scheduler crate from raw OTel to tracing
Replace opentelemetry::global::tracer + manual spans with
tracing::info_span! in the scheduler's DFG execution pipeline.
Remove set_txn_id / BoxedSpan from telemetry.rs (no remaining callers).
* refactor(coprocessor): address review feedback on tracing style
* fix(coprocessor): restore tracing telemetry parity
* refactor(tfhe-worker): avoid unnecessary txn id allocation
* fix(coprocessor): address telemetry rereview cleanup items
* fix(coprocessor): address obatirou telemetry review comments
* refactor(coprocessor): dedupe short id telemetry helper
* refactor(coprocessor): streamline span metadata per obatirou review
* fix(zkproof-worker): instrument db_insert span timing
* fix(transaction-sender): restore prepare_delegate tracing parity
* fix(telemetry): simplify short-id helper callsites
* fix(coprocessor): drop out-of-scope chain_id style delta
* refactor(coprocessor): dedupe span error helper and remove stale dead_code attr
* fix(coprocessor): restore service otel wiring and align span op names
* refactor(coprocessor): simplify OTLP subscriber init fallback
* chore(coprocessor): remove unused init_otel helper
* fix(zkproof-worker): drop duplicate create_handle info event
* docs(telemetry): clarify OTLP fallback semantics
* refactor(telemetry): rename otel init helper for explicit fallback semantics
* refactor(coprocessor): unify info macro usage and remove duplicate event
* docs(coprocessor): add telemetry style guide and keep local OTLP endpoint
* refactor(tfhe-worker): use shared span-error helper in error paths
* refactor(txn-sender): simplify optional txn_id span fielding
* refactor(txn-sender): restore lean optional txn_id span recording
* fix(coprocessor): restore span attribute parity and fix A/B regressions
- Remove redundant info! events in tfhe-worker that duplicated span fields
- Restore db_insert count/valid and verify_proof list_len as span fields
instead of log events in zkproof-worker (attribute parity with main)
- Add count field to expand_verified_list span (was set by caller on main)
- Restore distinct span names in txn-sender via #[instrument(name = ...)]
to avoid collapsing 4 operations into 2 generic names
* refactor(coprocessor): remove redundant operation= span attributes
The span name already serves as the operation identifier in Jaeger/OTEL,
making the duplicate operation field unnecessary. Where operation differed
from the function name, name= on #[instrument] was already set in the
prior commit. The scheduler's FheGetCiphertext operation is intentionally
kept as it represents the FHE opcode, not the function name.1 parent ad06d43 commit 0573086
File tree
28 files changed
+669
-739
lines changed- coprocessor
- fhevm-engine
- fhevm-engine-common/src
- gw-listener/src/bin
- host-listener/src
- bin
- cmd
- database
- poller
- scheduler
- src/dfg
- sns-worker/src
- bin
- tfhe-worker
- src
- transaction-sender/src
- bin
- ops
- zkproof-worker
- src
- bin
- test-suite/fhevm/scripts
28 files changed
+669
-739
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
286 | 335 | | |
287 | 336 | | |
288 | 337 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 50 additions & 140 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 4 | + | |
9 | 5 | | |
10 | 6 | | |
11 | 7 | | |
| |||
14 | 10 | | |
15 | 11 | | |
16 | 12 | | |
17 | | - | |
18 | 13 | | |
19 | 14 | | |
20 | | - | |
| 15 | + | |
| 16 | + | |
21 | 17 | | |
22 | 18 | | |
23 | | - | |
24 | | - | |
25 | 19 | | |
26 | 20 | | |
27 | 21 | | |
| |||
67 | 61 | | |
68 | 62 | | |
69 | 63 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | 64 | | |
83 | 65 | | |
84 | 66 | | |
| |||
115 | 97 | | |
116 | 98 | | |
117 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
| |||
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | 146 | | |
259 | 147 | | |
260 | 148 | | |
| |||
326 | 214 | | |
327 | 215 | | |
328 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
329 | 245 | | |
330 | 246 | | |
331 | 247 | | |
| |||
615 | 531 | | |
616 | 532 | | |
617 | 533 | | |
618 | | - | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | 534 | | |
Lines changed: 5 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
126 | 118 | | |
127 | 119 | | |
128 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
0 commit comments