Skip to content

Implement HTTP Endpoint Inference for Trace Resource Renaming (RFC-1051) #10393

Merged
jandro996 merged 6 commits intomasterfrom
alejandro.gonzalez/add-apm-trace-metrics-tags
Feb 5, 2026
Merged

Implement HTTP Endpoint Inference for Trace Resource Renaming (RFC-1051) #10393
jandro996 merged 6 commits intomasterfrom
alejandro.gonzalez/add-apm-trace-metrics-tags

Conversation

@jandro996
Copy link
Member

@jandro996 jandro996 commented Jan 16, 2026

What Does This Do

This PR implements automatic HTTP endpoint inference to improve trace resource naming and reduce cardinality in APM metrics. When http.route is unavailable or unreliable, the tracer now computes a simplified endpoint from the URL path by replacing dynamic segments (IDs, UUIDs, long strings) with standardized placeholders.

Changes

  1. Endpoint Resolution & Simplification
  • EndpointResolver: Determines whether to use http.route or compute endpoint from URL
    • Validates route eligibility (discards catch-all patterns like * and /)
    • Falls back to URL-based computation when route is missing or invalid
  • EndpointSimplifier: Extracts and simplifies URL paths using pattern matching
    • Limits to first 8 path segments to prevent cardinality explosion
    • Applies regex patterns in order: INTEGER → INT_ID → HEX → HEX_ID → STRING
  • SegmentPattern: Defines regex patterns for common parameter types
    • {param:int}, {param:int_id}, {param:hex}, {param:hex_id}, {param:str}
  1. Trace Processing
  • HttpEndpointPostProcessor: Post-processes HTTP spans to update resource names
    • Runs in eager processing chain before metrics aggregation
    • Tags spans with http.endpoint when endpoint is computed (not when using route)
    • Updates span resource name to {METHOD} {endpoint}
  1. Metrics Enrichment
  • MetricKey: Enriched aggregation key with httpMethod and httpEndpoint fields
    • Enables proper metric aggregation by HTTP method and endpoint
    • Empty string used when tags are missing
  • ConflatingMetricsAggregator: Extracts http.method and http.endpoint tags from spans
  • SerializingMetricWriter: Serializes HTTPMethod and HTTPEndpoint fields in stats buckets
  1. Configuration & Activation
  • DD_TRACE_RESOURCE_RENAMING_ENABLED: Main feature flag
    • Default: disabled unless AppSec is explicitly enabled (DD_APPSEC_ENABLED=true)
    • When AppSec is inactive (default), feature remains disabled
    • Can be explicitly set to override default behavior
  • DD_TRACE_RESOURCE_RENAMING_ALWAYS_SIMPLIFIED_ENDPOINT: Testing flag
    • Forces endpoint computation even when http.route is available
    • Useful for comparing tracer inference with backend inference

Motivation

RFC

Additional Notes

Confirmed, it passes the ST

Contributor Checklist

Jira ticket: APPSEC-58611

@jandro996 jandro996 added type: enhancement Enhancements and improvements tag: do not merge Do not merge changes comp: asm waf Application Security Management (WAF) labels Jan 16, 2026
@pr-commenter
Copy link

pr-commenter bot commented Jan 16, 2026

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master alejandro.gonzalez/add-apm-trace-metrics-tags
git_commit_date 1770290400 1770295115
git_commit_sha 4d7c883 eab007d
release_version 1.60.0-SNAPSHOT~4d7c8834b6 1.60.0-SNAPSHOT~eab007da22
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1770296948 1770296948
ci_job_id 1403697606 1403697606
ci_pipeline_id 94850234 94850234
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-j8d6w27l 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-j8d6w27l 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
module Agent Agent
parent None None

