From 83481158d54bbc1331f13c42b712af52aec5a263 Mon Sep 17 00:00:00 2001 From: joey Date: Wed, 21 Feb 2024 15:30:57 +0800 Subject: [PATCH] use `container_spec_memory_limit_bytes` as container memory limit metric source --- .../resources-container-monitor/container/provider.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/apps/msp/apm/service/components/resources-container-monitor/container/provider.go b/internal/apps/msp/apm/service/components/resources-container-monitor/container/provider.go index ca487ce9fa4..ea9cf346023 100644 --- a/internal/apps/msp/apm/service/components/resources-container-monitor/container/provider.go +++ b/internal/apps/msp/apm/service/components/resources-container-monitor/container/provider.go @@ -92,7 +92,7 @@ func (p *provider) getCpuLineGraph(ctx context.Context, startTime, endTime int64 } func (p *provider) getMemoryLineGraph(ctx context.Context, startTime, endTime int64, instanceId string) ([]*model.LineGraphMetaData, error) { - statement := fmt.Sprintf("SELECT round_float(avg(mem_limit::field), 2),round_float(avg(mem_usage::field), 2) " + + statement := fmt.Sprintf("SELECT round_float(avg(container_spec_memory_limit_bytes::field), 2),round_float(avg(mem_usage::field), 2) " + "FROM docker_container_summary " + "WHERE pod_uid::tag=$pod_uid " + "GROUP BY time()")