mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-17 15:36:48 +00:00
chore: use {k8s.pod/k8s.node/container}.cpu.usage metric for metadata and CPU usage charts (#8398)
This commit is contained in:
parent
8b62c8dced
commit
b1864ee328
@ -51,8 +51,8 @@ export const getClusterMetricsQueryPayload = (
|
|||||||
const getKey = (dotKey: string, underscoreKey: string): string =>
|
const getKey = (dotKey: string, underscoreKey: string): string =>
|
||||||
dotMetricsEnabled ? dotKey : underscoreKey;
|
dotMetricsEnabled ? dotKey : underscoreKey;
|
||||||
const k8sPodCpuUtilizationKey = getKey(
|
const k8sPodCpuUtilizationKey = getKey(
|
||||||
'k8s.pod.cpu.utilization',
|
'k8s.pod.cpu.usage',
|
||||||
'k8s_pod_cpu_utilization',
|
'k8s_pod_cpu_usage',
|
||||||
);
|
);
|
||||||
const k8sNodeAllocatableCpuKey = getKey(
|
const k8sNodeAllocatableCpuKey = getKey(
|
||||||
'k8s.node.allocatable_cpu',
|
'k8s.node.allocatable_cpu',
|
||||||
@ -146,7 +146,7 @@ export const getClusterMetricsQueryPayload = (
|
|||||||
{
|
{
|
||||||
aggregateAttribute: {
|
aggregateAttribute: {
|
||||||
dataType: DataTypes.Float64,
|
dataType: DataTypes.Float64,
|
||||||
id: 'k8s_pod_cpu_utilization--float64--Gauge--true',
|
id: 'k8s_pod_cpu_usage--float64--Gauge--true',
|
||||||
isColumn: true,
|
isColumn: true,
|
||||||
isJSON: false,
|
isJSON: false,
|
||||||
key: k8sPodCpuUtilizationKey,
|
key: k8sPodCpuUtilizationKey,
|
||||||
@ -189,7 +189,7 @@ export const getClusterMetricsQueryPayload = (
|
|||||||
{
|
{
|
||||||
aggregateAttribute: {
|
aggregateAttribute: {
|
||||||
dataType: DataTypes.Float64,
|
dataType: DataTypes.Float64,
|
||||||
id: 'k8s_pod_cpu_utilization--float64--Gauge--true',
|
id: 'k8s_pod_cpu_usage--float64--Gauge--true',
|
||||||
isColumn: true,
|
isColumn: true,
|
||||||
isJSON: false,
|
isJSON: false,
|
||||||
key: k8sPodCpuUtilizationKey,
|
key: k8sPodCpuUtilizationKey,
|
||||||
@ -232,7 +232,7 @@ export const getClusterMetricsQueryPayload = (
|
|||||||
{
|
{
|
||||||
aggregateAttribute: {
|
aggregateAttribute: {
|
||||||
dataType: DataTypes.Float64,
|
dataType: DataTypes.Float64,
|
||||||
id: 'k8s_pod_cpu_utilization--float64--Gauge--true',
|
id: 'k8s_pod_cpu_usage--float64--Gauge--true',
|
||||||
isColumn: true,
|
isColumn: true,
|
||||||
isJSON: false,
|
isJSON: false,
|
||||||
key: k8sPodCpuUtilizationKey,
|
key: k8sPodCpuUtilizationKey,
|
||||||
|
|||||||
@ -33,8 +33,8 @@ export const getDaemonSetMetricsQueryPayload = (
|
|||||||
dotMetricsEnabled: boolean,
|
dotMetricsEnabled: boolean,
|
||||||
): GetQueryResultsProps[] => {
|
): GetQueryResultsProps[] => {
|
||||||
const k8sPodCpuUtilizationKey = dotMetricsEnabled
|
const k8sPodCpuUtilizationKey = dotMetricsEnabled
|
||||||
? 'k8s.pod.cpu.utilization'
|
? 'k8s.pod.cpu.usage'
|
||||||
: 'k8s_pod_cpu_utilization';
|
: 'k8s_pod_cpu_usage';
|
||||||
|
|
||||||
const k8sContainerCpuRequestKey = dotMetricsEnabled
|
const k8sContainerCpuRequestKey = dotMetricsEnabled
|
||||||
? 'k8s.container.cpu_request'
|
? 'k8s.container.cpu_request'
|
||||||
@ -84,7 +84,7 @@ export const getDaemonSetMetricsQueryPayload = (
|
|||||||
{
|
{
|
||||||
aggregateAttribute: {
|
aggregateAttribute: {
|
||||||
dataType: DataTypes.Float64,
|
dataType: DataTypes.Float64,
|
||||||
id: 'k8s_pod_cpu_utilization--float64--Gauge--true',
|
id: 'k8s_pod_cpu_usage--float64--Gauge--true',
|
||||||
isColumn: true,
|
isColumn: true,
|
||||||
isJSON: false,
|
isJSON: false,
|
||||||
key: k8sPodCpuUtilizationKey,
|
key: k8sPodCpuUtilizationKey,
|
||||||
|
|||||||
@ -33,8 +33,8 @@ export const getDeploymentMetricsQueryPayload = (
|
|||||||
dotMetricsEnabled: boolean,
|
dotMetricsEnabled: boolean,
|
||||||
): GetQueryResultsProps[] => {
|
): GetQueryResultsProps[] => {
|
||||||
const k8sPodCpuUtilizationKey = dotMetricsEnabled
|
const k8sPodCpuUtilizationKey = dotMetricsEnabled
|
||||||
? 'k8s.pod.cpu.utilization'
|
? 'k8s.pod.cpu.usage'
|
||||||
: 'k8s_pod_cpu_utilization';
|
: 'k8s_pod_cpu_usage';
|
||||||
|
|
||||||
const k8sContainerCpuRequestKey = dotMetricsEnabled
|
const k8sContainerCpuRequestKey = dotMetricsEnabled
|
||||||
? 'k8s.container.cpu_request'
|
? 'k8s.container.cpu_request'
|
||||||
@ -80,7 +80,7 @@ export const getDeploymentMetricsQueryPayload = (
|
|||||||
{
|
{
|
||||||
aggregateAttribute: {
|
aggregateAttribute: {
|
||||||
dataType: DataTypes.Float64,
|
dataType: DataTypes.Float64,
|
||||||
id: 'k8s_pod_cpu_utilization--float64--Gauge--true',
|
id: 'k8s_pod_cpu_usage--float64--Gauge--true',
|
||||||
isColumn: true,
|
isColumn: true,
|
||||||
isJSON: false,
|
isJSON: false,
|
||||||
key: k8sPodCpuUtilizationKey,
|
key: k8sPodCpuUtilizationKey,
|
||||||
|
|||||||
@ -33,8 +33,8 @@ export const getJobMetricsQueryPayload = (
|
|||||||
dotMetricsEnabled: boolean,
|
dotMetricsEnabled: boolean,
|
||||||
): GetQueryResultsProps[] => {
|
): GetQueryResultsProps[] => {
|
||||||
const k8sPodCpuUtilizationKey = dotMetricsEnabled
|
const k8sPodCpuUtilizationKey = dotMetricsEnabled
|
||||||
? 'k8s.pod.cpu.utilization'
|
? 'k8s.pod.cpu.usage'
|
||||||
: 'k8s_pod_cpu_utilization';
|
: 'k8s_pod_cpu_usage';
|
||||||
const k8sPodMemoryUsageKey = dotMetricsEnabled
|
const k8sPodMemoryUsageKey = dotMetricsEnabled
|
||||||
? 'k8s.pod.memory.usage'
|
? 'k8s.pod.memory.usage'
|
||||||
: 'k8s_pod_memory_usage';
|
: 'k8s_pod_memory_usage';
|
||||||
@ -59,7 +59,7 @@ export const getJobMetricsQueryPayload = (
|
|||||||
{
|
{
|
||||||
aggregateAttribute: {
|
aggregateAttribute: {
|
||||||
dataType: DataTypes.Float64,
|
dataType: DataTypes.Float64,
|
||||||
id: 'k8s_pod_cpu_utilization--float64--Gauge--true',
|
id: 'k8s_pod_cpu_usage--float64--Gauge--true',
|
||||||
isColumn: true,
|
isColumn: true,
|
||||||
isJSON: false,
|
isJSON: false,
|
||||||
key: k8sPodCpuUtilizationKey,
|
key: k8sPodCpuUtilizationKey,
|
||||||
|
|||||||
@ -59,8 +59,8 @@ export const getNamespaceMetricsQueryPayload = (
|
|||||||
const getKey = (dotKey: string, underscoreKey: string): string =>
|
const getKey = (dotKey: string, underscoreKey: string): string =>
|
||||||
dotMetricsEnabled ? dotKey : underscoreKey;
|
dotMetricsEnabled ? dotKey : underscoreKey;
|
||||||
const k8sPodCpuUtilizationKey = getKey(
|
const k8sPodCpuUtilizationKey = getKey(
|
||||||
'k8s.pod.cpu.utilization',
|
'k8s.pod.cpu.usage',
|
||||||
'k8s_pod_cpu_utilization',
|
'k8s_pod_cpu_usage',
|
||||||
);
|
);
|
||||||
const k8sContainerCpuRequestKey = getKey(
|
const k8sContainerCpuRequestKey = getKey(
|
||||||
'k8s.container.cpu_request',
|
'k8s.container.cpu_request',
|
||||||
|
|||||||
@ -59,8 +59,8 @@ export const getNodeMetricsQueryPayload = (
|
|||||||
const getKey = (dotKey: string, underscoreKey: string): string =>
|
const getKey = (dotKey: string, underscoreKey: string): string =>
|
||||||
dotMetricsEnabled ? dotKey : underscoreKey;
|
dotMetricsEnabled ? dotKey : underscoreKey;
|
||||||
const k8sNodeCpuUtilizationKey = getKey(
|
const k8sNodeCpuUtilizationKey = getKey(
|
||||||
'k8s.node.cpu.utilization',
|
'k8s.node.cpu.usage',
|
||||||
'k8s_node_cpu_utilization',
|
'k8s_node_cpu_usage',
|
||||||
);
|
);
|
||||||
|
|
||||||
const k8sNodeAllocatableCpuKey = getKey(
|
const k8sNodeAllocatableCpuKey = getKey(
|
||||||
@ -99,8 +99,8 @@ export const getNodeMetricsQueryPayload = (
|
|||||||
);
|
);
|
||||||
|
|
||||||
const k8sPodCpuUtilizationKey = getKey(
|
const k8sPodCpuUtilizationKey = getKey(
|
||||||
'k8s.pod.cpu.utilization',
|
'k8s.pod.cpu.usage',
|
||||||
'k8s_pod_cpu_utilization',
|
'k8s_pod_cpu_usage',
|
||||||
);
|
);
|
||||||
|
|
||||||
const k8sPodMemoryUsageKey = getKey(
|
const k8sPodMemoryUsageKey = getKey(
|
||||||
@ -147,7 +147,7 @@ export const getNodeMetricsQueryPayload = (
|
|||||||
{
|
{
|
||||||
aggregateAttribute: {
|
aggregateAttribute: {
|
||||||
dataType: DataTypes.Float64,
|
dataType: DataTypes.Float64,
|
||||||
id: 'k8s_node_cpu_utilization--float64--Gauge--true',
|
id: 'k8s_node_cpu_usage--float64--Gauge--true',
|
||||||
isColumn: true,
|
isColumn: true,
|
||||||
isJSON: false,
|
isJSON: false,
|
||||||
key: k8sNodeCpuUtilizationKey,
|
key: k8sNodeCpuUtilizationKey,
|
||||||
@ -276,7 +276,7 @@ export const getNodeMetricsQueryPayload = (
|
|||||||
{
|
{
|
||||||
aggregateAttribute: {
|
aggregateAttribute: {
|
||||||
dataType: DataTypes.Float64,
|
dataType: DataTypes.Float64,
|
||||||
id: 'k8s_node_cpu_utilization--float64--Gauge--true',
|
id: 'k8s_node_cpu_usage--float64--Gauge--true',
|
||||||
isColumn: true,
|
isColumn: true,
|
||||||
isJSON: false,
|
isJSON: false,
|
||||||
key: k8sNodeCpuUtilizationKey,
|
key: k8sNodeCpuUtilizationKey,
|
||||||
@ -319,7 +319,7 @@ export const getNodeMetricsQueryPayload = (
|
|||||||
{
|
{
|
||||||
aggregateAttribute: {
|
aggregateAttribute: {
|
||||||
dataType: DataTypes.Float64,
|
dataType: DataTypes.Float64,
|
||||||
id: 'k8s_node_cpu_utilization--float64--Gauge--true',
|
id: 'k8s_node_cpu_usage--float64--Gauge--true',
|
||||||
isColumn: true,
|
isColumn: true,
|
||||||
isJSON: false,
|
isJSON: false,
|
||||||
key: k8sNodeCpuUtilizationKey,
|
key: k8sNodeCpuUtilizationKey,
|
||||||
@ -729,7 +729,7 @@ export const getNodeMetricsQueryPayload = (
|
|||||||
{
|
{
|
||||||
aggregateAttribute: {
|
aggregateAttribute: {
|
||||||
dataType: DataTypes.Float64,
|
dataType: DataTypes.Float64,
|
||||||
id: 'k8s_node_cpu_utilization--float64--Gauge--true',
|
id: 'k8s_node_cpu_usage--float64--Gauge--true',
|
||||||
isColumn: true,
|
isColumn: true,
|
||||||
isJSON: false,
|
isJSON: false,
|
||||||
key: k8sNodeCpuUtilizationKey,
|
key: k8sNodeCpuUtilizationKey,
|
||||||
@ -1079,7 +1079,7 @@ export const getNodeMetricsQueryPayload = (
|
|||||||
{
|
{
|
||||||
aggregateAttribute: {
|
aggregateAttribute: {
|
||||||
dataType: DataTypes.Float64,
|
dataType: DataTypes.Float64,
|
||||||
id: 'k8s_pod_cpu_utilization--float64--Gauge--true',
|
id: 'k8s_pod_cpu_usage--float64--Gauge--true',
|
||||||
isColumn: true,
|
isColumn: true,
|
||||||
isJSON: false,
|
isJSON: false,
|
||||||
key: k8sPodCpuUtilizationKey,
|
key: k8sPodCpuUtilizationKey,
|
||||||
|
|||||||
@ -72,10 +72,7 @@ export const getPodMetricsQueryPayload = (
|
|||||||
dotMetricsEnabled ? dotKey : underscoreKey;
|
dotMetricsEnabled ? dotKey : underscoreKey;
|
||||||
const k8sContainerNameKey = getKey('k8s.container.name', 'k8s_container_name');
|
const k8sContainerNameKey = getKey('k8s.container.name', 'k8s_container_name');
|
||||||
|
|
||||||
const k8sPodCpuUtilKey = getKey(
|
const k8sPodCpuUtilKey = getKey('k8s.pod.cpu.usage', 'k8s_pod_cpu_usage');
|
||||||
'k8s.pod.cpu.utilization',
|
|
||||||
'k8s_pod_cpu_utilization',
|
|
||||||
);
|
|
||||||
|
|
||||||
const k8sPodCpuReqUtilKey = getKey(
|
const k8sPodCpuReqUtilKey = getKey(
|
||||||
'k8s.pod.cpu_request_utilization',
|
'k8s.pod.cpu_request_utilization',
|
||||||
@ -115,8 +112,8 @@ export const getPodMetricsQueryPayload = (
|
|||||||
);
|
);
|
||||||
|
|
||||||
const containerCpuUtilKey = getKey(
|
const containerCpuUtilKey = getKey(
|
||||||
'container.cpu.utilization',
|
'container.cpu.usage',
|
||||||
'container_cpu_utilization',
|
'container_cpu_usage',
|
||||||
);
|
);
|
||||||
|
|
||||||
const k8sContainerCpuRequestKey = getKey(
|
const k8sContainerCpuRequestKey = getKey(
|
||||||
@ -189,7 +186,7 @@ export const getPodMetricsQueryPayload = (
|
|||||||
{
|
{
|
||||||
aggregateAttribute: {
|
aggregateAttribute: {
|
||||||
dataType: DataTypes.Float64,
|
dataType: DataTypes.Float64,
|
||||||
id: 'k8s_pod_cpu_utilization--float64--Gauge--true',
|
id: 'k8s_pod_cpu_usage--float64--Gauge--true',
|
||||||
isColumn: true,
|
isColumn: true,
|
||||||
isJSON: false,
|
isJSON: false,
|
||||||
key: k8sPodCpuUtilKey,
|
key: k8sPodCpuUtilKey,
|
||||||
@ -245,7 +242,7 @@ export const getPodMetricsQueryPayload = (
|
|||||||
{
|
{
|
||||||
aggregateAttribute: {
|
aggregateAttribute: {
|
||||||
dataType: DataTypes.Float64,
|
dataType: DataTypes.Float64,
|
||||||
id: 'k8s_pod_cpu_utilization--float64--Gauge--true',
|
id: 'k8s_pod_cpu_usage--float64--Gauge--true',
|
||||||
isColumn: true,
|
isColumn: true,
|
||||||
isJSON: false,
|
isJSON: false,
|
||||||
key: k8sPodCpuUtilKey,
|
key: k8sPodCpuUtilKey,
|
||||||
@ -301,7 +298,7 @@ export const getPodMetricsQueryPayload = (
|
|||||||
{
|
{
|
||||||
aggregateAttribute: {
|
aggregateAttribute: {
|
||||||
dataType: DataTypes.Float64,
|
dataType: DataTypes.Float64,
|
||||||
id: 'k8s_pod_cpu_utilization--float64--Gauge--true',
|
id: 'k8s_pod_cpu_usage--float64--Gauge--true',
|
||||||
isColumn: true,
|
isColumn: true,
|
||||||
isJSON: false,
|
isJSON: false,
|
||||||
key: k8sPodCpuUtilKey,
|
key: k8sPodCpuUtilKey,
|
||||||
@ -1570,7 +1567,7 @@ export const getPodMetricsQueryPayload = (
|
|||||||
{
|
{
|
||||||
aggregateAttribute: {
|
aggregateAttribute: {
|
||||||
dataType: DataTypes.Float64,
|
dataType: DataTypes.Float64,
|
||||||
id: 'container_cpu_utilization--float64--Gauge--true',
|
id: 'container_cpu_usage--float64--Gauge--true',
|
||||||
isColumn: true,
|
isColumn: true,
|
||||||
isJSON: false,
|
isJSON: false,
|
||||||
key: containerCpuUtilKey,
|
key: containerCpuUtilKey,
|
||||||
@ -1668,7 +1665,7 @@ export const getPodMetricsQueryPayload = (
|
|||||||
{
|
{
|
||||||
aggregateAttribute: {
|
aggregateAttribute: {
|
||||||
dataType: DataTypes.Float64,
|
dataType: DataTypes.Float64,
|
||||||
id: 'container_cpu_utilization--float64--Gauge--true',
|
id: 'container_cpu_usage--float64--Gauge--true',
|
||||||
isColumn: true,
|
isColumn: true,
|
||||||
isJSON: false,
|
isJSON: false,
|
||||||
key: containerCpuUtilKey,
|
key: containerCpuUtilKey,
|
||||||
|
|||||||
@ -49,8 +49,8 @@ export const getStatefulSetMetricsQueryPayload = (
|
|||||||
const k8sPodNameKey = dotMetricsEnabled ? 'k8s.pod.name' : 'k8s_pod_name';
|
const k8sPodNameKey = dotMetricsEnabled ? 'k8s.pod.name' : 'k8s_pod_name';
|
||||||
|
|
||||||
const k8sPodCpuUtilKey = dotMetricsEnabled
|
const k8sPodCpuUtilKey = dotMetricsEnabled
|
||||||
? 'k8s.pod.cpu.utilization'
|
? 'k8s.pod.cpu.usage'
|
||||||
: 'k8s_pod_cpu_utilization';
|
: 'k8s_pod_cpu_usage';
|
||||||
const k8sContainerCpuRequestKey = dotMetricsEnabled
|
const k8sContainerCpuRequestKey = dotMetricsEnabled
|
||||||
? 'k8s.container.cpu_request'
|
? 'k8s.container.cpu_request'
|
||||||
: 'k8s_container_cpu_request';
|
: 'k8s_container_cpu_request';
|
||||||
|
|||||||
@ -38,28 +38,28 @@ export const K8sCategories = {
|
|||||||
|
|
||||||
export const underscoreMap = {
|
export const underscoreMap = {
|
||||||
[K8sCategory.HOSTS]: 'system_cpu_load_average_15m',
|
[K8sCategory.HOSTS]: 'system_cpu_load_average_15m',
|
||||||
[K8sCategory.PODS]: 'k8s_pod_cpu_utilization',
|
[K8sCategory.PODS]: 'k8s_pod_cpu_usage',
|
||||||
[K8sCategory.NODES]: 'k8s_node_cpu_utilization',
|
[K8sCategory.NODES]: 'k8s_node_cpu_usage',
|
||||||
[K8sCategory.NAMESPACES]: 'k8s_pod_cpu_utilization',
|
[K8sCategory.NAMESPACES]: 'k8s_pod_cpu_usage',
|
||||||
[K8sCategory.CLUSTERS]: 'k8s_node_cpu_utilization',
|
[K8sCategory.CLUSTERS]: 'k8s_node_cpu_usage',
|
||||||
[K8sCategory.DEPLOYMENTS]: 'k8s_pod_cpu_utilization',
|
[K8sCategory.DEPLOYMENTS]: 'k8s_pod_cpu_usage',
|
||||||
[K8sCategory.STATEFULSETS]: 'k8s_pod_cpu_utilization',
|
[K8sCategory.STATEFULSETS]: 'k8s_pod_cpu_usage',
|
||||||
[K8sCategory.DAEMONSETS]: 'k8s_pod_cpu_utilization',
|
[K8sCategory.DAEMONSETS]: 'k8s_pod_cpu_usage',
|
||||||
[K8sCategory.CONTAINERS]: 'k8s_pod_cpu_utilization',
|
[K8sCategory.CONTAINERS]: 'k8s_pod_cpu_usage',
|
||||||
[K8sCategory.JOBS]: 'k8s_job_desired_successful_pods',
|
[K8sCategory.JOBS]: 'k8s_job_desired_successful_pods',
|
||||||
[K8sCategory.VOLUMES]: 'k8s_volume_capacity',
|
[K8sCategory.VOLUMES]: 'k8s_volume_capacity',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const dotMap = {
|
export const dotMap = {
|
||||||
[K8sCategory.HOSTS]: 'system.cpu.load_average.15m',
|
[K8sCategory.HOSTS]: 'system.cpu.load_average.15m',
|
||||||
[K8sCategory.PODS]: 'k8s.pod.cpu.utilization',
|
[K8sCategory.PODS]: 'k8s.pod.cpu.usage',
|
||||||
[K8sCategory.NODES]: 'k8s.node.cpu.utilization',
|
[K8sCategory.NODES]: 'k8s.node.cpu.usage',
|
||||||
[K8sCategory.NAMESPACES]: 'k8s.pod.cpu.utilization',
|
[K8sCategory.NAMESPACES]: 'k8s.pod.cpu.usage',
|
||||||
[K8sCategory.CLUSTERS]: 'k8s.node.cpu.utilization',
|
[K8sCategory.CLUSTERS]: 'k8s.node.cpu.usage',
|
||||||
[K8sCategory.DEPLOYMENTS]: 'k8s.pod.cpu.utilization',
|
[K8sCategory.DEPLOYMENTS]: 'k8s.pod.cpu.usage',
|
||||||
[K8sCategory.STATEFULSETS]: 'k8s.pod.cpu.utilization',
|
[K8sCategory.STATEFULSETS]: 'k8s.pod.cpu.usage',
|
||||||
[K8sCategory.DAEMONSETS]: 'k8s.pod.cpu.utilization',
|
[K8sCategory.DAEMONSETS]: 'k8s.pod.cpu.usage',
|
||||||
[K8sCategory.CONTAINERS]: 'k8s.pod.cpu.utilization',
|
[K8sCategory.CONTAINERS]: 'k8s.pod.cpu.usage',
|
||||||
[K8sCategory.JOBS]: 'k8s.job.desired_successful_pods',
|
[K8sCategory.JOBS]: 'k8s.job.desired_successful_pods',
|
||||||
[K8sCategory.VOLUMES]: 'k8s.volume.capacity',
|
[K8sCategory.VOLUMES]: 'k8s.volume.capacity',
|
||||||
};
|
};
|
||||||
@ -96,8 +96,8 @@ export function GetPodsQuickFiltersConfig(
|
|||||||
|
|
||||||
// Define aggregate attribute (metric) name
|
// Define aggregate attribute (metric) name
|
||||||
const cpuUtilizationMetric = dotMetricsEnabled
|
const cpuUtilizationMetric = dotMetricsEnabled
|
||||||
? 'k8s.pod.cpu.utilization'
|
? 'k8s.pod.cpu.usage'
|
||||||
: 'k8s_pod_cpu_utilization';
|
: 'k8s_pod_cpu_usage';
|
||||||
|
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
@ -252,8 +252,8 @@ export function GetNodesQuickFiltersConfig(
|
|||||||
|
|
||||||
// Define aggregate metric name for node CPU utilization
|
// Define aggregate metric name for node CPU utilization
|
||||||
const cpuUtilMetric = dotMetricsEnabled
|
const cpuUtilMetric = dotMetricsEnabled
|
||||||
? 'k8s.node.cpu.utilization'
|
? 'k8s.node.cpu.usage'
|
||||||
: 'k8s_node_cpu_utilization';
|
: 'k8s_node_cpu_usage';
|
||||||
const environmentKey = dotMetricsEnabled
|
const environmentKey = dotMetricsEnabled
|
||||||
? 'deployment.environment'
|
? 'deployment.environment'
|
||||||
: 'deployment_environment';
|
: 'deployment_environment';
|
||||||
@ -314,8 +314,8 @@ export function GetNamespaceQuickFiltersConfig(
|
|||||||
: 'k8s_namespace_name';
|
: 'k8s_namespace_name';
|
||||||
const clusterKey = dotMetricsEnabled ? 'k8s.cluster.name' : 'k8s_cluster_name';
|
const clusterKey = dotMetricsEnabled ? 'k8s.cluster.name' : 'k8s_cluster_name';
|
||||||
const cpuUtilMetric = dotMetricsEnabled
|
const cpuUtilMetric = dotMetricsEnabled
|
||||||
? 'k8s.pod.cpu.utilization'
|
? 'k8s.pod.cpu.usage'
|
||||||
: 'k8s_pod_cpu_utilization';
|
: 'k8s_pod_cpu_usage';
|
||||||
const environmentKey = dotMetricsEnabled
|
const environmentKey = dotMetricsEnabled
|
||||||
? 'deployment.environment'
|
? 'deployment.environment'
|
||||||
: 'deployment_environment';
|
: 'deployment_environment';
|
||||||
@ -373,8 +373,8 @@ export function GetClustersQuickFiltersConfig(
|
|||||||
): IQuickFiltersConfig[] {
|
): IQuickFiltersConfig[] {
|
||||||
const clusterKey = dotMetricsEnabled ? 'k8s.cluster.name' : 'k8s_cluster_name';
|
const clusterKey = dotMetricsEnabled ? 'k8s.cluster.name' : 'k8s_cluster_name';
|
||||||
const cpuUtilMetric = dotMetricsEnabled
|
const cpuUtilMetric = dotMetricsEnabled
|
||||||
? 'k8s.node.cpu.utilization'
|
? 'k8s.node.cpu.usage'
|
||||||
: 'k8s_node_cpu_utilization';
|
: 'k8s_node_cpu_usage';
|
||||||
const environmentKey = dotMetricsEnabled
|
const environmentKey = dotMetricsEnabled
|
||||||
? 'deployment.environment'
|
? 'deployment.environment'
|
||||||
: 'deployment_environment';
|
: 'deployment_environment';
|
||||||
@ -541,9 +541,7 @@ export function GetDeploymentsQuickFiltersConfig(
|
|||||||
? 'k8s.namespace.name'
|
? 'k8s.namespace.name'
|
||||||
: 'k8s_namespace_name';
|
: 'k8s_namespace_name';
|
||||||
const clusterKey = dotMetricsEnabled ? 'k8s.cluster.name' : 'k8s_cluster_name';
|
const clusterKey = dotMetricsEnabled ? 'k8s.cluster.name' : 'k8s_cluster_name';
|
||||||
const metric = dotMetricsEnabled
|
const metric = dotMetricsEnabled ? 'k8s.pod.cpu.usage' : 'k8s_pod_cpu_usage';
|
||||||
? 'k8s.pod.cpu.utilization'
|
|
||||||
: 'k8s_pod_cpu_utilization';
|
|
||||||
const environmentKey = dotMetricsEnabled
|
const environmentKey = dotMetricsEnabled
|
||||||
? 'deployment.environment'
|
? 'deployment.environment'
|
||||||
: 'deployment_environment';
|
: 'deployment_environment';
|
||||||
@ -622,9 +620,7 @@ export function GetStatefulsetsQuickFiltersConfig(
|
|||||||
? 'k8s.namespace.name'
|
? 'k8s.namespace.name'
|
||||||
: 'k8s_namespace_name';
|
: 'k8s_namespace_name';
|
||||||
const clusterKey = dotMetricsEnabled ? 'k8s.cluster.name' : 'k8s_cluster_name';
|
const clusterKey = dotMetricsEnabled ? 'k8s.cluster.name' : 'k8s_cluster_name';
|
||||||
const metric = dotMetricsEnabled
|
const metric = dotMetricsEnabled ? 'k8s.pod.cpu.usage' : 'k8s_pod_cpu_usage';
|
||||||
? 'k8s.pod.cpu.utilization'
|
|
||||||
: 'k8s_pod_cpu_utilization';
|
|
||||||
const environmentKey = dotMetricsEnabled
|
const environmentKey = dotMetricsEnabled
|
||||||
? 'deployment.environment'
|
? 'deployment.environment'
|
||||||
: 'deployment_environment';
|
: 'deployment_environment';
|
||||||
@ -704,8 +700,8 @@ export function GetDaemonsetsQuickFiltersConfig(
|
|||||||
: 'k8s_namespace_name';
|
: 'k8s_namespace_name';
|
||||||
const clusterKey = dotMetricsEnabled ? 'k8s.cluster.name' : 'k8s_cluster_name';
|
const clusterKey = dotMetricsEnabled ? 'k8s.cluster.name' : 'k8s_cluster_name';
|
||||||
const metricName = dotMetricsEnabled
|
const metricName = dotMetricsEnabled
|
||||||
? 'k8s.pod.cpu.utilization'
|
? 'k8s.pod.cpu.usage'
|
||||||
: 'k8s_pod_cpu_utilization';
|
: 'k8s_pod_cpu_usage';
|
||||||
const environmentKey = dotMetricsEnabled
|
const environmentKey = dotMetricsEnabled
|
||||||
? 'deployment.environment'
|
? 'deployment.environment'
|
||||||
: 'deployment_environment';
|
: 'deployment_environment';
|
||||||
@ -781,8 +777,8 @@ export function GetJobsQuickFiltersConfig(
|
|||||||
: 'k8s_namespace_name';
|
: 'k8s_namespace_name';
|
||||||
const clusterKey = dotMetricsEnabled ? 'k8s.cluster.name' : 'k8s_cluster_name';
|
const clusterKey = dotMetricsEnabled ? 'k8s.cluster.name' : 'k8s_cluster_name';
|
||||||
const metricName = dotMetricsEnabled
|
const metricName = dotMetricsEnabled
|
||||||
? 'k8s.pod.cpu.utilization'
|
? 'k8s.pod.cpu.usage'
|
||||||
: 'k8s_pod_cpu_utilization';
|
: 'k8s_pod_cpu_usage';
|
||||||
const environmentKey = dotMetricsEnabled
|
const environmentKey = dotMetricsEnabled
|
||||||
? 'deployment.environment'
|
? 'deployment.environment'
|
||||||
: 'deployment_environment';
|
: 'deployment_environment';
|
||||||
|
|||||||
@ -17,8 +17,8 @@ export const getPodQueryPayload = (
|
|||||||
: 'k8s_cluster_name';
|
: 'k8s_cluster_name';
|
||||||
const k8sPodNameKey = dotMetricsEnabled ? 'k8s.pod.name' : 'k8s_pod_name';
|
const k8sPodNameKey = dotMetricsEnabled ? 'k8s.pod.name' : 'k8s_pod_name';
|
||||||
const containerCpuUtilKey = dotMetricsEnabled
|
const containerCpuUtilKey = dotMetricsEnabled
|
||||||
? 'container.cpu.utilization'
|
? 'container.cpu.usage'
|
||||||
: 'container_cpu_utilization';
|
: 'container_cpu_usage';
|
||||||
const containerMemUsageKey = dotMetricsEnabled
|
const containerMemUsageKey = dotMetricsEnabled
|
||||||
? 'container.memory.usage'
|
? 'container.memory.usage'
|
||||||
: 'container_memory_usage';
|
: 'container_memory_usage';
|
||||||
@ -63,7 +63,7 @@ export const getPodQueryPayload = (
|
|||||||
{
|
{
|
||||||
aggregateAttribute: {
|
aggregateAttribute: {
|
||||||
dataType: DataTypes.Float64,
|
dataType: DataTypes.Float64,
|
||||||
id: 'container_cpu_utilization--float64--Gauge--true',
|
id: 'container_cpu_usage--float64--Gauge--true',
|
||||||
isColumn: true,
|
isColumn: true,
|
||||||
isJSON: false,
|
isJSON: false,
|
||||||
key: containerCpuUtilKey,
|
key: containerCpuUtilKey,
|
||||||
@ -231,7 +231,7 @@ export const getPodQueryPayload = (
|
|||||||
{
|
{
|
||||||
aggregateAttribute: {
|
aggregateAttribute: {
|
||||||
dataType: DataTypes.Float64,
|
dataType: DataTypes.Float64,
|
||||||
id: 'container_cpu_utilization--float64--Gauge--true',
|
id: 'container_cpu_usage--float64--Gauge--true',
|
||||||
isColumn: true,
|
isColumn: true,
|
||||||
isJSON: false,
|
isJSON: false,
|
||||||
key: containerCpuUtilKey,
|
key: containerCpuUtilKey,
|
||||||
@ -385,7 +385,7 @@ export const getPodQueryPayload = (
|
|||||||
{
|
{
|
||||||
aggregateAttribute: {
|
aggregateAttribute: {
|
||||||
dataType: DataTypes.Float64,
|
dataType: DataTypes.Float64,
|
||||||
id: 'container_cpu_utilization--float64--Gauge--true',
|
id: 'container_cpu_usage--float64--Gauge--true',
|
||||||
isColumn: true,
|
isColumn: true,
|
||||||
isJSON: false,
|
isJSON: false,
|
||||||
key: containerCpuUtilKey,
|
key: containerCpuUtilKey,
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
metricToUseForClusters = GetDotMetrics("k8s_node_cpu_utilization")
|
metricToUseForClusters = GetDotMetrics("k8s_node_cpu_usage")
|
||||||
|
|
||||||
clusterAttrsToEnrich = []string{GetDotMetrics("k8s_cluster_name")}
|
clusterAttrsToEnrich = []string{GetDotMetrics("k8s_cluster_name")}
|
||||||
|
|
||||||
|
|||||||
@ -16,8 +16,6 @@ var dotMetricMap = map[string]string{
|
|||||||
"host_name": "host.name",
|
"host_name": "host.name",
|
||||||
"k8s_cluster_name": "k8s.cluster.name",
|
"k8s_cluster_name": "k8s.cluster.name",
|
||||||
"k8s_node_name": "k8s.node.name",
|
"k8s_node_name": "k8s.node.name",
|
||||||
"k8s_node_cpu_utilization": "k8s.node.cpu.utilization",
|
|
||||||
"k8s_pod_cpu_utilization": "k8s.pod.cpu.utilization",
|
|
||||||
"k8s_pod_memory_usage": "k8s.pod.memory.usage",
|
"k8s_pod_memory_usage": "k8s.pod.memory.usage",
|
||||||
"k8s_pod_cpu_request_utilization": "k8s.pod.cpu_request_utilization",
|
"k8s_pod_cpu_request_utilization": "k8s.pod.cpu_request_utilization",
|
||||||
"k8s_pod_memory_request_utilization": "k8s.pod.memory_request_utilization",
|
"k8s_pod_memory_request_utilization": "k8s.pod.memory_request_utilization",
|
||||||
@ -107,7 +105,6 @@ var dotMetricMap = map[string]string{
|
|||||||
"k8s_pod_uptime": "k8s.pod.uptime",
|
"k8s_pod_uptime": "k8s.pod.uptime",
|
||||||
|
|
||||||
"container_cpu_usage": "container.cpu.usage",
|
"container_cpu_usage": "container.cpu.usage",
|
||||||
"container_cpu_utilization": "container.cpu.utilization",
|
|
||||||
"container_cpu_time": "container.cpu.time",
|
"container_cpu_time": "container.cpu.time",
|
||||||
"container_memory_available": "container.memory.available",
|
"container_memory_available": "container.memory.available",
|
||||||
"container_memory_usage": "container.memory.usage",
|
"container_memory_usage": "container.memory.usage",
|
||||||
@ -209,7 +206,7 @@ WHERE metric_name IN (%s)
|
|||||||
var (
|
var (
|
||||||
// TODO(srikanthccv): import metadata yaml from receivers and use generated files to check the metrics
|
// TODO(srikanthccv): import metadata yaml from receivers and use generated files to check the metrics
|
||||||
podMetricNamesToCheck = []string{
|
podMetricNamesToCheck = []string{
|
||||||
GetDotMetrics("k8s_pod_cpu_utilization"),
|
GetDotMetrics("k8s_pod_cpu_usage"),
|
||||||
GetDotMetrics("k8s_pod_memory_usage"),
|
GetDotMetrics("k8s_pod_memory_usage"),
|
||||||
GetDotMetrics("k8s_pod_cpu_request_utilization"),
|
GetDotMetrics("k8s_pod_cpu_request_utilization"),
|
||||||
GetDotMetrics("k8s_pod_memory_request_utilization"),
|
GetDotMetrics("k8s_pod_memory_request_utilization"),
|
||||||
@ -219,7 +216,7 @@ var (
|
|||||||
GetDotMetrics("k8s_pod_phase"),
|
GetDotMetrics("k8s_pod_phase"),
|
||||||
}
|
}
|
||||||
nodeMetricNamesToCheck = []string{
|
nodeMetricNamesToCheck = []string{
|
||||||
GetDotMetrics("k8s_node_cpu_utilization"),
|
GetDotMetrics("k8s_node_cpu_usage"),
|
||||||
GetDotMetrics("k8s_node_allocatable_cpu"),
|
GetDotMetrics("k8s_node_allocatable_cpu"),
|
||||||
GetDotMetrics("k8s_node_memory_usage"),
|
GetDotMetrics("k8s_node_memory_usage"),
|
||||||
GetDotMetrics("k8s_node_allocatable_memory"),
|
GetDotMetrics("k8s_node_allocatable_memory"),
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
metricToUseForDaemonSets = GetDotMetrics("k8s_pod_cpu_utilization")
|
metricToUseForDaemonSets = GetDotMetrics("k8s_pod_cpu_usage")
|
||||||
k8sDaemonSetNameAttrKey = GetDotMetrics("k8s_daemonset_name")
|
k8sDaemonSetNameAttrKey = GetDotMetrics("k8s_daemonset_name")
|
||||||
|
|
||||||
metricNamesForDaemonSets = map[string]string{
|
metricNamesForDaemonSets = map[string]string{
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
metricToUseForDeployments = GetDotMetrics("k8s_pod_cpu_utilization")
|
metricToUseForDeployments = GetDotMetrics("k8s_pod_cpu_usage")
|
||||||
k8sDeploymentNameAttrKey = GetDotMetrics("k8s_deployment_name")
|
k8sDeploymentNameAttrKey = GetDotMetrics("k8s_deployment_name")
|
||||||
|
|
||||||
metricNamesForDeployments = map[string]string{
|
metricNamesForDeployments = map[string]string{
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
metricToUseForNamespaces = GetDotMetrics("k8s_pod_cpu_utilization")
|
metricToUseForNamespaces = GetDotMetrics("k8s_pod_cpu_usage")
|
||||||
|
|
||||||
namespaceAttrsToEnrich = []string{
|
namespaceAttrsToEnrich = []string{
|
||||||
GetDotMetrics("k8s_namespace_name"),
|
GetDotMetrics("k8s_namespace_name"),
|
||||||
|
|||||||
@ -3,6 +3,10 @@ package inframetrics
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"math"
|
||||||
|
"sort"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/SigNoz/signoz/pkg/query-service/app/metrics/v4/helpers"
|
"github.com/SigNoz/signoz/pkg/query-service/app/metrics/v4/helpers"
|
||||||
"github.com/SigNoz/signoz/pkg/query-service/common"
|
"github.com/SigNoz/signoz/pkg/query-service/common"
|
||||||
"github.com/SigNoz/signoz/pkg/query-service/constants"
|
"github.com/SigNoz/signoz/pkg/query-service/constants"
|
||||||
@ -12,13 +16,10 @@ import (
|
|||||||
"github.com/SigNoz/signoz/pkg/query-service/postprocess"
|
"github.com/SigNoz/signoz/pkg/query-service/postprocess"
|
||||||
"github.com/SigNoz/signoz/pkg/valuer"
|
"github.com/SigNoz/signoz/pkg/valuer"
|
||||||
"golang.org/x/exp/slices"
|
"golang.org/x/exp/slices"
|
||||||
"math"
|
|
||||||
"sort"
|
|
||||||
"strings"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
metricToUseForNodes = GetDotMetrics("k8s_node_cpu_utilization")
|
metricToUseForNodes = GetDotMetrics("k8s_node_cpu_usage")
|
||||||
|
|
||||||
nodeAttrsToEnrich = []string{GetDotMetrics("k8s_node_name"), GetDotMetrics("k8s_node_uid"), GetDotMetrics("k8s_cluster_name")}
|
nodeAttrsToEnrich = []string{GetDotMetrics("k8s_node_name"), GetDotMetrics("k8s_node_uid"), GetDotMetrics("k8s_cluster_name")}
|
||||||
|
|
||||||
@ -33,7 +34,7 @@ var (
|
|||||||
nodeQueryNames = []string{"A", "B", "C", "D", "E", "F"}
|
nodeQueryNames = []string{"A", "B", "C", "D", "E", "F"}
|
||||||
|
|
||||||
metricNamesForNodes = map[string]string{
|
metricNamesForNodes = map[string]string{
|
||||||
"cpu": GetDotMetrics("k8s_node_cpu_utilization"),
|
"cpu": GetDotMetrics("k8s_node_cpu_usage"),
|
||||||
"cpu_allocatable": GetDotMetrics("k8s_node_allocatable_cpu"),
|
"cpu_allocatable": GetDotMetrics("k8s_node_allocatable_cpu"),
|
||||||
"memory": GetDotMetrics("k8s_node_memory_usage"),
|
"memory": GetDotMetrics("k8s_node_memory_usage"),
|
||||||
"memory_allocatable": GetDotMetrics("k8s_node_allocatable_memory"),
|
"memory_allocatable": GetDotMetrics("k8s_node_allocatable_memory"),
|
||||||
|
|||||||
@ -19,7 +19,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
metricToUseForPods = GetDotMetrics("k8s_pod_cpu_utilization")
|
metricToUseForPods = GetDotMetrics("k8s_pod_cpu_usage")
|
||||||
|
|
||||||
podAttrsToEnrich = []string{
|
podAttrsToEnrich = []string{
|
||||||
GetDotMetrics("k8s_pod_uid"),
|
GetDotMetrics("k8s_pod_uid"),
|
||||||
@ -49,7 +49,7 @@ var (
|
|||||||
podQueryNames = []string{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K"}
|
podQueryNames = []string{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K"}
|
||||||
|
|
||||||
metricNamesForPods = map[string]string{
|
metricNamesForPods = map[string]string{
|
||||||
"cpu": GetDotMetrics("k8s_pod_cpu_utilization"),
|
"cpu": GetDotMetrics("k8s_pod_cpu_usage"),
|
||||||
"cpu_request": GetDotMetrics("k8s_pod_cpu_request_utilization"),
|
"cpu_request": GetDotMetrics("k8s_pod_cpu_request_utilization"),
|
||||||
"cpu_limit": GetDotMetrics("k8s_pod_cpu_limit_utilization"),
|
"cpu_limit": GetDotMetrics("k8s_pod_cpu_limit_utilization"),
|
||||||
"memory": GetDotMetrics("k8s_pod_memory_usage"),
|
"memory": GetDotMetrics("k8s_pod_memory_usage"),
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
metricToUseForStatefulSets = GetDotMetrics("k8s_pod_cpu_utilization")
|
metricToUseForStatefulSets = GetDotMetrics("k8s_pod_cpu_usage")
|
||||||
k8sStatefulSetNameAttrKey = GetDotMetrics("k8s_statefulset_name")
|
k8sStatefulSetNameAttrKey = GetDotMetrics("k8s_statefulset_name")
|
||||||
|
|
||||||
metricNamesForStatefulSets = map[string]string{
|
metricNamesForStatefulSets = map[string]string{
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import v3 "github.com/SigNoz/signoz/pkg/query-service/model/v3"
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
metricNamesForWorkloads = map[string]string{
|
metricNamesForWorkloads = map[string]string{
|
||||||
"cpu": GetDotMetrics("k8s_pod_cpu_utilization"),
|
"cpu": GetDotMetrics("k8s_pod_cpu_usage"),
|
||||||
"cpu_request": GetDotMetrics("k8s_pod_cpu_request_utilization"),
|
"cpu_request": GetDotMetrics("k8s_pod_cpu_request_utilization"),
|
||||||
"cpu_limit": GetDotMetrics("k8s_pod_cpu_limit_utilization"),
|
"cpu_limit": GetDotMetrics("k8s_pod_cpu_limit_utilization"),
|
||||||
"memory": GetDotMetrics("k8s_pod_memory_usage"),
|
"memory": GetDotMetrics("k8s_pod_memory_usage"),
|
||||||
|
|||||||
@ -235,7 +235,7 @@ func ClickHouseFormattedMetricNames(v interface{}) string {
|
|||||||
if name, ok := v.(string); ok {
|
if name, ok := v.(string); ok {
|
||||||
transitionedMetrics := metrics.GetTransitionedMetric(name, !constants.IsDotMetricsEnabled)
|
transitionedMetrics := metrics.GetTransitionedMetric(name, !constants.IsDotMetricsEnabled)
|
||||||
if transitionedMetrics != name {
|
if transitionedMetrics != name {
|
||||||
return ClickHouseFormattedValue([]interface{}{name, transitionedMetrics})
|
return ClickHouseFormattedValue([]interface{}{transitionedMetrics})
|
||||||
} else {
|
} else {
|
||||||
return ClickHouseFormattedValue([]interface{}{name})
|
return ClickHouseFormattedValue([]interface{}{name})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user