Summary

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

Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.60.0-SNAPSHOT~eab007da22, baseline=1.60.0-SNAPSHOT~4d7c8834b6

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.066 s) : 0, 1066469
Total [baseline] (10.864 s) : 0, 10864134
Agent [candidate] (1.066 s) : 0, 1065948
Total [candidate] (10.767 s) : 0, 10766726
section appsec
Agent [baseline] (1.241 s) : 0, 1240788
Total [baseline] (10.959 s) : 0, 10958997
Agent [candidate] (1.239 s) : 0, 1238538
Total [candidate] (10.971 s) : 0, 10970624
section iast
Agent [baseline] (1.238 s) : 0, 1237978
Total [baseline] (11.163 s) : 0, 11162834
Agent [candidate] (1.233 s) : 0, 1233048
Total [candidate] (11.209 s) : 0, 11208523
section profiling
Agent [baseline] (1.199 s) : 0, 1198596
Total [baseline] (11.077 s) : 0, 11077013
Agent [candidate] (1.191 s) : 0, 1191090
Total [candidate] (10.985 s) : 0, 10984919
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.066 s -
Agent appsec 1.241 s 174.32 ms (16.3%)
Agent iast 1.238 s 171.509 ms (16.1%)
Agent profiling 1.199 s 132.128 ms (12.4%)
Total tracing 10.864 s -
Total appsec 10.959 s 94.863 ms (0.9%)
Total iast 11.163 s 298.7 ms (2.7%)
Total profiling 11.077 s 212.879 ms (2.0%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.066 s -
Agent appsec 1.239 s 172.59 ms (16.2%)
Agent iast 1.233 s 167.101 ms (15.7%)
Agent profiling 1.191 s 125.142 ms (11.7%)
Total tracing 10.767 s -
Total appsec 10.971 s 203.898 ms (1.9%)
Total iast 11.209 s 441.796 ms (4.1%)
Total profiling 10.985 s 218.193 ms (2.0%)
gantt
    title petclinic - break down per module: candidate=1.60.0-SNAPSHOT~eab007da22, baseline=1.60.0-SNAPSHOT~4d7c8834b6

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.181 ms) : 0, 1181
crashtracking [candidate] (1.187 ms) : 0, 1187
BytebuddyAgent [baseline] (628.979 ms) : 0, 628979
BytebuddyAgent [candidate] (628.237 ms) : 0, 628237
AgentMeter [baseline] (28.919 ms) : 0, 28919
AgentMeter [candidate] (28.848 ms) : 0, 28848
GlobalTracer [baseline] (258.148 ms) : 0, 258148
GlobalTracer [candidate] (257.84 ms) : 0, 257840
AppSec [baseline] (33.023 ms) : 0, 33023
AppSec [candidate] (32.646 ms) : 0, 32646
Debugger [baseline] (62.6 ms) : 0, 62600
Debugger [candidate] (62.611 ms) : 0, 62611
Remote Config [baseline] (606.002 µs) : 0, 606
Remote Config [candidate] (610.896 µs) : 0, 611
Telemetry [baseline] (12.209 ms) : 0, 12209
Telemetry [candidate] (13.022 ms) : 0, 13022
Flare Poller [baseline] (5.348 ms) : 0, 5348
Flare Poller [candidate] (5.42 ms) : 0, 5420
section appsec
crashtracking [baseline] (1.185 ms) : 0, 1185
crashtracking [candidate] (1.18 ms) : 0, 1180
BytebuddyAgent [baseline] (659.021 ms) : 0, 659021
BytebuddyAgent [candidate] (657.54 ms) : 0, 657540
AgentMeter [baseline] (11.939 ms) : 0, 11939
AgentMeter [candidate] (11.87 ms) : 0, 11870
GlobalTracer [baseline] (259.115 ms) : 0, 259115
GlobalTracer [candidate] (258.637 ms) : 0, 258637
AppSec [baseline] (167.958 ms) : 0, 167958
AppSec [candidate] (167.66 ms) : 0, 167660
Debugger [baseline] (67.494 ms) : 0, 67494
Debugger [candidate] (67.406 ms) : 0, 67406
Remote Config [baseline] (679.6 µs) : 0, 680
Remote Config [candidate] (665.504 µs) : 0, 666
Telemetry [baseline] (9.159 ms) : 0, 9159
Telemetry [candidate] (9.201 ms) : 0, 9201
Flare Poller [baseline] (3.632 ms) : 0, 3632
Flare Poller [candidate] (3.706 ms) : 0, 3706
IAST [baseline] (25.141 ms) : 0, 25141
IAST [candidate] (25.307 ms) : 0, 25307
section iast
crashtracking [baseline] (1.196 ms) : 0, 1196
crashtracking [candidate] (1.182 ms) : 0, 1182
BytebuddyAgent [baseline] (800.909 ms) : 0, 800909
BytebuddyAgent [candidate] (796.375 ms) : 0, 796375
AgentMeter [baseline] (11.527 ms) : 0, 11527
AgentMeter [candidate] (11.255 ms) : 0, 11255
GlobalTracer [baseline] (248.619 ms) : 0, 248619
GlobalTracer [candidate] (248.679 ms) : 0, 248679
AppSec [baseline] (34.783 ms) : 0, 34783
AppSec [candidate] (33.079 ms) : 0, 33079
Debugger [baseline] (65.598 ms) : 0, 65598
Debugger [candidate] (67.319 ms) : 0, 67319
Remote Config [baseline] (552.709 µs) : 0, 553
Remote Config [candidate] (546.386 µs) : 0, 546
Telemetry [baseline] (8.621 ms) : 0, 8621
Telemetry [candidate] (8.701 ms) : 0, 8701
Flare Poller [baseline] (3.425 ms) : 0, 3425
Flare Poller [candidate] (3.517 ms) : 0, 3517
IAST [baseline] (27.257 ms) : 0, 27257
IAST [candidate] (27.081 ms) : 0, 27081
section profiling
ProfilingAgent [baseline] (99.92 ms) : 0, 99920
ProfilingAgent [candidate] (99.39 ms) : 0, 99390
crashtracking [baseline] (1.219 ms) : 0, 1219
crashtracking [candidate] (1.218 ms) : 0, 1218
BytebuddyAgent [baseline] (686.826 ms) : 0, 686826
BytebuddyAgent [candidate] (682.14 ms) : 0, 682140
AgentMeter [baseline] (8.823 ms) : 0, 8823
AgentMeter [candidate] (8.828 ms) : 0, 8828
GlobalTracer [baseline] (217.003 ms) : 0, 217003
GlobalTracer [candidate] (216.504 ms) : 0, 216504
AppSec [baseline] (32.804 ms) : 0, 32804
AppSec [candidate] (32.407 ms) : 0, 32407
Debugger [baseline] (68.452 ms) : 0, 68452
Debugger [candidate] (67.351 ms) : 0, 67351
Remote Config [baseline] (603.955 µs) : 0, 604
Remote Config [candidate] (613.934 µs) : 0, 614
Telemetry [baseline] (8.849 ms) : 0, 8849
Telemetry [candidate] (8.875 ms) : 0, 8875
Flare Poller [baseline] (3.792 ms) : 0, 3792
Flare Poller [candidate] (3.784 ms) : 0, 3784
Profiling [baseline] (100.499 ms) : 0, 100499
Profiling [candidate] (99.963 ms) : 0, 99963
Loading
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.60.0-SNAPSHOT~eab007da22, baseline=1.60.0-SNAPSHOT~4d7c8834b6

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.07 s) : 0, 1070390
Total [baseline] (8.74 s) : 0, 8739916
Agent [candidate] (1.064 s) : 0, 1063701
Total [candidate] (8.733 s) : 0, 8732660
section iast
Agent [baseline] (1.23 s) : 0, 1230395
Total [baseline] (9.368 s) : 0, 9368388
Agent [candidate] (1.237 s) : 0, 1236515
Total [candidate] (9.352 s) : 0, 9352387
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.07 s -
Agent iast 1.23 s 160.005 ms (14.9%)
Total tracing 8.74 s -
Total iast 9.368 s 628.472 ms (7.2%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.064 s -
Agent iast 1.237 s 172.814 ms (16.2%)
Total tracing 8.733 s -
Total iast 9.352 s 619.727 ms (7.1%)
gantt
    title insecure-bank - break down per module: candidate=1.60.0-SNAPSHOT~eab007da22, baseline=1.60.0-SNAPSHOT~4d7c8834b6

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.212 ms) : 0, 1212
crashtracking [candidate] (1.184 ms) : 0, 1184
BytebuddyAgent [baseline] (631.787 ms) : 0, 631787
BytebuddyAgent [candidate] (628.059 ms) : 0, 628059
AgentMeter [baseline] (28.943 ms) : 0, 28943
AgentMeter [candidate] (28.895 ms) : 0, 28895
GlobalTracer [baseline] (259.356 ms) : 0, 259356
GlobalTracer [candidate] (257.896 ms) : 0, 257896
AppSec [baseline] (33.038 ms) : 0, 33038
AppSec [candidate] (32.982 ms) : 0, 32982
Debugger [baseline] (60.523 ms) : 0, 60523
Debugger [candidate] (60.364 ms) : 0, 60364
Remote Config [baseline] (613.641 µs) : 0, 614
Remote Config [candidate] (621.112 µs) : 0, 621
Telemetry [baseline] (12.288 ms) : 0, 12288
Telemetry [candidate] (13.842 ms) : 0, 13842
Flare Poller [baseline] (6.998 ms) : 0, 6998
Flare Poller [candidate] (4.596 ms) : 0, 4596
section iast
crashtracking [baseline] (1.189 ms) : 0, 1189
crashtracking [candidate] (1.201 ms) : 0, 1201
BytebuddyAgent [baseline] (795.431 ms) : 0, 795431
BytebuddyAgent [candidate] (800.043 ms) : 0, 800043
AgentMeter [baseline] (11.306 ms) : 0, 11306
AgentMeter [candidate] (11.518 ms) : 0, 11518
GlobalTracer [baseline] (247.542 ms) : 0, 247542
GlobalTracer [candidate] (248.278 ms) : 0, 248278
AppSec [baseline] (34.108 ms) : 0, 34108
AppSec [candidate] (34.741 ms) : 0, 34741
Debugger [baseline] (65.745 ms) : 0, 65745
Debugger [candidate] (65.449 ms) : 0, 65449
Remote Config [baseline] (547.055 µs) : 0, 547
Remote Config [candidate] (566.672 µs) : 0, 567
Telemetry [baseline] (8.644 ms) : 0, 8644
Telemetry [candidate] (8.674 ms) : 0, 8674
Flare Poller [baseline] (3.489 ms) : 0, 3489
Flare Poller [candidate] (3.511 ms) : 0, 3511
IAST [baseline] (27.048 ms) : 0, 27048
IAST [candidate] (26.943 ms) : 0, 26943
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master alejandro.gonzalez/add-apm-trace-metrics-tags
git_commit_date 1770290400 1770295115
git_commit_sha 4d7c883 eab007d
release_version 1.60.0-SNAPSHOT~4d7c8834b6 1.60.0-SNAPSHOT~eab007da22
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1770297437 1770297437
ci_job_id 1403697608 1403697608
ci_pipeline_id 94850234 94850234
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-px17gx3w 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-px17gx3w 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

