mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-16 09:35:54 +08:00
fix: add dashbard names and update logs count in telemetry (#6553)
This commit is contained in:
parent
813cd845f4
commit
f7f8bf1867
@ -2540,7 +2540,7 @@ func (r *ClickHouseReader) GetTotalLogs(ctx context.Context) (uint64, error) {
|
|||||||
|
|
||||||
var totalLogs uint64
|
var totalLogs uint64
|
||||||
|
|
||||||
queryStr := fmt.Sprintf("SELECT count() from %s.%s;", r.logsDB, r.logsTable)
|
queryStr := fmt.Sprintf("SELECT count() from %s.%s;", r.logsDB, r.logsTableName)
|
||||||
r.db.QueryRow(ctx, queryStr).Scan(&totalLogs)
|
r.db.QueryRow(ctx, queryStr).Scan(&totalLogs)
|
||||||
|
|
||||||
return totalLogs, nil
|
return totalLogs, nil
|
||||||
|
@ -472,6 +472,11 @@ func GetDashboardsInfo(ctx context.Context) (*model.DashboardsInfo, error) {
|
|||||||
if isDashboardWithTSV2(dashboard.Data) {
|
if isDashboardWithTSV2(dashboard.Data) {
|
||||||
count = count + 1
|
count = count + 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if dashboardInfo.DashboardsWithTraceChQuery > 0 {
|
||||||
|
dashboardsInfo.DashboardNamesWithTraceChQuery = append(dashboardsInfo.DashboardNamesWithTraceChQuery, dashboardName)
|
||||||
|
}
|
||||||
|
|
||||||
// check if dashboard is a has a log operator with contains
|
// check if dashboard is a has a log operator with contains
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -505,6 +510,8 @@ func isDashboardWithTracesClickhouseQuery(data map[string]interface{}) bool {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// also check if the query is actually active
|
||||||
str := string(jsonData)
|
str := string(jsonData)
|
||||||
result := strings.Contains(str, "signoz_traces.distributed_signoz_index_v2") ||
|
result := strings.Contains(str, "signoz_traces.distributed_signoz_index_v2") ||
|
||||||
strings.Contains(str, "signoz_traces.distributed_signoz_spans") ||
|
strings.Contains(str, "signoz_traces.distributed_signoz_spans") ||
|
||||||
|
@ -658,6 +658,7 @@ type DashboardsInfo struct {
|
|||||||
QueriesWithTSV2 int `json:"queriesWithTSV2"`
|
QueriesWithTSV2 int `json:"queriesWithTSV2"`
|
||||||
DashboardsWithLogsChQuery int `json:"dashboardsWithLogsChQuery"`
|
DashboardsWithLogsChQuery int `json:"dashboardsWithLogsChQuery"`
|
||||||
DashboardsWithTraceChQuery int `json:"dashboardsWithTraceChQuery"`
|
DashboardsWithTraceChQuery int `json:"dashboardsWithTraceChQuery"`
|
||||||
|
DashboardNamesWithTraceChQuery []string `json:"dashboardNamesWithTraceChQuery"`
|
||||||
LogsPanelsWithAttrContainsOp int `json:"logsPanelsWithAttrContainsOp"`
|
LogsPanelsWithAttrContainsOp int `json:"logsPanelsWithAttrContainsOp"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,6 +347,7 @@ func createTelemetry() {
|
|||||||
"dashboardsWithTSV2": dashboardsInfo.QueriesWithTSV2,
|
"dashboardsWithTSV2": dashboardsInfo.QueriesWithTSV2,
|
||||||
"dashboardWithLogsChQuery": dashboardsInfo.DashboardsWithLogsChQuery,
|
"dashboardWithLogsChQuery": dashboardsInfo.DashboardsWithLogsChQuery,
|
||||||
"dashboardWithTraceChQuery": dashboardsInfo.DashboardsWithTraceChQuery,
|
"dashboardWithTraceChQuery": dashboardsInfo.DashboardsWithTraceChQuery,
|
||||||
|
"dashboardNamesWithTraceChQuery": dashboardsInfo.DashboardNamesWithTraceChQuery,
|
||||||
"totalAlerts": alertsInfo.TotalAlerts,
|
"totalAlerts": alertsInfo.TotalAlerts,
|
||||||
"alertsWithTSV2": alertsInfo.AlertsWithTSV2,
|
"alertsWithTSV2": alertsInfo.AlertsWithTSV2,
|
||||||
"logsBasedAlerts": alertsInfo.LogsBasedAlerts,
|
"logsBasedAlerts": alertsInfo.LogsBasedAlerts,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user