Provide optimized writers for OpenTelemetry's "metrics.proto" wire protocol#10983
Open
Provide optimized writers for OpenTelemetry's "metrics.proto" wire protocol#10983
Conversation
7b895a0 to
3d5747c
Compare
3d5747c to
9a0b845
Compare
instead just create a small prefix and re-use the resource chunk as-is
BenchmarksStartupParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 59 metrics, 11 unstable metrics.
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.61.0-SNAPSHOT~77c6674a08, baseline=1.61.0-SNAPSHOT~1abe140bde
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.058 s) : 0, 1057854
Total [baseline] (11.008 s) : 0, 11008337
Agent [candidate] (1.065 s) : 0, 1065243
Total [candidate] (11.051 s) : 0, 11051456
section appsec
Agent [baseline] (1.245 s) : 0, 1244823
Total [baseline] (11.112 s) : 0, 11111655
Agent [candidate] (1.247 s) : 0, 1247281
Total [candidate] (11.171 s) : 0, 11170697
section iast
Agent [baseline] (1.227 s) : 0, 1227260
Total [baseline] (11.239 s) : 0, 11239211
Agent [candidate] (1.245 s) : 0, 1244995
Total [candidate] (11.333 s) : 0, 11333000
section profiling
Agent [baseline] (1.184 s) : 0, 1184327
Total [baseline] (11.009 s) : 0, 11008855
Agent [candidate] (1.197 s) : 0, 1197129
Total [candidate] (11.163 s) : 0, 11162781
gantt
title petclinic - break down per module: candidate=1.61.0-SNAPSHOT~77c6674a08, baseline=1.61.0-SNAPSHOT~1abe140bde
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.197 ms) : 0, 1197
crashtracking [candidate] (1.213 ms) : 0, 1213
BytebuddyAgent [baseline] (630.143 ms) : 0, 630143
BytebuddyAgent [candidate] (633.469 ms) : 0, 633469
AgentMeter [baseline] (29.416 ms) : 0, 29416
AgentMeter [candidate] (29.558 ms) : 0, 29558
GlobalTracer [baseline] (256.894 ms) : 0, 256894
GlobalTracer [candidate] (257.747 ms) : 0, 257747
AppSec [baseline] (31.762 ms) : 0, 31762
AppSec [candidate] (31.989 ms) : 0, 31989
Debugger [baseline] (60.347 ms) : 0, 60347
Debugger [candidate] (60.543 ms) : 0, 60543
Remote Config [baseline] (599.339 µs) : 0, 599
Remote Config [candidate] (592.368 µs) : 0, 592
Telemetry [baseline] (7.988 ms) : 0, 7988
Telemetry [candidate] (8.88 ms) : 0, 8880
Flare Poller [baseline] (3.507 ms) : 0, 3507
Flare Poller [candidate] (5.065 ms) : 0, 5065
section appsec
crashtracking [baseline] (1.201 ms) : 0, 1201
crashtracking [candidate] (1.191 ms) : 0, 1191
BytebuddyAgent [baseline] (657.911 ms) : 0, 657911
BytebuddyAgent [candidate] (659.147 ms) : 0, 659147
AgentMeter [baseline] (12.079 ms) : 0, 12079
AgentMeter [candidate] (12.148 ms) : 0, 12148
GlobalTracer [baseline] (257.322 ms) : 0, 257322
GlobalTracer [candidate] (258.089 ms) : 0, 258089
AppSec [baseline] (177.311 ms) : 0, 177311
AppSec [candidate] (177.42 ms) : 0, 177420
Debugger [baseline] (66.152 ms) : 0, 66152
Debugger [candidate] (66.373 ms) : 0, 66373
Remote Config [baseline] (626.208 µs) : 0, 626
Remote Config [candidate] (624.831 µs) : 0, 625
Telemetry [baseline] (8.34 ms) : 0, 8340
Telemetry [candidate] (8.356 ms) : 0, 8356
Flare Poller [baseline] (3.59 ms) : 0, 3590
Flare Poller [candidate] (3.588 ms) : 0, 3588
IAST [baseline] (24.096 ms) : 0, 24096
IAST [candidate] (24.14 ms) : 0, 24140
section iast
crashtracking [baseline] (1.185 ms) : 0, 1185
crashtracking [candidate] (1.208 ms) : 0, 1208
BytebuddyAgent [baseline] (795.814 ms) : 0, 795814
BytebuddyAgent [candidate] (808.79 ms) : 0, 808790
AgentMeter [baseline] (11.394 ms) : 0, 11394
AgentMeter [candidate] (11.929 ms) : 0, 11929
GlobalTracer [baseline] (246.907 ms) : 0, 246907
GlobalTracer [candidate] (249.534 ms) : 0, 249534
AppSec [baseline] (26.489 ms) : 0, 26489
AppSec [candidate] (27.017 ms) : 0, 27017
Debugger [baseline] (70.311 ms) : 0, 70311
Debugger [candidate] (71.311 ms) : 0, 71311
Remote Config [baseline] (532.091 µs) : 0, 532
Remote Config [candidate] (533.83 µs) : 0, 534
Telemetry [baseline] (9.763 ms) : 0, 9763
Telemetry [candidate] (9.228 ms) : 0, 9228
Flare Poller [baseline] (3.571 ms) : 0, 3571
Flare Poller [candidate] (3.397 ms) : 0, 3397
IAST [baseline] (25.307 ms) : 0, 25307
IAST [candidate] (25.701 ms) : 0, 25701
section profiling
crashtracking [baseline] (1.179 ms) : 0, 1179
crashtracking [candidate] (1.179 ms) : 0, 1179
BytebuddyAgent [baseline] (684.017 ms) : 0, 684017
BytebuddyAgent [candidate] (690.976 ms) : 0, 690976
AgentMeter [baseline] (9.021 ms) : 0, 9021
AgentMeter [candidate] (9.095 ms) : 0, 9095
GlobalTracer [baseline] (215.175 ms) : 0, 215175
GlobalTracer [candidate] (217.177 ms) : 0, 217177
AppSec [baseline] (32.337 ms) : 0, 32337
AppSec [candidate] (32.691 ms) : 0, 32691
Debugger [baseline] (65.946 ms) : 0, 65946
Debugger [candidate] (65.891 ms) : 0, 65891
Remote Config [baseline] (572.748 µs) : 0, 573
Remote Config [candidate] (578.667 µs) : 0, 579
Telemetry [baseline] (7.798 ms) : 0, 7798
Telemetry [candidate] (8.726 ms) : 0, 8726
Flare Poller [baseline] (3.548 ms) : 0, 3548
Flare Poller [candidate] (3.602 ms) : 0, 3602
ProfilingAgent [baseline] (93.898 ms) : 0, 93898
ProfilingAgent [candidate] (95.654 ms) : 0, 95654
Profiling [baseline] (94.445 ms) : 0, 94445
Profiling [candidate] (96.22 ms) : 0, 96220
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.61.0-SNAPSHOT~77c6674a08, baseline=1.61.0-SNAPSHOT~1abe140bde
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.056 s) : 0, 1055973
Total [baseline] (8.867 s) : 0, 8867290
Agent [candidate] (1.057 s) : 0, 1056969
Total [candidate] (8.853 s) : 0, 8852575
section iast
Agent [baseline] (1.236 s) : 0, 1236201
Total [baseline] (9.57 s) : 0, 9570414
Agent [candidate] (1.242 s) : 0, 1242156
Total [candidate] (9.619 s) : 0, 9619021
gantt
title insecure-bank - break down per module: candidate=1.61.0-SNAPSHOT~77c6674a08, baseline=1.61.0-SNAPSHOT~1abe140bde
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.199 ms) : 0, 1199
crashtracking [candidate] (1.191 ms) : 0, 1191
BytebuddyAgent [baseline] (629.083 ms) : 0, 629083
BytebuddyAgent [candidate] (628.262 ms) : 0, 628262
AgentMeter [baseline] (29.495 ms) : 0, 29495
AgentMeter [candidate] (29.306 ms) : 0, 29306
GlobalTracer [baseline] (256.126 ms) : 0, 256126
GlobalTracer [candidate] (256.591 ms) : 0, 256591
AppSec [baseline] (31.755 ms) : 0, 31755
AppSec [candidate] (31.717 ms) : 0, 31717
Debugger [baseline] (59.53 ms) : 0, 59530
Debugger [candidate] (59.334 ms) : 0, 59334
Remote Config [baseline] (583.708 µs) : 0, 584
Remote Config [candidate] (642.822 µs) : 0, 643
Telemetry [baseline] (7.942 ms) : 0, 7942
Telemetry [candidate] (8.017 ms) : 0, 8017
Flare Poller [baseline] (4.24 ms) : 0, 4240
Flare Poller [candidate] (5.898 ms) : 0, 5898
section iast
crashtracking [baseline] (1.208 ms) : 0, 1208
crashtracking [candidate] (1.198 ms) : 0, 1198
BytebuddyAgent [baseline] (802.473 ms) : 0, 802473
BytebuddyAgent [candidate] (809.233 ms) : 0, 809233
AgentMeter [baseline] (11.652 ms) : 0, 11652
AgentMeter [candidate] (11.801 ms) : 0, 11801
GlobalTracer [baseline] (248.471 ms) : 0, 248471
GlobalTracer [candidate] (248.777 ms) : 0, 248777
AppSec [baseline] (26.839 ms) : 0, 26839
AppSec [candidate] (26.671 ms) : 0, 26671
Debugger [baseline] (68.57 ms) : 0, 68570
Debugger [candidate] (67.159 ms) : 0, 67159
Remote Config [baseline] (547.627 µs) : 0, 548
Remote Config [candidate] (514.179 µs) : 0, 514
Telemetry [baseline] (10.741 ms) : 0, 10741
Telemetry [candidate] (11.315 ms) : 0, 11315
Flare Poller [baseline] (3.875 ms) : 0, 3875
Flare Poller [candidate] (3.811 ms) : 0, 3811
IAST [baseline] (25.631 ms) : 0, 25631
IAST [candidate] (25.362 ms) : 0, 25362
LoadParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 19 metrics, 16 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~77c6674a08, baseline=1.61.0-SNAPSHOT~1abe140bde
dateFormat X
axisFormat %s
section baseline
no_agent (1.193 ms) : 1182, 1205
. : milestone, 1193,
iast (3.232 ms) : 3188, 3276
. : milestone, 3232,
iast_FULL (5.848 ms) : 5790, 5906
. : milestone, 5848,
iast_GLOBAL (3.82 ms) : 3751, 3889
. : milestone, 3820,
profiling (2.055 ms) : 2036, 2073
. : milestone, 2055,
tracing (1.827 ms) : 1811, 1843
. : milestone, 1827,
section candidate
no_agent (1.191 ms) : 1179, 1202
. : milestone, 1191,
iast (3.208 ms) : 3164, 3252
. : milestone, 3208,
iast_FULL (5.693 ms) : 5636, 5749
. : milestone, 5693,
iast_GLOBAL (3.558 ms) : 3500, 3616
. : milestone, 3558,
profiling (2.08 ms) : 2061, 2099
. : milestone, 2080,
tracing (1.767 ms) : 1752, 1782
. : milestone, 1767,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~77c6674a08, baseline=1.61.0-SNAPSHOT~1abe140bde
dateFormat X
axisFormat %s
section baseline
no_agent (18.033 ms) : 17849, 18216
. : milestone, 18033,
appsec (18.42 ms) : 18236, 18604
. : milestone, 18420,
code_origins (17.779 ms) : 17600, 17959
. : milestone, 17779,
iast (17.464 ms) : 17293, 17636
. : milestone, 17464,
profiling (18.766 ms) : 18580, 18952
. : milestone, 18766,
tracing (17.635 ms) : 17459, 17812
. : milestone, 17635,
section candidate
no_agent (17.302 ms) : 17130, 17474
. : milestone, 17302,
appsec (18.493 ms) : 18306, 18681
. : milestone, 18493,
code_origins (17.738 ms) : 17561, 17915
. : milestone, 17738,
iast (18.096 ms) : 17913, 18280
. : milestone, 18096,
profiling (18.658 ms) : 18473, 18844
. : milestone, 18658,
tracing (17.648 ms) : 17473, 17823
. : milestone, 17648,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~77c6674a08, baseline=1.61.0-SNAPSHOT~1abe140bde
dateFormat X
axisFormat %s
section baseline
no_agent (1.467 ms) : 1455, 1478
. : milestone, 1467,
appsec (2.568 ms) : 2510, 2626
. : milestone, 2568,
iast (2.252 ms) : 2183, 2321
. : milestone, 2252,
iast_GLOBAL (2.296 ms) : 2226, 2366
. : milestone, 2296,
profiling (2.089 ms) : 2033, 2144
. : milestone, 2089,
tracing (2.053 ms) : 1999, 2107
. : milestone, 2053,
section candidate
no_agent (1.47 ms) : 1458, 1481
. : milestone, 1470,
appsec (3.745 ms) : 3527, 3964
. : milestone, 3745,
iast (2.249 ms) : 2180, 2319
. : milestone, 2249,
iast_GLOBAL (2.289 ms) : 2220, 2359
. : milestone, 2289,
profiling (2.099 ms) : 2042, 2155
. : milestone, 2099,
tracing (2.058 ms) : 2004, 2111
. : milestone, 2058,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~77c6674a08, baseline=1.61.0-SNAPSHOT~1abe140bde
dateFormat X
axisFormat %s
section baseline
no_agent (15.448 s) : 15448000, 15448000
. : milestone, 15448000,
appsec (14.74 s) : 14740000, 14740000
. : milestone, 14740000,
iast (18.152 s) : 18152000, 18152000
. : milestone, 18152000,
iast_GLOBAL (17.675 s) : 17675000, 17675000
. : milestone, 17675000,
profiling (14.981 s) : 14981000, 14981000
. : milestone, 14981000,
tracing (14.831 s) : 14831000, 14831000
. : milestone, 14831000,
section candidate
no_agent (14.907 s) : 14907000, 14907000
. : milestone, 14907000,
appsec (14.617 s) : 14617000, 14617000
. : milestone, 14617000,
iast (18.274 s) : 18274000, 18274000
. : milestone, 18274000,
iast_GLOBAL (17.694 s) : 17694000, 17694000
. : milestone, 17694000,
profiling (14.931 s) : 14931000, 14931000
. : milestone, 14931000,
tracing (14.654 s) : 14654000, 14654000
. : milestone, 14654000,
|
amarziali
approved these changes
Mar 27, 2026
Contributor
amarziali
left a comment
There was a problem hiding this comment.
Looks good. There are few rounding that should be anyway not a problem since they represent integer quantities
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This Do
Uses a single temporary buffer to prepare message chunks at different nesting levels (resource / scope / metric)
First we chunk all data points for a given metric. Once the metric is complete we add the first part of the metric message and its chunked data points to the scoped chunks. Once the scope is complete we add the first part of the scoped metrics message and all its chunks (metric messages and data points) to the payload. Once all the metrics data has been chunked we add the enclosing resource metrics message to the start of the payload.
Motivation
Avoids need to use full protobuf library while keeping intermediate array creation to a minimum.
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]
Note: Once your PR is ready to merge, add it to the merge queue by commenting
/merge./merge -ccancels the queue request./merge -f --reason "reason"skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.