Skip to content

Apply the internal limits to custom APM metrics and send the app start trace - #187

Open
turtledreams wants to merge 2 commits into
stagingfrom
apm-metric-limits
Open

turtledreams wants to merge 2 commits into
stagingfrom
apm-metric-limits

Conversation

@turtledreams

@turtledreams turtledreams commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Custom APM metrics now keep to the internal limits, and report_app_start sends its trace.

  • report_trace cut trace.app_metrics, while traces carry apm_metrics, so the metrics were never limited, in the main SDK and for bulk users (since e68bcdd). Custom metrics now keep to max_key_length, max_value_size and max_segmentation_values. The reserved metrics that the server reads (duration, response_time, response_payload_size, response_code, request_payload_size, slow_rendering_frames, frozen_frames) are sent whole and do not count towards the segmentation limit, as the SDK development guide's APM rules say.
  • A trace without apm_metrics is still refused, since the limits are applied after that check. A refused bulk trace now returns the bulk user, as its documentation says.
  • report_app_start has built its trace with app_metrics since it was added in 9f0cbc5, so report_trace refused it and nothing was sent; its start time was also the process uptime instead of a timestamp. It now sends the app_start trace from the process start until the call.

Tests for custom and reserved metrics and a trace without metrics in test/tests_internal_limits.js and test/tests_bulk_fixes.js, and for the app start trace in test/tests_request_queue.js; each fails without its fix. npm test passes locally (253 tests).

#188 builds on this pull request.

report_trace cut trace.app_metrics, while traces carry apm_metrics, so
custom metrics were never limited. Custom metrics now keep to the key,
value and segmentation limits, and the reserved metrics that the server
reads, such as duration and response_time, are sent whole. A trace
without metrics is still refused, and a refused bulk trace returns the
bulk user for chaining.
report_app_start put the duration under app_metrics, so report_trace
refused the trace and nothing was sent. Its start time was also the
process uptime instead of a timestamp. It now sends the "app_start"
trace from the process start until the call, as the APM guide names it.
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

CI report

Check Result Summary
CodeQL ✅ passed
Node.js CI ✅ passed
Public API changelog ✅ passed
Public API changes ✅ passed Public API: No public API change
Public API changes: Public API, No public API change

No public API change.

For a931672, updated 2026-11-17 10:02 UTC. Each check's run page has its full log.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant