Skip to main content

nodes_query.go

Nodes_query.go - Overview

  1. Overview

This file defines a QueryRangeParamsV3 struct named NodesTableListQuery which encapsulates a composite query for retrieving and displaying node-related metrics in a table format. The query comprises several builder queries for CPU utilization, CPU allocatable, memory utilization, memory allocatable and node conditions.

  1. Detailed Documentation
  • NodesTableListQuery

    • Purpose: Defines a composite query to fetch and display node metrics in a tabular format. It includes individual queries for CPU, memory, and node conditions.
    • Type: v3.QueryRangeParamsV3
    • Fields:
      • CompositeQuery: *v3.CompositeQuery - A composite query containing multiple builder queries.
        • BuilderQueries: map[string]*v3.BuilderQuery - A map of named builder queries. Each query fetches a specific metric:
          • "A": Node CPU utilization.
            • QueryName: "A" - The name of the query.
            • DataSource: v3.DataSourceMetrics - Specifies that the data source is metrics.
            • AggregateAttribute: v3.AttributeKey - Specifies the metric to aggregate (CPU utilization).
              • Key: metricNamesForNodes["cpu"] - The name of the CPU utilization metric.
              • DataType: v3.AttributeKeyDataTypeFloat64 - The data type of the metric.
            • Temporality: v3.Unspecified - Temporality of the metric.
            • Filters: *v3.FilterSet - Filters to apply to the query.
              • Operator: "AND" - The filter operator.
              • Items: []v3.FilterItem{} - An empty slice of filter items.
            • GroupBy: []v3.AttributeKey - Specifies how to group the results.
              • Key: k8sNodeGroupAttrKey - The key to group by (k8s node group).
              • DataType: v3.AttributeKeyDataTypeString - The data type of the key.
              • Type: v3.AttributeKeyTypeResource - The type of attribute key.
            • Expression: "A" - The expression for the query.
            • ReduceTo: v3.ReduceToOperatorAvg - Reduces the results to an average.
            • TimeAggregation: v3.TimeAggregationAvg - Aggregates the metric values over time using average.
            • SpaceAggregation: v3.SpaceAggregationSum - Aggregates the metric values across different space dimensions using sum.
            • Disabled: false - Indicates if the query is disabled.
          • "B": Node CPU allocatable.
            • QueryName: "B" - The name of the query.
            • DataSource: v3.DataSourceMetrics - Specifies that the data source is metrics.
            • AggregateAttribute: v3.AttributeKey - Specifies the metric to aggregate (CPU allocatable).
              • Key: metricNamesForNodes["cpu_allocatable"] - The name of the CPU allocatable metric.
              • DataType: v3.AttributeKeyDataTypeFloat64 - The data type of the metric.
            • Temporality: v3.Unspecified - Temporality of the metric.
            • Filters: *v3.FilterSet - Filters to apply to the query.
              • Operator: "AND" - The filter operator.
              • Items: []v3.FilterItem{} - An empty slice of filter items.
            • GroupBy: []v3.AttributeKey - Specifies how to group the results.
              • Key: k8sNodeGroupAttrKey - The key to group by (k8s node group).
              • DataType: v3.AttributeKeyDataTypeString - The data type of the key.
              • Type: v3.AttributeKeyTypeResource - The type of attribute key.
            • Expression: "B" - The expression for the query.
            • ReduceTo: v3.ReduceToOperatorAvg - Reduces the results to an average.
            • TimeAggregation: v3.TimeAggregationAnyLast - Aggregates the metric values over time by selecting the last available value.
            • SpaceAggregation: v3.SpaceAggregationSum - Aggregates the metric values across different space dimensions using sum.
            • Disabled: false - Indicates if the query is disabled.
          • "C": Node memory utilization.
            • QueryName: "C" - The name of the query.
            • DataSource: v3.DataSourceMetrics - Specifies that the data source is metrics.
            • AggregateAttribute: v3.AttributeKey - Specifies the metric to aggregate (memory utilization).
              • Key: metricNamesForNodes["memory"] - The name of the memory utilization metric.
              • DataType: v3.AttributeKeyDataTypeFloat64 - The data type of the metric.
            • Temporality: v3.Unspecified - Temporality of the metric.
            • Filters: *v3.FilterSet - Filters to apply to the query.
              • Operator: "AND" - The filter operator.
              • Items: []v3.FilterItem{} - An empty slice of filter items.
            • GroupBy: []v3.AttributeKey - Specifies how to group the results.
              • Key: k8sNodeGroupAttrKey - The key to group by (k8s node group).
              • DataType: v3.AttributeKeyDataTypeString - The data type of the key.
              • Type: v3.AttributeKeyTypeResource - The type of attribute key.
            • Expression: "C" - The expression for the query.
            • ReduceTo: v3.ReduceToOperatorAvg - Reduces the results to an average.
            • TimeAggregation: v3.TimeAggregationAvg - Aggregates the metric values over time using average.
            • SpaceAggregation: v3.SpaceAggregationSum - Aggregates the metric values across different space dimensions using sum.
            • Disabled: false - Indicates if the query is disabled.
          • "D": Node memory allocatable.
            • QueryName: "D" - The name of the query.
            • DataSource: v3.DataSourceMetrics - Specifies that the data source is metrics.
            • AggregateAttribute: v3.AttributeKey - Specifies the metric to aggregate (memory allocatable).
              • Key: metricNamesForNodes["memory_allocatable"] - The name of the memory allocatable metric.
              • DataType: v3.AttributeKeyDataTypeFloat64 - The data type of the metric.
            • Temporality: v3.Unspecified - Temporality of the metric.
            • Filters: *v3.FilterSet - Filters to apply to the query.
              • Operator: "AND" - The filter operator.
              • Items: []v3.FilterItem{} - An empty slice of filter items.
            • GroupBy: []v3.AttributeKey - Specifies how to group the results.
              • Key: k8sNodeGroupAttrKey - The key to group by (k8s node group).
              • DataType: v3.AttributeKeyDataTypeString - The data type of the key.
              • Type: v3.AttributeKeyTypeResource - The type of attribute key.
            • Expression: "D" - The expression for the query.
            • ReduceTo: v3.ReduceToOperatorAvg - Reduces the results to an average.
            • TimeAggregation: v3.TimeAggregationAnyLast - Aggregates the metric values over time by selecting the last available value.
            • SpaceAggregation: v3.SpaceAggregationSum - Aggregates the metric values across different space dimensions using sum.
            • Disabled: false - Indicates if the query is disabled.
          • "E": Node conditions - Ready.
            • QueryName: "E" - The name of the query.
            • DataSource: v3.DataSourceMetrics - Specifies that the data source is metrics.
            • AggregateAttribute: v3.AttributeKey - Specifies the metric to aggregate (node condition).
              • Key: metricNamesForNodes["node_condition"] - The name of the node condition metric.
              • DataType: v3.AttributeKeyDataTypeFloat64 - The data type of the metric.
            • Temporality: v3.Unspecified - Temporality of the metric.
            • Filters: *v3.FilterSet - Filters to apply to the query.
              • Operator: "AND" - The filter operator.
              • Items: []v3.FilterItem - A slice of filter items.
                • Key: v3.AttributeKey{Key: "__value"} - The key to filter on.
                • Operator: v3.FilterOperatorEqual - The filter operator.
                • Value: 1 - The value to filter for (Ready condition).
            • GroupBy: []v3.AttributeKey - Specifies how to group the results.
              • Key: k8sNodeGroupAttrKey - The key to group by (k8s node group).
              • DataType: v3.AttributeKeyDataTypeString - The data type of the key.
              • Type: v3.AttributeKeyTypeResource - The type of attribute key.
            • Expression: "E" - The expression for the query.
            • ReduceTo: v3.ReduceToOperatorAvg - Reduces the results to an average.
            • TimeAggregation: v3.TimeAggregationAnyLast - Aggregates the metric values over time by selecting the last available value.
            • SpaceAggregation: v3.SpaceAggregationSum - Aggregates the metric values across different space dimensions using sum.
            • Disabled: false - Indicates if the query is disabled.
          • "F": Node conditions - NotReady.
            • QueryName: "F" - The name of the query.
            • DataSource: v3.DataSourceMetrics - Specifies that the data source is metrics.
            • AggregateAttribute: v3.AttributeKey - Specifies the metric to aggregate (node condition).
              • Key: metricNamesForNodes["node_condition"] - The name of the node condition metric.
              • DataType: v3.AttributeKeyDataTypeFloat64 - The data type of the metric.
            • Temporality: v3.Unspecified - Temporality of the metric.
            • Filters: *v3.FilterSet - Filters to apply to the query.
              • Operator: "AND" - The filter operator.
              • Items: []v3.FilterItem - A slice of filter items.
                • Key: v3.AttributeKey{Key: "__value"} - The key to filter on.
                • Operator: v3.FilterOperatorEqual - The filter operator.
                • Value: 0 - The value to filter for (NotReady condition).
            • GroupBy: []v3.AttributeKey - Specifies how to group the results.
              • Key: k8sNodeGroupAttrKey - The key to group by (k8s node group).
              • DataType: v3.AttributeKeyDataTypeString - The data type of the key.
              • Type: v3.AttributeKeyTypeResource - The type of attribute key.
            • Expression: "F" - The expression for the query.
            • ReduceTo: v3.ReduceToOperatorAvg - Reduces the results to an average.
            • TimeAggregation: v3.TimeAggregationAnyLast - Aggregates the metric values over time by selecting the last available value.
            • SpaceAggregation: v3.SpaceAggregationSum - Aggregates the metric values across different space dimensions using sum.
            • Disabled: false - Indicates if the query is disabled.
        • PanelType: v3.PanelTypeTable - Specifies that the results should be displayed in a table.
        • QueryType: v3.QueryTypeBuilder - Specifies that the query is a builder query.
      • Version: "v4" - The version of the query.
      • FormatForWeb: true - Indicates if the data should be formatted for web display.
  1. Code Examples

Not applicable.

  1. Clarity and Accuracy

The documentation accurately reflects the code.

Include in Getting Started: NO