SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
fix: logs page crash when special chars present in the value of query (#4408)
Vikrant Gupta79e6699b3750
diff --git a/frontend/src/container/QueryBuilder/filters/QueryBuilderSearch/utils.ts b/frontend/src/container/QueryBuilder/filters/QueryBuilderSearch/utils.tsindex e767550be7..c549a6fd62 100644--- a/frontend/src/container/QueryBuilder/filters/QueryBuilderSearch/utils.ts+++ b/frontend/src/container/QueryBuilder/filters/QueryBuilderSearch/utils.ts@@ -122,8 +122,17 @@ export function replaceStringWithMaxLength(if (lastSearchValue === '') {return `${mainString}${replacementString},`;}+ /**+ * We need to escape the special characters in the lastSearchValue else the+ * new RegExp fails with error range out of order in char class+ */+ const escapedLastSearchValue = lastSearchValue.replace(+ /[-/\\^$*+?.()|[\]{}]/g,+ '\\$&',+ );+const updatedString = mainString.replace(- new RegExp(`${lastSearchValue}(?=[^${lastSearchValue}]*$)`),+ new RegExp(`${escapedLastSearchValue}(?=[^${escapedLastSearchValue}]*$)`),replacementString,);return `${updatedString},`;