mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-10-18 13:51:29 +08:00
197 lines
5.5 KiB
Go
197 lines
5.5 KiB
Go
package inframetrics
|
|
|
|
import v3 "go.signoz.io/signoz/pkg/query-service/model/v3"
|
|
|
|
var PodsTableListQuery = v3.QueryRangeParamsV3{
|
|
CompositeQuery: &v3.CompositeQuery{
|
|
BuilderQueries: map[string]*v3.BuilderQuery{
|
|
// pod cpu utilization
|
|
"A": {
|
|
QueryName: "A",
|
|
DataSource: v3.DataSourceMetrics,
|
|
AggregateAttribute: v3.AttributeKey{
|
|
Key: metricNamesForPods["cpu"],
|
|
DataType: v3.AttributeKeyDataTypeFloat64,
|
|
},
|
|
Temporality: v3.Unspecified,
|
|
Filters: &v3.FilterSet{
|
|
Operator: "AND",
|
|
Items: []v3.FilterItem{},
|
|
},
|
|
GroupBy: []v3.AttributeKey{
|
|
{
|
|
Key: k8sPodUIDAttrKey,
|
|
DataType: v3.AttributeKeyDataTypeString,
|
|
Type: v3.AttributeKeyTypeResource,
|
|
},
|
|
},
|
|
Expression: "A",
|
|
ReduceTo: v3.ReduceToOperatorAvg,
|
|
TimeAggregation: v3.TimeAggregationAvg,
|
|
SpaceAggregation: v3.SpaceAggregationSum,
|
|
Disabled: false,
|
|
},
|
|
// pod cpu request utilization
|
|
"B": {
|
|
QueryName: "B",
|
|
DataSource: v3.DataSourceMetrics,
|
|
AggregateAttribute: v3.AttributeKey{
|
|
Key: metricNamesForPods["cpu_request"],
|
|
DataType: v3.AttributeKeyDataTypeFloat64,
|
|
},
|
|
Temporality: v3.Unspecified,
|
|
Filters: &v3.FilterSet{
|
|
Operator: "AND",
|
|
Items: []v3.FilterItem{},
|
|
},
|
|
GroupBy: []v3.AttributeKey{
|
|
{
|
|
Key: k8sPodUIDAttrKey,
|
|
DataType: v3.AttributeKeyDataTypeString,
|
|
Type: v3.AttributeKeyTypeResource,
|
|
},
|
|
},
|
|
Expression: "B",
|
|
ReduceTo: v3.ReduceToOperatorAvg,
|
|
TimeAggregation: v3.TimeAggregationAvg,
|
|
SpaceAggregation: v3.SpaceAggregationSum,
|
|
Disabled: false,
|
|
},
|
|
// pod cpu limit utilization
|
|
"C": {
|
|
QueryName: "C",
|
|
DataSource: v3.DataSourceMetrics,
|
|
AggregateAttribute: v3.AttributeKey{
|
|
Key: metricNamesForPods["cpu_limit"],
|
|
DataType: v3.AttributeKeyDataTypeFloat64,
|
|
},
|
|
Temporality: v3.Unspecified,
|
|
Filters: &v3.FilterSet{
|
|
Operator: "AND",
|
|
Items: []v3.FilterItem{},
|
|
},
|
|
GroupBy: []v3.AttributeKey{
|
|
{
|
|
Key: k8sPodUIDAttrKey,
|
|
DataType: v3.AttributeKeyDataTypeString,
|
|
Type: v3.AttributeKeyTypeResource,
|
|
},
|
|
},
|
|
Expression: "C",
|
|
ReduceTo: v3.ReduceToOperatorAvg,
|
|
TimeAggregation: v3.TimeAggregationAvg,
|
|
SpaceAggregation: v3.SpaceAggregationSum,
|
|
Disabled: false,
|
|
},
|
|
// pod memory utilization
|
|
"D": {
|
|
QueryName: "D",
|
|
DataSource: v3.DataSourceMetrics,
|
|
AggregateAttribute: v3.AttributeKey{
|
|
Key: metricNamesForPods["memory"],
|
|
DataType: v3.AttributeKeyDataTypeFloat64,
|
|
},
|
|
Temporality: v3.Unspecified,
|
|
Filters: &v3.FilterSet{
|
|
Operator: "AND",
|
|
Items: []v3.FilterItem{},
|
|
},
|
|
GroupBy: []v3.AttributeKey{
|
|
{
|
|
Key: k8sPodUIDAttrKey,
|
|
DataType: v3.AttributeKeyDataTypeString,
|
|
Type: v3.AttributeKeyTypeResource,
|
|
},
|
|
},
|
|
Expression: "D",
|
|
ReduceTo: v3.ReduceToOperatorAvg,
|
|
TimeAggregation: v3.TimeAggregationAvg,
|
|
SpaceAggregation: v3.SpaceAggregationSum,
|
|
Disabled: false,
|
|
},
|
|
// pod memory request utilization
|
|
"E": {
|
|
QueryName: "E",
|
|
DataSource: v3.DataSourceMetrics,
|
|
AggregateAttribute: v3.AttributeKey{
|
|
Key: metricNamesForPods["memory_request"],
|
|
DataType: v3.AttributeKeyDataTypeFloat64,
|
|
},
|
|
Temporality: v3.Unspecified,
|
|
Filters: &v3.FilterSet{
|
|
Operator: "AND",
|
|
Items: []v3.FilterItem{},
|
|
},
|
|
GroupBy: []v3.AttributeKey{
|
|
{
|
|
Key: k8sPodUIDAttrKey,
|
|
DataType: v3.AttributeKeyDataTypeString,
|
|
Type: v3.AttributeKeyTypeResource,
|
|
},
|
|
},
|
|
Expression: "E",
|
|
ReduceTo: v3.ReduceToOperatorAvg,
|
|
TimeAggregation: v3.TimeAggregationAvg,
|
|
SpaceAggregation: v3.SpaceAggregationSum,
|
|
Disabled: false,
|
|
},
|
|
// pod memory limit utilization
|
|
"F": {
|
|
QueryName: "F",
|
|
DataSource: v3.DataSourceMetrics,
|
|
AggregateAttribute: v3.AttributeKey{
|
|
Key: metricNamesForPods["memory_limit"],
|
|
DataType: v3.AttributeKeyDataTypeFloat64,
|
|
},
|
|
Temporality: v3.Unspecified,
|
|
Filters: &v3.FilterSet{
|
|
Operator: "AND",
|
|
Items: []v3.FilterItem{},
|
|
},
|
|
GroupBy: []v3.AttributeKey{
|
|
{
|
|
Key: k8sPodUIDAttrKey,
|
|
DataType: v3.AttributeKeyDataTypeString,
|
|
Type: v3.AttributeKeyTypeResource,
|
|
},
|
|
},
|
|
Expression: "F",
|
|
ReduceTo: v3.ReduceToOperatorAvg,
|
|
TimeAggregation: v3.TimeAggregationAvg,
|
|
SpaceAggregation: v3.SpaceAggregationSum,
|
|
Disabled: false,
|
|
},
|
|
"G": {
|
|
QueryName: "G",
|
|
DataSource: v3.DataSourceMetrics,
|
|
AggregateAttribute: v3.AttributeKey{
|
|
Key: metricNamesForPods["restarts"],
|
|
DataType: v3.AttributeKeyDataTypeFloat64,
|
|
},
|
|
Temporality: v3.Unspecified,
|
|
Filters: &v3.FilterSet{
|
|
Operator: "AND",
|
|
Items: []v3.FilterItem{},
|
|
},
|
|
GroupBy: []v3.AttributeKey{
|
|
{
|
|
Key: k8sPodUIDAttrKey,
|
|
DataType: v3.AttributeKeyDataTypeString,
|
|
Type: v3.AttributeKeyTypeResource,
|
|
},
|
|
},
|
|
Expression: "G",
|
|
ReduceTo: v3.ReduceToOperatorSum,
|
|
TimeAggregation: v3.TimeAggregationAnyLast,
|
|
SpaceAggregation: v3.SpaceAggregationMax,
|
|
Functions: []v3.Function{{Name: v3.FunctionNameRunningDiff}},
|
|
Disabled: false,
|
|
},
|
|
},
|
|
PanelType: v3.PanelTypeTable,
|
|
QueryType: v3.QueryTypeBuilder,
|
|
},
|
|
Version: "v4",
|
|
FormatForWeb: true,
|
|
}
|