Commit 3f3d1b6
committed
fix(confluent-kafka): populate bootstrap.servers span attributes
KafkaPropertiesExtractor.extract_bootstrap_servers was defined but
never called, so confluent-kafka spans were missing messaging.url,
server.address, and server.port even though the extraction helper
existed for it.
- Capture the config dict in AutoInstrumentedProducer/Consumer and
surface it on the Proxied{Producer,Consumer} wrappers.
- extract_bootstrap_servers now accepts both the "bootstrap.servers"
dotted key (confluent-kafka standard) and "bootstrap_servers", and
safely handles list-valued configs and instances without a config
attribute.
- wrap_produce / wrap_poll / wrap_consume pull the config and pass
it through _enrich_span, which sets messaging.url, server.address,
and server.port (parsing host:port from the first broker).
Closes #4104
Signed-off-by: alliasgher <alliasgher123@gmail.com>1 parent a912524 commit 3f3d1b6
5 files changed
Lines changed: 142 additions & 1 deletion
File tree
- instrumentation/opentelemetry-instrumentation-confluent-kafka
- src/opentelemetry/instrumentation/confluent_kafka
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
14 | 19 | | |
15 | 20 | | |
16 | 21 | | |
| |||
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
130 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
131 | 151 | | |
132 | 152 | | |
133 | 153 | | |
| |||
136 | 156 | | |
137 | 157 | | |
138 | 158 | | |
| 159 | + | |
139 | 160 | | |
140 | 161 | | |
141 | 162 | | |
| |||
155 | 176 | | |
156 | 177 | | |
157 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
158 | 183 | | |
159 | 184 | | |
160 | 185 | | |
| |||
184 | 209 | | |
185 | 210 | | |
186 | 211 | | |
| 212 | + | |
| 213 | + | |
187 | 214 | | |
188 | 215 | | |
189 | 216 | | |
| |||
367 | 394 | | |
368 | 395 | | |
369 | 396 | | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
370 | 400 | | |
371 | 401 | | |
372 | 402 | | |
373 | 403 | | |
| 404 | + | |
374 | 405 | | |
375 | 406 | | |
376 | 407 | | |
| |||
385 | 416 | | |
386 | 417 | | |
387 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
388 | 422 | | |
389 | 423 | | |
390 | 424 | | |
| |||
395 | 429 | | |
396 | 430 | | |
397 | 431 | | |
| 432 | + | |
398 | 433 | | |
399 | 434 | | |
400 | 435 | | |
| |||
409 | 444 | | |
410 | 445 | | |
411 | 446 | | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
412 | 450 | | |
413 | 451 | | |
414 | 452 | | |
| |||
417 | 455 | | |
418 | 456 | | |
419 | 457 | | |
| 458 | + | |
420 | 459 | | |
421 | 460 | | |
422 | 461 | | |
| |||
Lines changed: 42 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
| |||
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
24 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
25 | 39 | | |
26 | 40 | | |
27 | 41 | | |
| |||
115 | 129 | | |
116 | 130 | | |
117 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
118 | 156 | | |
119 | 157 | | |
120 | 158 | | |
121 | 159 | | |
122 | 160 | | |
123 | 161 | | |
| 162 | + | |
124 | 163 | | |
125 | 164 | | |
126 | 165 | | |
| |||
141 | 180 | | |
142 | 181 | | |
143 | 182 | | |
| 183 | + | |
| 184 | + | |
144 | 185 | | |
145 | 186 | | |
146 | 187 | | |
| |||
Lines changed: 54 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
33 | 37 | | |
34 | 38 | | |
35 | 39 | | |
| |||
447 | 451 | | |
448 | 452 | | |
449 | 453 | | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| |||
0 commit comments