mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 18:51:59 +00:00
221 lines
7.8 KiB
Go
221 lines
7.8 KiB
Go
package shared
|
|
|
|
import "github.com/sourcegraph/sourcegraph/monitoring/monitoring"
|
|
|
|
func (codeIntelligence) NewAutoindexingSummaryGroup(containerName string) monitoring.Group {
|
|
group := monitoring.Group{
|
|
Title: "Codeintel: Autoindexing > Summary",
|
|
Hidden: false,
|
|
Rows: []monitoring.Row{
|
|
{
|
|
monitoring.Observable(NoAlertsOption("none")(Observable{
|
|
Description: "auto-index jobs inserted over 5m",
|
|
Owner: monitoring.ObservableOwnerCodeIntel,
|
|
Query: "sum(increase(src_codeintel_dbstore_indexes_inserted[5m]))",
|
|
NoAlert: true,
|
|
Panel: monitoring.Panel().LegendFormat("inserts"),
|
|
})),
|
|
CodeIntelligence.NewIndexSchedulerGroup(containerName).Rows[0][3],
|
|
},
|
|
},
|
|
}
|
|
|
|
const queueContainerName = "(executor|sourcegraph-code-intel-indexers|executor-batches|frontend|sourcegraph-frontend|worker|sourcegraph-executors)"
|
|
|
|
group.Rows = append(group.Rows, CodeIntelligence.NewExecutorQueueGroup(queueContainerName, "codeintel").Rows...)
|
|
|
|
return group
|
|
}
|
|
|
|
// src_codeintel_autoindexing_total
|
|
// src_codeintel_autoindexing_duration_seconds_bucket
|
|
// src_codeintel_autoindexing_errors_total
|
|
func (codeIntelligence) NewAutoindexingServiceGroup(containerName string) monitoring.Group {
|
|
return Observation.NewGroup(containerName, monitoring.ObservableOwnerCodeIntel, ObservationGroupOptions{
|
|
GroupConstructorOptions: GroupConstructorOptions{
|
|
Namespace: "codeintel",
|
|
DescriptionRoot: "Autoindexing > Service",
|
|
Hidden: true,
|
|
|
|
ObservableConstructorOptions: ObservableConstructorOptions{
|
|
MetricNameRoot: "codeintel_autoindexing",
|
|
MetricDescriptionRoot: "service",
|
|
By: []string{"op"},
|
|
},
|
|
},
|
|
|
|
SharedObservationGroupOptions: SharedObservationGroupOptions{
|
|
Total: NoAlertsOption("none"),
|
|
Duration: NoAlertsOption("none"),
|
|
Errors: NoAlertsOption("none"),
|
|
ErrorRate: NoAlertsOption("none"),
|
|
},
|
|
Aggregate: &SharedObservationGroupOptions{
|
|
Total: NoAlertsOption("none"),
|
|
Duration: NoAlertsOption("none"),
|
|
Errors: NoAlertsOption("none"),
|
|
ErrorRate: NoAlertsOption("none"),
|
|
},
|
|
})
|
|
}
|
|
|
|
// src_codeintel_autoindexing_transport_graphql_total
|
|
// src_codeintel_autoindexing_transport_graphql_duration_seconds_bucket
|
|
// src_codeintel_autoindexing_transport_graphql_errors_total
|
|
func (codeIntelligence) NewAutoindexingGraphQLTransportGroup(containerName string) monitoring.Group {
|
|
return Observation.NewGroup(containerName, monitoring.ObservableOwnerCodeIntel, ObservationGroupOptions{
|
|
GroupConstructorOptions: GroupConstructorOptions{
|
|
Namespace: "codeintel",
|
|
DescriptionRoot: "Autoindexing > GQL transport",
|
|
Hidden: true,
|
|
|
|
ObservableConstructorOptions: ObservableConstructorOptions{
|
|
MetricNameRoot: "codeintel_autoindexing_transport_graphql",
|
|
MetricDescriptionRoot: "resolver",
|
|
By: []string{"op"},
|
|
},
|
|
},
|
|
|
|
SharedObservationGroupOptions: SharedObservationGroupOptions{
|
|
Total: NoAlertsOption("none"),
|
|
Duration: NoAlertsOption("none"),
|
|
Errors: NoAlertsOption("none"),
|
|
ErrorRate: NoAlertsOption("none"),
|
|
},
|
|
Aggregate: &SharedObservationGroupOptions{
|
|
Total: NoAlertsOption("none"),
|
|
Duration: NoAlertsOption("none"),
|
|
Errors: NoAlertsOption("none"),
|
|
ErrorRate: NoAlertsOption("none"),
|
|
},
|
|
})
|
|
}
|
|
|
|
// src_codeintel_autoindexing_store_total
|
|
// src_codeintel_autoindexing_store_duration_seconds_bucket
|
|
// src_codeintel_autoindexing_store_errors_total
|
|
func (codeIntelligence) NewAutoindexingStoreGroup(containerName string) monitoring.Group {
|
|
return Observation.NewGroup(containerName, monitoring.ObservableOwnerCodeIntel, ObservationGroupOptions{
|
|
GroupConstructorOptions: GroupConstructorOptions{
|
|
Namespace: "codeintel",
|
|
DescriptionRoot: "Autoindexing > Store (internal)",
|
|
Hidden: true,
|
|
|
|
ObservableConstructorOptions: ObservableConstructorOptions{
|
|
MetricNameRoot: "codeintel_autoindexing_store",
|
|
MetricDescriptionRoot: "store",
|
|
By: []string{"op"},
|
|
},
|
|
},
|
|
|
|
SharedObservationGroupOptions: SharedObservationGroupOptions{
|
|
Total: NoAlertsOption("none"),
|
|
Duration: NoAlertsOption("none"),
|
|
Errors: NoAlertsOption("none"),
|
|
ErrorRate: NoAlertsOption("none"),
|
|
},
|
|
Aggregate: &SharedObservationGroupOptions{
|
|
Total: NoAlertsOption("none"),
|
|
Duration: NoAlertsOption("none"),
|
|
Errors: NoAlertsOption("none"),
|
|
ErrorRate: NoAlertsOption("none"),
|
|
},
|
|
})
|
|
}
|
|
|
|
// src_codeintel_autoindexing_background_total
|
|
// src_codeintel_autoindexing_background_duration_seconds_bucket
|
|
// src_codeintel_autoindexing_background_errors_total
|
|
func (codeIntelligence) NewAutoindexingBackgroundJobGroup(containerName string) monitoring.Group {
|
|
return Observation.NewGroup(containerName, monitoring.ObservableOwnerCodeIntel, ObservationGroupOptions{
|
|
GroupConstructorOptions: GroupConstructorOptions{
|
|
Namespace: "codeintel",
|
|
DescriptionRoot: "Autoindexing > Background jobs (internal)",
|
|
Hidden: true,
|
|
|
|
ObservableConstructorOptions: ObservableConstructorOptions{
|
|
MetricNameRoot: "codeintel_autoindexing_background",
|
|
MetricDescriptionRoot: "background",
|
|
By: []string{"op"},
|
|
},
|
|
},
|
|
|
|
SharedObservationGroupOptions: SharedObservationGroupOptions{
|
|
Total: NoAlertsOption("none"),
|
|
Duration: NoAlertsOption("none"),
|
|
Errors: NoAlertsOption("none"),
|
|
ErrorRate: NoAlertsOption("none"),
|
|
},
|
|
Aggregate: &SharedObservationGroupOptions{
|
|
Total: NoAlertsOption("none"),
|
|
Duration: NoAlertsOption("none"),
|
|
Errors: NoAlertsOption("none"),
|
|
ErrorRate: NoAlertsOption("none"),
|
|
},
|
|
})
|
|
}
|
|
|
|
// src_codeintel_autoindexing_inference_total
|
|
// src_codeintel_autoindexing_inference_duration_seconds_bucket
|
|
// src_codeintel_autoindexing_inference_errors_total
|
|
func (codeIntelligence) NewAutoindexingInferenceServiceGroup(containerName string) monitoring.Group {
|
|
return Observation.NewGroup(containerName, monitoring.ObservableOwnerCodeIntel, ObservationGroupOptions{
|
|
GroupConstructorOptions: GroupConstructorOptions{
|
|
Namespace: "codeintel",
|
|
DescriptionRoot: "Autoindexing > Inference service (internal)",
|
|
Hidden: true,
|
|
|
|
ObservableConstructorOptions: ObservableConstructorOptions{
|
|
MetricNameRoot: "codeintel_autoindexing_inference",
|
|
MetricDescriptionRoot: "service",
|
|
By: []string{"op"},
|
|
},
|
|
},
|
|
|
|
SharedObservationGroupOptions: SharedObservationGroupOptions{
|
|
Total: NoAlertsOption("none"),
|
|
Duration: NoAlertsOption("none"),
|
|
Errors: NoAlertsOption("none"),
|
|
ErrorRate: NoAlertsOption("none"),
|
|
},
|
|
Aggregate: &SharedObservationGroupOptions{
|
|
Total: NoAlertsOption("none"),
|
|
Duration: NoAlertsOption("none"),
|
|
Errors: NoAlertsOption("none"),
|
|
ErrorRate: NoAlertsOption("none"),
|
|
},
|
|
})
|
|
}
|
|
|
|
// src_luasandbox_store_total
|
|
// src_luasandbox_store_duration_seconds_bucket
|
|
// src_luasandbox_store_errors_total
|
|
func (codeIntelligence) NewLuasandboxServiceGroup(containerName string) monitoring.Group {
|
|
return Observation.NewGroup(containerName, monitoring.ObservableOwnerCodeIntel, ObservationGroupOptions{
|
|
GroupConstructorOptions: GroupConstructorOptions{
|
|
Namespace: "codeintel",
|
|
DescriptionRoot: "Luasandbox service",
|
|
Hidden: true,
|
|
|
|
ObservableConstructorOptions: ObservableConstructorOptions{
|
|
MetricNameRoot: "luasandbox",
|
|
MetricDescriptionRoot: "service",
|
|
By: []string{"op"},
|
|
},
|
|
},
|
|
|
|
SharedObservationGroupOptions: SharedObservationGroupOptions{
|
|
Total: NoAlertsOption("none"),
|
|
Duration: NoAlertsOption("none"),
|
|
Errors: NoAlertsOption("none"),
|
|
ErrorRate: NoAlertsOption("none"),
|
|
},
|
|
Aggregate: &SharedObservationGroupOptions{
|
|
Total: NoAlertsOption("none"),
|
|
Duration: NoAlertsOption("none"),
|
|
Errors: NoAlertsOption("none"),
|
|
ErrorRate: NoAlertsOption("none"),
|
|
},
|
|
})
|
|
}
|