-
Notifications
You must be signed in to change notification settings - Fork 312
Fix tracer OpenLineage instrumentation #9487
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
base: master
Are you sure you want to change the base?
Fix tracer OpenLineage instrumentation #9487
Conversation
7efaf57
to
07c5e27
Compare
🎯 Code Coverage 🔗 Commit SHA: 0e9b724 | Docs | Was this helpful? Give us feedback! |
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 46 metrics, 13 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.54.0-SNAPSHOT~0e9b72482d, baseline=1.54.0-SNAPSHOT~03d997e2fd
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.046 s) : 0, 1046424
Total [baseline] (10.712 s) : 0, 10712226
Agent [candidate] (1.052 s) : 0, 1052100
Total [candidate] (10.769 s) : 0, 10768526
section appsec
Agent [baseline] (1.222 s) : 0, 1221882
Total [baseline] (10.816 s) : 0, 10815665
Agent [candidate] (1.224 s) : 0, 1224340
Total [candidate] (10.856 s) : 0, 10856473
section iast
Agent [baseline] (1.182 s) : 0, 1181817
Total [baseline] (10.914 s) : 0, 10913540
Agent [candidate] (1.19 s) : 0, 1189592
Total [candidate] (10.998 s) : 0, 10998386
section profiling
Agent [baseline] (1.2 s) : 0, 1199755
Total [baseline] (10.902 s) : 0, 10901881
Agent [candidate] (1.199 s) : 0, 1198745
Total [candidate] (10.851 s) : 0, 10851150
gantt
title petclinic - break down per module: candidate=1.54.0-SNAPSHOT~0e9b72482d, baseline=1.54.0-SNAPSHOT~03d997e2fd
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.454 ms) : 0, 1454
crashtracking [candidate] (1.445 ms) : 0, 1445
BytebuddyAgent [baseline] (731.34 ms) : 0, 731340
BytebuddyAgent [candidate] (735.559 ms) : 0, 735559
GlobalTracer [baseline] (242.094 ms) : 0, 242094
GlobalTracer [candidate] (243.623 ms) : 0, 243623
AppSec [baseline] (30.045 ms) : 0, 30045
AppSec [candidate] (30.358 ms) : 0, 30358
Debugger [baseline] (6.083 ms) : 0, 6083
Debugger [candidate] (6.098 ms) : 0, 6098
Remote Config [baseline] (692.621 µs) : 0, 693
Remote Config [candidate] (673.887 µs) : 0, 674
Telemetry [baseline] (13.75 ms) : 0, 13750
Telemetry [candidate] (13.137 ms) : 0, 13137
section appsec
crashtracking [baseline] (1.452 ms) : 0, 1452
crashtracking [candidate] (1.452 ms) : 0, 1452
BytebuddyAgent [baseline] (754.412 ms) : 0, 754412
BytebuddyAgent [candidate] (756.15 ms) : 0, 756150
GlobalTracer [baseline] (235.048 ms) : 0, 235048
GlobalTracer [candidate] (235.644 ms) : 0, 235644
IAST [baseline] (23.593 ms) : 0, 23593
IAST [candidate] (23.757 ms) : 0, 23757
AppSec [baseline] (168.915 ms) : 0, 168915
AppSec [candidate] (167.563 ms) : 0, 167563
Debugger [baseline] (6.612 ms) : 0, 6612
Debugger [candidate] (8.049 ms) : 0, 8049
Remote Config [baseline] (632.087 µs) : 0, 632
Remote Config [candidate] (631.829 µs) : 0, 632
Telemetry [baseline] (10.104 ms) : 0, 10104
Telemetry [candidate] (10.011 ms) : 0, 10011
section iast
crashtracking [baseline] (1.454 ms) : 0, 1454
crashtracking [candidate] (1.462 ms) : 0, 1462
BytebuddyAgent [baseline] (853.198 ms) : 0, 853198
BytebuddyAgent [candidate] (860.07 ms) : 0, 860070
GlobalTracer [baseline] (233.428 ms) : 0, 233428
GlobalTracer [candidate] (234.271 ms) : 0, 234271
IAST [baseline] (29.317 ms) : 0, 29317
IAST [candidate] (31.036 ms) : 0, 31036
AppSec [baseline] (27.809 ms) : 0, 27809
AppSec [candidate] (26.033 ms) : 0, 26033
Debugger [baseline] (6.635 ms) : 0, 6635
Debugger [candidate] (6.633 ms) : 0, 6633
Remote Config [baseline] (597.107 µs) : 0, 597
Remote Config [candidate] (593.603 µs) : 0, 594
Telemetry [baseline] (8.272 ms) : 0, 8272
Telemetry [candidate] (8.312 ms) : 0, 8312
section profiling
crashtracking [baseline] (1.423 ms) : 0, 1423
crashtracking [candidate] (1.422 ms) : 0, 1422
BytebuddyAgent [baseline] (763.002 ms) : 0, 763002
BytebuddyAgent [candidate] (762.533 ms) : 0, 762533
GlobalTracer [baseline] (223.008 ms) : 0, 223008
GlobalTracer [candidate] (223.059 ms) : 0, 223059
AppSec [baseline] (31.434 ms) : 0, 31434
AppSec [candidate] (30.477 ms) : 0, 30477
Debugger [baseline] (6.264 ms) : 0, 6264
Debugger [candidate] (6.228 ms) : 0, 6228
Remote Config [baseline] (722.27 µs) : 0, 722
Remote Config [candidate] (696.605 µs) : 0, 697
Telemetry [baseline] (15.573 ms) : 0, 15573
Telemetry [candidate] (16.219 ms) : 0, 16219
ProfilingAgent [baseline] (107.791 ms) : 0, 107791
ProfilingAgent [candidate] (107.701 ms) : 0, 107701
Profiling [baseline] (108.462 ms) : 0, 108462
Profiling [candidate] (108.361 ms) : 0, 108361
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.54.0-SNAPSHOT~0e9b72482d, baseline=1.54.0-SNAPSHOT~03d997e2fd
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.048 s) : 0, 1048177
Total [baseline] (8.649 s) : 0, 8648623
Agent [candidate] (1.042 s) : 0, 1042127
Total [candidate] (8.626 s) : 0, 8625792
section iast
Agent [baseline] (1.181 s) : 0, 1180509
Total [baseline] (9.383 s) : 0, 9382754
Agent [candidate] (1.179 s) : 0, 1179441
Total [candidate] (9.331 s) : 0, 9330898
gantt
title insecure-bank - break down per module: candidate=1.54.0-SNAPSHOT~0e9b72482d, baseline=1.54.0-SNAPSHOT~03d997e2fd
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.456 ms) : 0, 1456
crashtracking [candidate] (1.445 ms) : 0, 1445
BytebuddyAgent [baseline] (732.272 ms) : 0, 732272
BytebuddyAgent [candidate] (729.998 ms) : 0, 729998
GlobalTracer [baseline] (242.647 ms) : 0, 242647
GlobalTracer [candidate] (241.548 ms) : 0, 241548
AppSec [baseline] (30.2 ms) : 0, 30200
AppSec [candidate] (29.944 ms) : 0, 29944
Debugger [baseline] (6.115 ms) : 0, 6115
Debugger [candidate] (6.065 ms) : 0, 6065
Remote Config [baseline] (691.928 µs) : 0, 692
Remote Config [candidate] (673.892 µs) : 0, 674
Telemetry [baseline] (13.778 ms) : 0, 13778
Telemetry [candidate] (11.473 ms) : 0, 11473
section iast
crashtracking [baseline] (1.453 ms) : 0, 1453
crashtracking [candidate] (1.447 ms) : 0, 1447
BytebuddyAgent [baseline] (852.122 ms) : 0, 852122
BytebuddyAgent [candidate] (851.541 ms) : 0, 851541
GlobalTracer [baseline] (233.183 ms) : 0, 233183
GlobalTracer [candidate] (232.991 ms) : 0, 232991
IAST [baseline] (30.548 ms) : 0, 30548
IAST [candidate] (28.522 ms) : 0, 28522
AppSec [baseline] (26.723 ms) : 0, 26723
AppSec [candidate] (28.403 ms) : 0, 28403
Debugger [baseline] (6.611 ms) : 0, 6611
Debugger [candidate] (6.603 ms) : 0, 6603
Remote Config [baseline] (604.543 µs) : 0, 605
Remote Config [candidate] (594.347 µs) : 0, 594
Telemetry [baseline] (8.222 ms) : 0, 8222
Telemetry [candidate] (8.282 ms) : 0, 8282
LoadParameters
See matching parameters
SummaryFound 2 performance improvements and 1 performance regressions! Performance is the same for 9 metrics, 12 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.54.0-SNAPSHOT~0e9b72482d, baseline=1.54.0-SNAPSHOT~03d997e2fd
dateFormat X
axisFormat %s
section baseline
no_agent (4.37 ms) : 4319, 4420
. : milestone, 4370,
iast (9.461 ms) : 9305, 9616
. : milestone, 9461,
iast_FULL (14.047 ms) : 13764, 14330
. : milestone, 14047,
iast_GLOBAL (10.373 ms) : 10189, 10558
. : milestone, 10373,
profiling (9.12 ms) : 8979, 9260
. : milestone, 9120,
tracing (7.985 ms) : 7869, 8100
. : milestone, 7985,
section candidate
no_agent (4.364 ms) : 4313, 4414
. : milestone, 4364,
iast (9.301 ms) : 9147, 9455
. : milestone, 9301,
iast_FULL (14.227 ms) : 13937, 14516
. : milestone, 14227,
iast_GLOBAL (10.175 ms) : 9997, 10353
. : milestone, 10175,
profiling (8.592 ms) : 8460, 8724
. : milestone, 8592,
tracing (7.784 ms) : 7674, 7894
. : milestone, 7784,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.54.0-SNAPSHOT~0e9b72482d, baseline=1.54.0-SNAPSHOT~03d997e2fd
dateFormat X
axisFormat %s
section baseline
no_agent (36.73 ms) : 36439, 37021
. : milestone, 36730,
appsec (49.243 ms) : 48807, 49679
. : milestone, 49243,
code_origins (45.284 ms) : 44900, 45668
. : milestone, 45284,
iast (46.48 ms) : 46066, 46893
. : milestone, 46480,
profiling (49.41 ms) : 48957, 49863
. : milestone, 49410,
tracing (43.371 ms) : 43016, 43727
. : milestone, 43371,
section candidate
no_agent (38.111 ms) : 37803, 38419
. : milestone, 38111,
appsec (48.055 ms) : 47620, 48490
. : milestone, 48055,
code_origins (44.519 ms) : 44150, 44887
. : milestone, 44519,
iast (45.021 ms) : 44643, 45399
. : milestone, 45021,
profiling (48.627 ms) : 48168, 49087
. : milestone, 48627,
tracing (43.753 ms) : 43380, 44125
. : milestone, 43753,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 2 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.54.0-SNAPSHOT~0e9b72482d, baseline=1.54.0-SNAPSHOT~03d997e2fd
dateFormat X
axisFormat %s
section baseline
no_agent (1.476 ms) : 1465, 1488
. : milestone, 1476,
appsec (3.672 ms) : 3454, 3889
. : milestone, 3672,
iast (2.205 ms) : 2142, 2268
. : milestone, 2205,
iast_GLOBAL (2.244 ms) : 2182, 2307
. : milestone, 2244,
profiling (2.489 ms) : 2319, 2660
. : milestone, 2489,
tracing (2.026 ms) : 1978, 2075
. : milestone, 2026,
section candidate
no_agent (1.477 ms) : 1465, 1488
. : milestone, 1477,
appsec (3.663 ms) : 3446, 3880
. : milestone, 3663,
iast (2.205 ms) : 2142, 2268
. : milestone, 2205,
iast_GLOBAL (2.248 ms) : 2185, 2311
. : milestone, 2248,
profiling (2.493 ms) : 2325, 2660
. : milestone, 2493,
tracing (2.019 ms) : 1970, 2068
. : milestone, 2019,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.54.0-SNAPSHOT~0e9b72482d, baseline=1.54.0-SNAPSHOT~03d997e2fd
dateFormat X
axisFormat %s
section baseline
no_agent (15.588 s) : 15588000, 15588000
. : milestone, 15588000,
appsec (14.9 s) : 14900000, 14900000
. : milestone, 14900000,
iast (18.141 s) : 18141000, 18141000
. : milestone, 18141000,
iast_GLOBAL (18.236 s) : 18236000, 18236000
. : milestone, 18236000,
profiling (15.453 s) : 15453000, 15453000
. : milestone, 15453000,
tracing (14.935 s) : 14935000, 14935000
. : milestone, 14935000,
section candidate
no_agent (15.337 s) : 15337000, 15337000
. : milestone, 15337000,
appsec (15.044 s) : 15044000, 15044000
. : milestone, 15044000,
iast (18.525 s) : 18525000, 18525000
. : milestone, 18525000,
iast_GLOBAL (18.263 s) : 18263000, 18263000
. : milestone, 18263000,
profiling (15.984 s) : 15984000, 15984000
. : milestone, 15984000,
tracing (15.183 s) : 15183000, 15183000
. : milestone, 15183000,
|
Signed-off-by: Pawel Leszczynski <[email protected]>
07c5e27
to
0e9b724
Compare
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
|
||
String sparkAppName = conf.get("spark.app.name", null); | ||
if (sparkAppName != null) { | ||
log.info( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this one be log.debug()
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to cover this change with some test?
@@ -180,7 +181,9 @@ public void setupOpenLineage(DDTraceId traceId) { | |||
"_dd.trace_id:" | |||
+ traceId.toString() | |||
+ ";_dd.ol_intake.emit_spans:false;_dd.ol_service:" | |||
+ sparkServiceName | |||
+ getServiceForOpenLineage(sparkConf, isRunningOnDatabricks) | |||
+ ";_dd.ol_intake.base_hash:" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for adding that, but actually given that you support also container tags, it would be better to skip the base hash and add directly the process tags .
These are currently enabled for jvm 21 and will be enabled by default on next version
What Does This Do
Fix service name tagging in OpenLineage events
Currently, the
ol_service
tag in OpenLineage events is derived from thesparkServiceName
property, which only becomes available after OpenLineage instrumentation. This delay causes events to miss the service name, making backend correlation difficult.This PR ensures that OpenLineage events always contain a service name:
spark.app.name
is used as a fallback.This serves as a short-term solution. For the long term, the PR also introduces the
_dd.ol_intake.base_hash
tag, which backend systems can later leverage for robust service mapping.Fix missing output statistics in OpenLineage events
OpenLineage output statistics depend on
onTask
events emitted by the Spark listener. The tracer instruments the OpenLineage listener, but currently it does not handleonTaskEnd
correctly—the method returns without invoking the OpenLineage listener. As a result,outputStatistics
are absent from OL events.This PR addresses the issue by ensuring that
onTaskEnd
properly updates task metrics via the OpenLineage listener. The method is lightweight, as it only updates counters for task metrics.Motivation
Additional Notes
Contributor Checklist
type:
and (comp:
orinst:
) labels in addition to any usefull labelsclose
,fix
or any linking keywords when referencing an issue.Use
solves
instead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]