Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added messaging.kafka.bootstrap.servers to consume spans #6327

Merged
merged 16 commits into from
Jan 9, 2024

Conversation

kr-igor
Copy link
Contributor

@kr-igor kr-igor commented Dec 6, 2023

What Does This Do

As per title, it adds a new tag on consume spans for Kafka. Prior this PR only produce span had bootstrap servers information.

Motivation

This makes connections between datasources simple, allowing to build data lineage.

Additional Notes

Trello

@pr-commenter
Copy link

pr-commenter bot commented Dec 6, 2023

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master kr-igor/add-bootstrap-server-to-consume
git_commit_date 1704817822 1704820905
git_commit_sha 4d7d105 1510f3e
release_version 1.28.0-SNAPSHOT~4d7d10561c 1.28.0-SNAPSHOT~1510f3e442
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1704823595 1704823595
ci_job_id 404180987 404180987
ci_pipeline_id 26156339 26156339
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
module Agent Agent
parent None None
variant iast iast

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 45 metrics, 9 unstable metrics.

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.28.0-SNAPSHOT~1510f3e442, baseline=1.28.0-SNAPSHOT~4d7d10561c

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.06 s) : 0, 1059640
Total [baseline] (8.76 s) : 0, 8759645
Agent [candidate] (1.051 s) : 0, 1050606
Total [candidate] (8.75 s) : 0, 8749819
section iast
Agent [baseline] (1.181 s) : 0, 1181031
Total [baseline] (9.308 s) : 0, 9308076
Agent [candidate] (1.172 s) : 0, 1172395
Total [candidate] (9.253 s) : 0, 9252991
section iast_TELEMETRY_OFF
Agent [baseline] (1.168 s) : 0, 1168270
Total [baseline] (9.243 s) : 0, 9243210
Agent [candidate] (1.17 s) : 0, 1170214
Total [candidate] (9.28 s) : 0, 9280274
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.06 s -
Agent iast 1.181 s 121.391 ms (11.5%)
Agent iast_TELEMETRY_OFF 1.168 s 108.63 ms (10.3%)
Total tracing 8.76 s -
Total iast 9.308 s 548.431 ms (6.3%)
Total iast_TELEMETRY_OFF 9.243 s 483.565 ms (5.5%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.051 s -
Agent iast 1.172 s 121.788 ms (11.6%)
Agent iast_TELEMETRY_OFF 1.17 s 119.608 ms (11.4%)
Total tracing 8.75 s -
Total iast 9.253 s 503.172 ms (5.8%)
Total iast_TELEMETRY_OFF 9.28 s 530.455 ms (6.1%)
gantt
    title insecure-bank - break down per module: candidate=1.28.0-SNAPSHOT~1510f3e442, baseline=1.28.0-SNAPSHOT~4d7d10561c

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (656.209 ms) : 0, 656209
BytebuddyAgent [candidate] (651.239 ms) : 0, 651239
GlobalTracer [baseline] (309.667 ms) : 0, 309667
GlobalTracer [candidate] (306.827 ms) : 0, 306827
AppSec [baseline] (51.416 ms) : 0, 51416
AppSec [candidate] (50.467 ms) : 0, 50467
Remote Config [baseline] (672.36 µs) : 0, 672
Remote Config [candidate] (664.469 µs) : 0, 664
Telemetry [baseline] (7.253 ms) : 0, 7253
Telemetry [candidate] (7.18 ms) : 0, 7180
section iast
BytebuddyAgent [baseline] (777.705 ms) : 0, 777705
BytebuddyAgent [candidate] (771.794 ms) : 0, 771794
GlobalTracer [baseline] (287.538 ms) : 0, 287538
GlobalTracer [candidate] (285.101 ms) : 0, 285101
AppSec [baseline] (52.107 ms) : 0, 52107
AppSec [candidate] (52.109 ms) : 0, 52109
IAST [baseline] (19.757 ms) : 0, 19757
IAST [candidate] (22.105 ms) : 0, 22105
Remote Config [baseline] (584.307 µs) : 0, 584
Remote Config [candidate] (582.247 µs) : 0, 582
Telemetry [baseline] (8.876 ms) : 0, 8876
Telemetry [candidate] (6.489 ms) : 0, 6489
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (766.227 ms) : 0, 766227
BytebuddyAgent [candidate] (767.583 ms) : 0, 767583
GlobalTracer [baseline] (286.34 ms) : 0, 286340
GlobalTracer [candidate] (286.745 ms) : 0, 286745
AppSec [baseline] (49.268 ms) : 0, 49268
AppSec [candidate] (51.736 ms) : 0, 51736
IAST [baseline] (24.234 ms) : 0, 24234
IAST [candidate] (21.927 ms) : 0, 21927
Remote Config [baseline] (589.623 µs) : 0, 590
Remote Config [candidate] (586.453 µs) : 0, 586
Telemetry [baseline] (7.312 ms) : 0, 7312
Telemetry [candidate] (7.266 ms) : 0, 7266
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.28.0-SNAPSHOT~1510f3e442, baseline=1.28.0-SNAPSHOT~4d7d10561c

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.059 s) : 0, 1058542
Total [baseline] (9.392 s) : 0, 9391864
Agent [candidate] (1.056 s) : 0, 1055826
Total [candidate] (9.417 s) : 0, 9417038
section appsec
Agent [baseline] (1.156 s) : 0, 1156075
Total [baseline] (9.493 s) : 0, 9492682
Agent [candidate] (1.164 s) : 0, 1164486
Total [candidate] (9.482 s) : 0, 9482092
section iast
Agent [baseline] (1.175 s) : 0, 1175439
Total [baseline] (9.612 s) : 0, 9611977
Agent [candidate] (1.183 s) : 0, 1183411
Total [candidate] (9.697 s) : 0, 9696799
section profiling
Agent [baseline] (1.291 s) : 0, 1290774
Total [baseline] (9.596 s) : 0, 9596174
Agent [candidate] (1.29 s) : 0, 1290076
Total [candidate] (9.607 s) : 0, 9606586
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.059 s -
Agent appsec 1.156 s 97.533 ms (9.2%)
Agent iast 1.175 s 116.897 ms (11.0%)
Agent profiling 1.291 s 232.232 ms (21.9%)
Total tracing 9.392 s -
Total appsec 9.493 s 100.818 ms (1.1%)
Total iast 9.612 s 220.113 ms (2.3%)
Total profiling 9.596 s 204.31 ms (2.2%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.056 s -
Agent appsec 1.164 s 108.66 ms (10.3%)
Agent iast 1.183 s 127.585 ms (12.1%)
Agent profiling 1.29 s 234.249 ms (22.2%)
Total tracing 9.417 s -
Total appsec 9.482 s 65.054 ms (0.7%)
Total iast 9.697 s 279.761 ms (3.0%)
Total profiling 9.607 s 189.548 ms (2.0%)
gantt
    title petclinic - break down per module: candidate=1.28.0-SNAPSHOT~1510f3e442, baseline=1.28.0-SNAPSHOT~4d7d10561c

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (656.167 ms) : 0, 656167
BytebuddyAgent [candidate] (653.026 ms) : 0, 653026
GlobalTracer [baseline] (308.939 ms) : 0, 308939
GlobalTracer [candidate] (309.57 ms) : 0, 309570
AppSec [baseline] (51.037 ms) : 0, 51037
AppSec [candidate] (50.903 ms) : 0, 50903
Remote Config [baseline] (659.86 µs) : 0, 660
Remote Config [candidate] (671.659 µs) : 0, 672
Telemetry [baseline] (7.24 ms) : 0, 7240
Telemetry [candidate] (7.272 ms) : 0, 7272
section appsec
BytebuddyAgent [baseline] (655.662 ms) : 0, 655662
BytebuddyAgent [candidate] (660.837 ms) : 0, 660837
GlobalTracer [baseline] (309.188 ms) : 0, 309188
GlobalTracer [candidate] (311.645 ms) : 0, 311645
AppSec [baseline] (149.179 ms) : 0, 149179
AppSec [candidate] (149.649 ms) : 0, 149649
Remote Config [baseline] (643.847 µs) : 0, 644
Remote Config [candidate] (654.094 µs) : 0, 654
Telemetry [baseline] (6.934 ms) : 0, 6934
Telemetry [candidate] (6.986 ms) : 0, 6986
section iast
BytebuddyAgent [baseline] (773.73 ms) : 0, 773730
BytebuddyAgent [candidate] (780.017 ms) : 0, 780017
GlobalTracer [baseline] (286.189 ms) : 0, 286189
GlobalTracer [candidate] (287.476 ms) : 0, 287476
AppSec [baseline] (55.058 ms) : 0, 55058
AppSec [candidate] (53.822 ms) : 0, 53822
Remote Config [baseline] (599.12 µs) : 0, 599
Remote Config [candidate] (588.224 µs) : 0, 588
Telemetry [baseline] (6.522 ms) : 0, 6522
Telemetry [candidate] (8.751 ms) : 0, 8751
IAST [baseline] (18.927 ms) : 0, 18927
IAST [candidate] (18.126 ms) : 0, 18126
section profiling
BytebuddyAgent [baseline] (672.297 ms) : 0, 672297
BytebuddyAgent [candidate] (672.054 ms) : 0, 672054
GlobalTracer [baseline] (378.834 ms) : 0, 378834
GlobalTracer [candidate] (379.473 ms) : 0, 379473
AppSec [baseline] (51.765 ms) : 0, 51765
AppSec [candidate] (51.553 ms) : 0, 51553
Remote Config [baseline] (1.009 ms) : 0, 1009
Remote Config [candidate] (1.011 ms) : 0, 1011
Telemetry [baseline] (7.232 ms) : 0, 7232
Telemetry [candidate] (7.462 ms) : 0, 7462
ProfilingAgent [baseline] (124.622 ms) : 0, 124622
ProfilingAgent [candidate] (123.375 ms) : 0, 123375
Profiling [baseline] (124.647 ms) : 0, 124647
Profiling [candidate] (123.4 ms) : 0, 123400
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2024-01-09T17:45:52 2024-01-09T18:02:22
git_branch master kr-igor/add-bootstrap-server-to-consume
git_commit_date 1704817822 1704820905
git_commit_sha 4d7d105 1510f3e
release_version 1.28.0-SNAPSHOT~4d7d10561c 1.28.0-SNAPSHOT~1510f3e442
start_time 2024-01-09T17:45:39 2024-01-09T18:02:09
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1704823595 1704823595
ci_job_id 404180987 404180987
ci_pipeline_id 26156339 26156339
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
variant iast iast

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 12 unstable metrics.

Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.28.0-SNAPSHOT~1510f3e442, baseline=1.28.0-SNAPSHOT~4d7d10561c
    dateFormat X
    axisFormat %s
section baseline
no_agent (372.278 µs) : 352, 393
.   : milestone, 372,
iast (472.11 µs) : 452, 493
.   : milestone, 472,
iast_FULL (542.595 µs) : 522, 563
.   : milestone, 543,
iast_INACTIVE (453.677 µs) : 433, 475
.   : milestone, 454,
iast_TELEMETRY_OFF (477.698 µs) : 457, 499
.   : milestone, 478,
tracing (437.935 µs) : 417, 458
.   : milestone, 438,
section candidate
no_agent (367.684 µs) : 348, 387
.   : milestone, 368,
iast (476.526 µs) : 456, 497
.   : milestone, 477,
iast_FULL (546.69 µs) : 526, 567
.   : milestone, 547,
iast_INACTIVE (447.969 µs) : 428, 468
.   : milestone, 448,
iast_TELEMETRY_OFF (466.499 µs) : 446, 487
.   : milestone, 466,
tracing (436.353 µs) : 416, 456
.   : milestone, 436,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 372.278 µs [351.867 µs, 392.689 µs] -
iast 472.11 µs [451.633 µs, 492.587 µs] 99.832 µs (26.8%)
iast_FULL 542.595 µs [522.07 µs, 563.12 µs] 170.316 µs (45.7%)
iast_INACTIVE 453.677 µs [432.654 µs, 474.701 µs] 81.399 µs (21.9%)
iast_TELEMETRY_OFF 477.698 µs [456.628 µs, 498.768 µs] 105.42 µs (28.3%)
tracing 437.935 µs [417.375 µs, 458.495 µs] 65.657 µs (17.6%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 367.684 µs [348.01 µs, 387.357 µs] -
iast 476.526 µs [455.841 µs, 497.21 µs] 108.842 µs (29.6%)
iast_FULL 546.69 µs [526.44 µs, 566.94 µs] 179.007 µs (48.7%)
iast_INACTIVE 447.969 µs [427.609 µs, 468.329 µs] 80.286 µs (21.8%)
iast_TELEMETRY_OFF 466.499 µs [446.11 µs, 486.887 µs] 98.815 µs (26.9%)
tracing 436.353 µs [416.309 µs, 456.398 µs] 68.67 µs (18.7%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.28.0-SNAPSHOT~1510f3e442, baseline=1.28.0-SNAPSHOT~4d7d10561c
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.362 ms) : 1343, 1381
.   : milestone, 1362,
appsec (1.745 ms) : 1719, 1770
.   : milestone, 1745,
iast (1.519 ms) : 1494, 1544
.   : milestone, 1519,
profiling (1.565 ms) : 1539, 1591
.   : milestone, 1565,
tracing (1.494 ms) : 1469, 1519
.   : milestone, 1494,
section candidate
no_agent (1.355 ms) : 1336, 1374
.   : milestone, 1355,
appsec (1.776 ms) : 1751, 1801
.   : milestone, 1776,
iast (1.533 ms) : 1509, 1557
.   : milestone, 1533,
profiling (1.513 ms) : 1487, 1538
.   : milestone, 1513,
tracing (1.485 ms) : 1460, 1510
.   : milestone, 1485,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.362 ms [1.343 ms, 1.381 ms] -
appsec 1.745 ms [1.719 ms, 1.77 ms] 382.948 µs (28.1%)
iast 1.519 ms [1.494 ms, 1.544 ms] 157.19 µs (11.5%)
profiling 1.565 ms [1.539 ms, 1.591 ms] 203.374 µs (14.9%)
tracing 1.494 ms [1.469 ms, 1.519 ms] 132.089 µs (9.7%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.355 ms [1.336 ms, 1.374 ms] -
appsec 1.776 ms [1.751 ms, 1.801 ms] 421.249 µs (31.1%)
iast 1.533 ms [1.509 ms, 1.557 ms] 178.334 µs (13.2%)
profiling 1.513 ms [1.487 ms, 1.538 ms] 158.231 µs (11.7%)
tracing 1.485 ms [1.46 ms, 1.51 ms] 130.384 µs (9.6%)

@kr-igor kr-igor marked this pull request as ready for review December 11, 2023 16:29
@kr-igor kr-igor requested a review from a team as a code owner December 11, 2023 16:29
Copy link
Contributor

@nayeem-kamal nayeem-kamal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some small comments. Overall LGTM.


public TracingIterator(
final Iterator<ConsumerRecord<?, ?>> delegateIterator,
final CharSequence operationName,
final KafkaDecorator decorator,
String group) {
final ConsumerContext context) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering, is there a reason that the ConsumerContext field is final in the constructor for TracingIterator and not for TracingIterable or TracingList constructors? It looks to me like this field can be made final in all 3 constructors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I somehow missed this. Will update the PR.


public TracingList(
final List<ConsumerRecord<?, ?>> delegate,
final CharSequence operationName,
final KafkaDecorator decorator,
String group) {
ConsumerContext context) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above comment.

Copy link
Contributor

github-actions bot commented Jan 9, 2024

Hi! 👋 Looks like you updated a Git Submodule.
If this was not intentional please make sure to:

Copy link
Contributor

github-actions bot commented Jan 9, 2024

Hi! 👋 Looks like you updated a Git Submodule.
If this was not intentional please make sure to:

Copy link
Contributor

github-actions bot commented Jan 9, 2024

Hi! 👋 Looks like you updated a Git Submodule.
If this was not intentional please make sure to:

Copy link
Contributor

github-actions bot commented Jan 9, 2024

Hi! 👋 Looks like you updated a Git Submodule.
If this was not intentional please make sure to:

@pr-commenter
Copy link

pr-commenter bot commented Jan 9, 2024

Kafka / producer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master kr-igor/add-bootstrap-server-to-consume
git_commit_date 1704817822 1704820905
git_commit_sha 4d7d105 1510f3e
See matching parameters
Baseline Candidate
ci_job_date 1704822123 1704822123
ci_job_id 404180988 404180988
ci_pipeline_id 26156339 26156339
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
jdkVersion 11.0.21 11.0.21
jmhVersion 1.36 1.36
jvm /usr/lib/jvm/java-11-openjdk-amd64/bin/java /usr/lib/jvm/java-11-openjdk-amd64/bin/java
jvmArgs -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/go/src/github.com/DataDog/apm-reliability/dd-trace-java/platform/src/producer-benchmark/build/tmp/jmh -Duser.country=US -Duser.language=en -Duser.variant -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/go/src/github.com/DataDog/apm-reliability/dd-trace-java/platform/src/producer-benchmark/build/tmp/jmh -Duser.country=US -Duser.language=en -Duser.variant
vmName OpenJDK 64-Bit Server VM OpenJDK 64-Bit Server VM
vmVersion 11.0.21+9-post-Ubuntu-0ubuntu122.04 11.0.21+9-post-Ubuntu-0ubuntu122.04

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics.

See unchanged results
scenario Δ mean throughput
scenario:not-instrumented/KafkaProduceBenchmark.benchProduce same
scenario:only-tracing-dsm-disabled-benchmarks/KafkaProduceBenchmark.benchProduce same
scenario:only-tracing-dsm-enabled-benchmarks/KafkaProduceBenchmark.benchProduce same

@pr-commenter
Copy link

pr-commenter bot commented Jan 9, 2024

Kafka / consumer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master kr-igor/add-bootstrap-server-to-consume
git_commit_date 1704817822 1704820905
git_commit_sha 4d7d105 1510f3e
See matching parameters
Baseline Candidate
ci_job_date 1704822163 1704822163
ci_job_id 404180989 404180989
ci_pipeline_id 26156339 26156339
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
jdkVersion 11.0.21 11.0.21
jmhVersion 1.36 1.36
jvm /usr/lib/jvm/java-11-openjdk-amd64/bin/java /usr/lib/jvm/java-11-openjdk-amd64/bin/java
jvmArgs -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/go/src/github.com/DataDog/apm-reliability/dd-trace-java/platform/src/consumer-benchmark/build/tmp/jmh -Duser.country=US -Duser.language=en -Duser.variant -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/go/src/github.com/DataDog/apm-reliability/dd-trace-java/platform/src/consumer-benchmark/build/tmp/jmh -Duser.country=US -Duser.language=en -Duser.variant
vmName OpenJDK 64-Bit Server VM OpenJDK 64-Bit Server VM
vmVersion 11.0.21+9-post-Ubuntu-0ubuntu122.04 11.0.21+9-post-Ubuntu-0ubuntu122.04

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics.

See unchanged results
scenario Δ mean throughput
scenario:not-instrumented/KafkaConsumerBenchmark.benchConsume same
scenario:only-tracing-dsm-disabled-benchmarks/KafkaConsumerBenchmark.benchConsume unsure
[+339.364op/s; +8217.372op/s] or [+0.111%; +2.693%]
scenario:only-tracing-dsm-enabled-benchmarks/KafkaConsumerBenchmark.benchConsume same

Copy link
Contributor

@nayeem-kamal nayeem-kamal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kr-igor kr-igor merged commit b8fa3da into master Jan 9, 2024
75 checks passed
@kr-igor kr-igor deleted the kr-igor/add-bootstrap-server-to-consume branch January 9, 2024 22:04
@github-actions github-actions bot added this to the 1.28.0 milestone Jan 9, 2024
@PerfectSlayer PerfectSlayer added the inst: kafka Kafka instrumentation label Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inst: kafka Kafka instrumentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants