Skip to content

Commit df35762

Browse files
authored
search: add panel for ranking to frontend dashboard (sourcegraph#30538)
This adds a new panel "ranking" to the frontend dashboard (see screenshot). The data is based on user clicks we track on the search results page.
1 parent be9a004 commit df35762

File tree

2 files changed

+108
-13
lines changed

2 files changed

+108
-13
lines changed

doc/admin/observability/dashboards.md

Lines changed: 57 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

monitoring/definitions/frontend.go

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,57 @@ func Frontend() *monitoring.Container {
624624
shared.NewProvisioningIndicatorsGroup(containerName, monitoring.ObservableOwnerDevOps, nil),
625625
shared.NewGolangMonitoringGroup(containerName, monitoring.ObservableOwnerDevOps, nil),
626626
shared.NewKubernetesMonitoringGroup(containerName, monitoring.ObservableOwnerDevOps, nil),
627+
{
628+
Title: "Ranking",
629+
Hidden: true,
630+
Rows: []monitoring.Row{
631+
{
632+
{
633+
Name: "mean_position_of_clicked_search_result_6h",
634+
Description: "mean position of clicked search result over 6h",
635+
Query: "sum by (type) (rate(src_search_ranking_result_clicked_sum[6h]))/sum by (type) (rate(src_search_ranking_result_clicked_count[6h]))",
636+
NoAlert: true,
637+
Panel: monitoring.Panel().With(func(o monitoring.Observable, p *sdk.Panel) {
638+
p.GraphPanel.Legend.Current = true
639+
p.GraphPanel.Legend.RightSide = true
640+
p.GraphPanel.Targets = []sdk.Target{{
641+
Expr: o.Query,
642+
LegendFormat: "{{type}}",
643+
}, {
644+
Expr: "sum by (app) (rate(src_search_ranking_result_clicked_sum[6h]))/sum by (app) (rate(src_search_ranking_result_clicked_count[6h]))",
645+
LegendFormat: "all",
646+
}}
647+
p.GraphPanel.Tooltip.Shared = true
648+
}),
649+
Owner: monitoring.ObservableOwnerSearchCore,
650+
Interpretation: "The top-most result on the search results has position 0. Low values are considered better. This metric only tracks top-level items and not individual line matches.",
651+
},
652+
{
653+
Name: "distribution_of_clicked_search_result_type_over_6h_in_percent",
654+
Description: "distribution of clicked search result type over 6h in %",
655+
Query: "round(sum(increase(src_search_ranking_result_clicked_sum{type=\"commit\"}[6h])) / sum (increase(src_search_ranking_result_clicked_sum[6h]))*100)",
656+
NoAlert: true,
657+
Panel: monitoring.Panel().With(func(o monitoring.Observable, p *sdk.Panel) {
658+
p.GraphPanel.Legend.Current = true
659+
p.GraphPanel.Legend.RightSide = true
660+
p.GraphPanel.Targets = []sdk.Target{{
661+
Expr: o.Query,
662+
LegendFormat: "commit",
663+
}, {
664+
Expr: "round(sum(increase(src_search_ranking_result_clicked_sum{type=\"fileMatch\"}[6h])) / sum (increase(src_search_ranking_result_clicked_sum[6h]))*100)",
665+
LegendFormat: "fileMatch",
666+
}, {
667+
Expr: "round(sum(increase(src_search_ranking_result_clicked_sum{type=\"repo\"}[6h])) / sum (increase(src_search_ranking_result_clicked_sum[6h]))*100)",
668+
LegendFormat: "repo",
669+
}}
670+
p.GraphPanel.Tooltip.Shared = true
671+
}),
672+
Owner: monitoring.ObservableOwnerSearchCore,
673+
Interpretation: "The distribution of clicked search results by result type. At every point in time, the values should sum to 100.",
674+
},
675+
},
676+
},
677+
},
627678

628679
{
629680
Title: "Sentinel queries (only on sourcegraph.com)",

0 commit comments

Comments
 (0)