Repository navigation
Add opt-in search performance telemetry - #149
Merged
Merged
Conversation
jdaigneau5
approved these changes
Sep 8, 2026
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.
Summary
Add disabled-by-default, aggregate performance telemetry for
/searchso controlled load tests can distinguish OpenSearch execution time from transport delay, application-side semantic filtering, and Node.js process pressure.The telemetry emits one structured
search_performance_summaryJSON event per active interval. It does not record request bodies, filter values, credentials, or returned records.Why This Is Needed
External Artillery, ALB, ECS, and OpenSearch metrics show when latency or errors increase, but they do not identify where an individual Search API process spends its time. This change adds the missing application-side evidence needed to correlate:
tookvalueThis is diagnostic instrumentation rather than a permanent metrics backend. It writes aggregate events to standard output for collection by the deployment logging system and remains disabled unless explicitly enabled.
Changes
utils/searchPerformanceTelemetry.js,utils/constants.jscontrollers/searchController.jsconfig/default.jsonc,config/custom-environment-variables.jsonc,.env.exampleSearchLogPerformanceTimingsandSearchPerformanceTelemetryIntervalMs. Telemetry defaults to disabled with a 10-second interval and a 1-second minimum.README.mdtook, post-filter time, active requests, and event-loop pressure.utils/searchPerformanceTelemetry.test.js,controllers/searchController.test.js,config/runtime-config.test.jspackage.json,package-lock.jsonqsoverride to6.16.0and the transitive development dependencybrowserslistto4.28.9, resolving two mediumqsalerts and two highbrowserslistalerts.body-parserremains on its already-patched1.20.6release. GitHub will continue reporting default-branch alerts until this change reaches the default branch.