Found 2 performance improvements and 2 performance regressions! Performance is the same for 16 metrics, 16 unstable metrics.

scenario Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p95 Δ mean throughput candidate mean agg_http_req_duration_p50 candidate mean agg_http_req_duration_p95 candidate mean throughput baseline mean agg_http_req_duration_p50 baseline mean agg_http_req_duration_p95 baseline mean throughput
scenario:load:insecure-bank:iast:high_load worse
[+75.438µs; +183.986µs] or [+3.169%; +7.728%]
worse
[+160.552µs; +555.883µs] or [+2.288%; +7.922%]
unstable
[-192.457op/s; +78.270op/s] or [-13.074%; +5.317%]
2.510ms 7.375ms 1414.969op/s 2.381ms 7.017ms 1472.062op/s
scenario:load:petclinic:iast:high_load better
[-1.617ms; -0.796ms] or [-8.791%; -4.329%]
better
[-2.294ms; -1.075ms] or [-7.626%; -3.573%]
unstable
[-8.368op/s; +41.743op/s] or [-3.362%; +16.771%]
17.186ms 28.392ms 265.594op/s 18.393ms 30.076ms 248.906op/s
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.60.0-SNAPSHOT~eab007da22, baseline=1.60.0-SNAPSHOT~4d7c8834b6
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.194 ms) : 1182, 1206
.   : milestone, 1194,
iast (3.107 ms) : 3064, 3149
.   : milestone, 3107,
iast_FULL (5.674 ms) : 5617, 5730
.   : milestone, 5674,
iast_GLOBAL (3.559 ms) : 3495, 3623
.   : milestone, 3559,
profiling (2.169 ms) : 2149, 2189
.   : milestone, 2169,
tracing (1.772 ms) : 1757, 1786
.   : milestone, 1772,
section candidate
no_agent (1.174 ms) : 1163, 1185
.   : milestone, 1174,
iast (3.233 ms) : 3188, 3278
.   : milestone, 3233,
iast_FULL (5.745 ms) : 5688, 5802
.   : milestone, 5745,
iast_GLOBAL (3.507 ms) : 3450, 3564
.   : milestone, 3507,
profiling (2.055 ms) : 2036, 2074
.   : milestone, 2055,
tracing (1.842 ms) : 1827, 1857
.   : milestone, 1842,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.194 ms [1.182 ms, 1.206 ms] -
iast 3.107 ms [3.064 ms, 3.149 ms] 1.913 ms (160.2%)
iast_FULL 5.674 ms [5.617 ms, 5.73 ms] 4.48 ms (375.2%)
iast_GLOBAL 3.559 ms [3.495 ms, 3.623 ms] 2.365 ms (198.1%)
profiling 2.169 ms [2.149 ms, 2.189 ms] 974.735 µs (81.6%)
tracing 1.772 ms [1.757 ms, 1.786 ms] 577.924 µs (48.4%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.174 ms [1.163 ms, 1.185 ms] -
iast 3.233 ms [3.188 ms, 3.278 ms] 2.059 ms (175.4%)
iast_FULL 5.745 ms [5.688 ms, 5.802 ms] 4.571 ms (389.3%)
iast_GLOBAL 3.507 ms [3.45 ms, 3.564 ms] 2.333 ms (198.7%)
profiling 2.055 ms [2.036 ms, 2.074 ms] 880.857 µs (75.0%)
tracing 1.842 ms [1.827 ms, 1.857 ms] 667.734 µs (56.9%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.60.0-SNAPSHOT~eab007da22, baseline=1.60.0-SNAPSHOT~4d7c8834b6
    dateFormat X
    axisFormat %s
section baseline
no_agent (17.899 ms) : 17717, 18082
.   : milestone, 17899,
appsec (18.575 ms) : 18385, 18765
.   : milestone, 18575,
code_origins (17.453 ms) : 17277, 17628
.   : milestone, 17453,
iast (18.753 ms) : 18563, 18943
.   : milestone, 18753,
profiling (18.77 ms) : 18581, 18958
.   : milestone, 18770,
tracing (17.455 ms) : 17284, 17627
.   : milestone, 17455,
section candidate
no_agent (18.206 ms) : 18020, 18392
.   : milestone, 18206,
appsec (18.355 ms) : 18174, 18536
.   : milestone, 18355,
code_origins (17.456 ms) : 17279, 17632
.   : milestone, 17456,
iast (17.569 ms) : 17397, 17742
.   : milestone, 17569,
profiling (18.571 ms) : 18388, 18754
.   : milestone, 18571,
tracing (17.545 ms) : 17367, 17722
.   : milestone, 17545,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 17.899 ms [17.717 ms, 18.082 ms] -
appsec 18.575 ms [18.385 ms, 18.765 ms] 675.609 µs (3.8%)
code_origins 17.453 ms [17.277 ms, 17.628 ms] -446.878 µs (-2.5%)
iast 18.753 ms [18.563 ms, 18.943 ms] 853.342 µs (4.8%)
profiling 18.77 ms [18.581 ms, 18.958 ms] 870.313 µs (4.9%)
tracing 17.455 ms [17.284 ms, 17.627 ms] -444.077 µs (-2.5%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 18.206 ms [18.02 ms, 18.392 ms] -
appsec 18.355 ms [18.174 ms, 18.536 ms] 148.852 µs (0.8%)
code_origins 17.456 ms [17.279 ms, 17.632 ms] -750.334 µs (-4.1%)
iast 17.569 ms [17.397 ms, 17.742 ms] -636.695 µs (-3.5%)
profiling 18.571 ms [18.388 ms, 18.754 ms] 364.834 µs (2.0%)
tracing 17.545 ms [17.367 ms, 17.722 ms] -661.502 µs (-3.6%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master alejandro.gonzalez/add-apm-trace-metrics-tags
git_commit_date 1770290400 1770295115
git_commit_sha 4d7c883 eab007d
release_version 1.60.0-SNAPSHOT~4d7c8834b6 1.60.0-SNAPSHOT~eab007da22
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1770297127 1770297127
ci_job_id 1403697610 1403697610
ci_pipeline_id 94850234 94850234
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-14mim16i 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-14mim16i 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

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

Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.60.0-SNAPSHOT~eab007da22, baseline=1.60.0-SNAPSHOT~4d7c8834b6
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.467 ms) : 1455, 1478
.   : milestone, 1467,
appsec (2.492 ms) : 2436, 2547
.   : milestone, 2492,
iast (2.247 ms) : 2178, 2316
.   : milestone, 2247,
iast_GLOBAL (2.3 ms) : 2230, 2370
.   : milestone, 2300,
profiling (2.1 ms) : 2043, 2157
.   : milestone, 2100,
tracing (2.056 ms) : 2003, 2110
.   : milestone, 2056,
section candidate
no_agent (1.469 ms) : 1457, 1480
.   : milestone, 1469,
appsec (3.768 ms) : 3546, 3989
.   : milestone, 3768,
iast (2.245 ms) : 2176, 2314
.   : milestone, 2245,
iast_GLOBAL (2.296 ms) : 2226, 2365
.   : milestone, 2296,
profiling (2.099 ms) : 2042, 2156
.   : milestone, 2099,
tracing (2.052 ms) : 1999, 2106
.   : milestone, 2052,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.467 ms [1.455 ms, 1.478 ms] -
appsec 2.492 ms [2.436 ms, 2.547 ms] 1.025 ms (69.9%)
iast 2.247 ms [2.178 ms, 2.316 ms] 780.879 µs (53.2%)
iast_GLOBAL 2.3 ms [2.23 ms, 2.37 ms] 833.542 µs (56.8%)
profiling 2.1 ms [2.043 ms, 2.157 ms] 633.694 µs (43.2%)
tracing 2.056 ms [2.003 ms, 2.11 ms] 589.941 µs (40.2%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.469 ms [1.457 ms, 1.48 ms] -
appsec 3.768 ms [3.546 ms, 3.989 ms] 2.299 ms (156.5%)
iast 2.245 ms [2.176 ms, 2.314 ms] 776.64 µs (52.9%)
iast_GLOBAL 2.296 ms [2.226 ms, 2.365 ms] 826.937 µs (56.3%)
profiling 2.099 ms [2.042 ms, 2.156 ms] 630.122 µs (42.9%)
tracing 2.052 ms [1.999 ms, 2.106 ms] 583.672 µs (39.7%)
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.60.0-SNAPSHOT~eab007da22, baseline=1.60.0-SNAPSHOT~4d7c8834b6
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.216 s) : 15216000, 15216000
.   : milestone, 15216000,
appsec (15.043 s) : 15043000, 15043000
.   : milestone, 15043000,
iast (18.419 s) : 18419000, 18419000
.   : milestone, 18419000,
iast_GLOBAL (18.16 s) : 18160000, 18160000
.   : milestone, 18160000,
profiling (14.703 s) : 14703000, 14703000
.   : milestone, 14703000,
tracing (14.625 s) : 14625000, 14625000
.   : milestone, 14625000,
section candidate
no_agent (15.547 s) : 15547000, 15547000
.   : milestone, 15547000,
appsec (14.981 s) : 14981000, 14981000
.   : milestone, 14981000,
iast (17.809 s) : 17809000, 17809000
.   : milestone, 17809000,
iast_GLOBAL (18.072 s) : 18072000, 18072000
.   : milestone, 18072000,
profiling (15.16 s) : 15160000, 15160000
.   : milestone, 15160000,
tracing (14.69 s) : 14690000, 14690000
.   : milestone, 14690000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.216 s [15.216 s, 15.216 s] -
appsec 15.043 s [15.043 s, 15.043 s] -173.0 ms (-1.1%)
iast 18.419 s [18.419 s, 18.419 s] 3.203 s (21.1%)
iast_GLOBAL 18.16 s [18.16 s, 18.16 s] 2.944 s (19.3%)
profiling 14.703 s [14.703 s, 14.703 s] -513.0 ms (-3.4%)
tracing 14.625 s [14.625 s, 14.625 s] -591.0 ms (-3.9%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.547 s [15.547 s, 15.547 s] -
appsec 14.981 s [14.981 s, 14.981 s] -566.0 ms (-3.6%)
iast 17.809 s [17.809 s, 17.809 s] 2.262 s (14.5%)
iast_GLOBAL 18.072 s [18.072 s, 18.072 s] 2.525 s (16.2%)
profiling 15.16 s [15.16 s, 15.16 s] -387.0 ms (-2.5%)
tracing 14.69 s [14.69 s, 14.69 s] -857.0 ms (-5.5%)

@jandro996 jandro996 force-pushed the alejandro.gonzalez/add-apm-trace-metrics-tags branch 2 times, most recently from c8d180b to daa5a49 Compare January 21, 2026 10:49
@jandro996 jandro996 changed the title WIP Implement HTTP Endpoint Inference for Trace Resource Renaming (RFC-1051) Jan 21, 2026
@jandro996 jandro996 removed the tag: do not merge Do not merge changes label Jan 21, 2026
@jandro996 jandro996 marked this pull request as ready for review January 21, 2026 15:42
@jandro996 jandro996 requested review from a team as code owners January 21, 2026 15:42
@jandro996 jandro996 requested review from PerfectSlayer, amarziali, cecile75 and smola and removed request for a team January 21, 2026 15:42
this.isTraceRoot = isTraceRoot;
this.spanKind = null == spanKind ? EMPTY : UTF8BytesString.create(spanKind);
this.peerTags = peerTags == null ? Collections.emptyList() : peerTags;
this.httpMethod = null == httpMethod ? EMPTY : UTF8BytesString.create(httpMethod);
Copy link
Contributor

@amarziali amarziali Jan 21, 2026

Choose a reason for hiding this comment

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

if the feature is opt-in I think you should not add aggregation dimentions for httpMethod and httpEndpoint if disabled otherwise the metrics buckets will change

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! solved in b6fd7f4

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2c46dc2faf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jandro996 jandro996 force-pushed the alejandro.gonzalez/add-apm-trace-metrics-tags branch from c27ecbb to b6fd7f4 Compare January 22, 2026 13:01
@jandro996 jandro996 requested a review from amarziali January 22, 2026 13:56
public static final byte HTTP_404 = 2;
public static final byte HTTP_FRAMEWORK_ROUTE = 3;
public static final byte RPC_COMMAND_NAME = 3;
public static final byte HTTP_SERVER_RESOURCE_RENAMING = 4;
Copy link
Contributor

Choose a reason for hiding this comment

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

should thisbe actually 3 and not 4? Since 4 is for user configured mapping and I'm wondering if this should take always precendence

Copy link
Member Author

Choose a reason for hiding this comment

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

Done! b167fe4

Comment on lines 89 to 90
+ (includeEndpointInHash ? 28_629_151 * this.httpMethod.hashCode() : 0)
+ (includeEndpointInHash ? 923_521 * this.httpEndpoint.hashCode() : 0)
Copy link
Contributor

@amarziali amarziali Jan 26, 2026

Choose a reason for hiding this comment

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

Perhaps just relying in classic nullchecks on the member would have been less error prone? i.e.
+ ? 28_629_151 * (this.httpMethod != null ? this.httpMethod.hashCode() : 0)

Copy link
Member Author

Choose a reason for hiding this comment

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

Done! 87ac261


if (endpoint != null && !endpoint.isEmpty()) {
// Combine method and endpoint into resource name
String resourceName = httpMethod + " " + endpoint;
Copy link
Contributor

Choose a reason for hiding this comment

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

resource names have a cache to avoid creating strings (and also caching UTF byte conversions). Would it be possible to have the same here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you mean this? b6bb012


// Resolve endpoint using EndpointResolver
// Pass unsafeTags directly - it's safe to use at this point since span is finished
String endpoint = endpointResolver.resolveEndpoint(unsafeTags, httpRoute, httpUrl);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering if adding a try-catch-trowable around is worth since this processor runs on the finish code path

Copy link
Member Author

Choose a reason for hiding this comment

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

Done! 8b96d89

@jandro996 jandro996 force-pushed the alejandro.gonzalez/add-apm-trace-metrics-tags branch from b6fd7f4 to 196140a Compare February 3, 2026 08:20
@jandro996
Copy link
Member Author

Thanks a lot for your comments @amarziali!!!

@jandro996 jandro996 requested a review from amarziali February 3, 2026 09:25
Copy link
Contributor

@amarziali amarziali left a comment

Choose a reason for hiding this comment

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

Looks OK. Thanks for having taken into account the previous comments.

@jandro996 jandro996 enabled auto-merge (squash) February 5, 2026 12:39
@jandro996 jandro996 merged commit 4039fd9 into master Feb 5, 2026
545 checks passed
@jandro996 jandro996 deleted the alejandro.gonzalez/add-apm-trace-metrics-tags branch February 5, 2026 13:28
@github-actions github-actions bot added this to the 1.60.0 milestone Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: asm waf Application Security Management (WAF) type: enhancement Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants