Commit 17006d7
authored
fix(confluent-kafka): populate bootstrap.servers span attributes (#4423)
* 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>
* fix(confluent-kafka): remove deprecated messaging.url, fix CHANGELOG link
Signed-off-by: alliasgher <alliasgher123@gmail.com>
* fix(confluent-kafka): use PUBLISH for second produce path per review
The second _enrich_span call in wrap_produce also runs inside a producer
span but used RECEIVE. Align with the first path and with the semantic
conventions.
Signed-off-by: Ali <alliasgher123@gmail.com>
---------
Signed-off-by: alliasgher <alliasgher123@gmail.com>
Signed-off-by: Ali <alliasgher123@gmail.com>1 parent a3d38a7 commit 17006d7
5 files changed
Lines changed: 134 additions & 3 deletions
File tree
- instrumentation/opentelemetry-instrumentation-confluent-kafka
- src/opentelemetry/instrumentation/confluent_kafka
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
62 | 67 | | |
63 | 68 | | |
64 | 69 | | |
| |||
Lines changed: 41 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
119 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
120 | 140 | | |
121 | 141 | | |
122 | 142 | | |
| |||
125 | 145 | | |
126 | 146 | | |
127 | 147 | | |
| 148 | + | |
128 | 149 | | |
129 | 150 | | |
130 | 151 | | |
| |||
144 | 165 | | |
145 | 166 | | |
146 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
147 | 172 | | |
148 | 173 | | |
149 | 174 | | |
| |||
173 | 198 | | |
174 | 199 | | |
175 | 200 | | |
| 201 | + | |
| 202 | + | |
176 | 203 | | |
177 | 204 | | |
178 | 205 | | |
| |||
355 | 382 | | |
356 | 383 | | |
357 | 384 | | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
358 | 388 | | |
359 | 389 | | |
360 | 390 | | |
361 | | - | |
362 | | - | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
363 | 394 | | |
364 | 395 | | |
365 | 396 | | |
| |||
373 | 404 | | |
374 | 405 | | |
375 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
376 | 410 | | |
377 | 411 | | |
378 | 412 | | |
| |||
383 | 417 | | |
384 | 418 | | |
385 | 419 | | |
| 420 | + | |
386 | 421 | | |
387 | 422 | | |
388 | 423 | | |
| |||
397 | 432 | | |
398 | 433 | | |
399 | 434 | | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
400 | 438 | | |
401 | 439 | | |
402 | 440 | | |
| |||
405 | 443 | | |
406 | 444 | | |
407 | 445 | | |
| 446 | + | |
408 | 447 | | |
409 | 448 | | |
410 | 449 | | |
| |||
Lines changed: 40 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| |||
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
27 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
28 | 42 | | |
29 | 43 | | |
30 | 44 | | |
| |||
118 | 132 | | |
119 | 133 | | |
120 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
121 | 157 | | |
122 | 158 | | |
123 | 159 | | |
124 | 160 | | |
125 | 161 | | |
126 | 162 | | |
| 163 | + | |
127 | 164 | | |
128 | 165 | | |
129 | 166 | | |
| |||
144 | 181 | | |
145 | 182 | | |
146 | 183 | | |
| 184 | + | |
| 185 | + | |
147 | 186 | | |
148 | 187 | | |
149 | 188 | | |
| |||
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| |||
436 | 440 | | |
437 | 441 | | |
438 | 442 | | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 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 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| |||
0 commit comments