@@ -16,7 +16,7 @@ const TEST_TIMESTAMP = 1733414400; // 2024-12-05T16:00:00Z
1616
1717describe ( "formatMetricsForContainer" , ( ) => {
1818 it ( "formats metrics for a single container" , ( ) => {
19- const container = { id : "app-123" , name : "my-app" } ;
19+ const container = { id : "app-123" , name : "my-app" , version : 1 } ;
2020 const metrics = formatMetricsForContainer (
2121 TEST_ACCOUNT_ID ,
2222 container ,
@@ -29,7 +29,7 @@ describe("formatMetricsForContainer", () => {
2929 } ) ;
3030
3131 it ( "formats multiple metrics groups" , ( ) => {
32- const container = { id : "app-123" , name : "my-app" } ;
32+ const container = { id : "app-123" , name : "my-app" , version : 1 } ;
3333 const metrics = formatMetricsForContainer (
3434 TEST_ACCOUNT_ID ,
3535 container ,
@@ -42,13 +42,13 @@ describe("formatMetricsForContainer", () => {
4242 } ) ;
4343
4444 it ( "includes correct tags" , ( ) => {
45- const container = { id : "app-123" , name : "my-app" } ;
45+ const container = { id : "app-123" , name : "my-app" , version : 1 } ;
4646 const group = createMockMetricsGroup ( {
4747 dimensions : {
4848 applicationId : "app-test" ,
4949 datetimeMinute : "2025-12-05T16:00:00Z" ,
50- deploymentId : "deploy -test" ,
51- placementId : "place -test" ,
50+ deploymentId : "instance -test" ,
51+ placementId : "placement -test" ,
5252 } ,
5353 } ) ;
5454
@@ -68,12 +68,13 @@ describe("formatMetricsForContainer", () => {
6868 expect ( cpuMetric ?. tags ) . toContain ( `account_id:${ TEST_ACCOUNT_ID } ` ) ;
6969 expect ( cpuMetric ?. tags ) . toContain ( "application_id:app-test" ) ;
7070 expect ( cpuMetric ?. tags ) . toContain ( "application_name:my-app" ) ;
71- expect ( cpuMetric ?. tags ) . toContain ( "deployment_id:deploy-test" ) ;
72- expect ( cpuMetric ?. tags ) . toContain ( "placement_id:place-test" ) ;
71+ expect ( cpuMetric ?. tags ) . toContain ( "version:1" ) ;
72+ expect ( cpuMetric ?. tags ) . toContain ( "instance_id:instance-test" ) ;
73+ expect ( cpuMetric ?. tags ) . toContain ( "placement_id:placement-test" ) ;
7374 } ) ;
7475
7576 it ( "returns empty array for no metrics groups" , ( ) => {
76- const container = { id : "app-123" , name : "my-app" } ;
77+ const container = { id : "app-123" , name : "my-app" , version : 1 } ;
7778 const metrics = formatMetricsForContainer (
7879 TEST_ACCOUNT_ID ,
7980 container ,
@@ -130,8 +131,8 @@ describe("formatContainerMetrics", () => {
130131 dimensions : {
131132 applicationId : "app-test" ,
132133 datetimeMinute : "2025-12-05T16:00:00Z" ,
133- deploymentId : "deploy -test" ,
134- placementId : "place -test" ,
134+ deploymentId : "instance -test" ,
135+ placementId : "placement -test" ,
135136 } ,
136137 } ) ;
137138
@@ -159,8 +160,8 @@ describe("formatContainerMetrics", () => {
159160 expect ( cpuMetric ?. tags ) . toContain (
160161 `application_name:${ mockContainers [ 0 ] . name } ` ,
161162 ) ;
162- expect ( cpuMetric ?. tags ) . toContain ( "deployment_id:deploy -test" ) ;
163- expect ( cpuMetric ?. tags ) . toContain ( "placement_id:place -test" ) ;
163+ expect ( cpuMetric ?. tags ) . toContain ( "instance_id:instance -test" ) ;
164+ expect ( cpuMetric ?. tags ) . toContain ( "placement_id:placement -test" ) ;
164165 expect ( cpuMetric ?. tags ) . toContain ( "stat:p50" ) ;
165166 } ) ;
166167
0 commit comments