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
chore: recognize dashboard view page for log_comment (#9084)
Srikanth Chekuricc77b829af6f
diff --git a/pkg/types/ctxtypes/comment.go b/pkg/types/ctxtypes/comment.goindex ad46872f24..0dec6775f3 100644--- a/pkg/types/ctxtypes/comment.go+++ b/pkg/types/ctxtypes/comment.go@@ -14,9 +14,10 @@ var (traceExplorerRegex = regexp.MustCompile(`/traces-explorer(?:\?.*)?$`)metricsExplorerRegex = regexp.MustCompile(`/metrics-explorer/explorer(?:\?.*)?$`)meterRegex = regexp.MustCompile(`/meter(?:/.*)?(?:\?.*)?$`)- dashboardRegex = regexp.MustCompile(`/dashboard/[a-zA-Z0-9\-]+/(new|edit)(?:\?.*)?$`)- dashboardIDRegex = regexp.MustCompile(`/dashboard/([a-f0-9\-]+)/`)- widgetIDRegex = regexp.MustCompile(`widgetId=([a-f0-9\-]+)`)+ dashboardOpenRegex = regexp.MustCompile(`/dashboard/[a-zA-Z0-9\-]+(?:\?.*)?$`)+ dashboardEditRegex = regexp.MustCompile(`/dashboard/[a-zA-Z0-9\-]+/(new|edit)(?:\?.*)?$`)+ dashboardIDRegex = regexp.MustCompile(`/dashboard/([a-zA-Z0-9\-]+)`)+ widgetIDRegex = regexp.MustCompile(`widgetId=([a-zA-Z0-9\-]+)`)ruleRegex = regexp.MustCompile(`/alerts/(new|edit)(?:\?.*)?$`)ruleIDRegex = regexp.MustCompile(`ruleId=(\d+)`))@@ -61,11 +62,12 @@ func CommentFromHTTPRequest(req *http.Request) map[string]string {traceExplorerMatched := traceExplorerRegex.MatchString(referrer)metricsExplorerMatched := metricsExplorerRegex.MatchString(referrer)meterMatched := meterRegex.MatchString(referrer)- dashboardMatched := dashboardRegex.MatchString(referrer)+ dashboardViewMatched := dashboardOpenRegex.MatchString(referrer)+ dashboardEditMatched := dashboardEditRegex.MatchString(referrer)ruleMatched := ruleRegex.MatchString(referrer)switch {- case dashboardMatched:+ case dashboardViewMatched, dashboardEditMatched:comments["module_name"] = "dashboard"case ruleMatched:comments["module_name"] = "rule"@@ -81,7 +83,7 @@ func CommentFromHTTPRequest(req *http.Request) map[string]string {return comments}- if dashboardMatched {+ if dashboardViewMatched || dashboardEditMatched {if matches := dashboardIDRegex.FindStringSubmatch(referrer); len(matches) > 1 {comments["dashboard_id"] = matches[1]}diff --git a/pkg/types/ctxtypes/comment_test.go b/pkg/types/ctxtypes/comment_test.goindex 35803de54f..e5a27eb8a8 100644--- a/pkg/types/ctxtypes/comment_test.go+++ b/pkg/types/ctxtypes/comment_test.go@@ -46,6 +46,11 @@ func TestCommentFromHTTPRequest(t *testing.T) {req: &http.Request{Header: http.Header{"Referer": {"https://signoz.io/dashboard/123/new"}}},expected: map[string]string{"http_path": "/dashboard/123/new", "module_name": "dashboard", "dashboard_id": "123"},},+ {+ name: "DashboardLandingPage",+ req: &http.Request{Header: http.Header{"Referer": {"https://signoz.io/dashboard/01982be0-d67e-7326-8955-2e99720a9f72?relativeTime=30m"}}},+ expected: map[string]string{"http_path": "/dashboard/01982be0-d67e-7326-8955-2e99720a9f72", "module_name": "dashboard", "dashboard_id": "01982be0-d67e-7326-8955-2e99720a9f72"},+ },{name: "Rule",req: &http.Request{Header: http.Header{"Referer": {"https://signoz.io/alerts/new"}}},