2424import static io .opentelemetry .semconv .incubating .CloudIncubatingAttributes .CLOUD_RESOURCE_ID ;
2525import static io .opentelemetry .semconv .incubating .ContainerIncubatingAttributes .CONTAINER_ID ;
2626import static io .opentelemetry .semconv .incubating .ContainerIncubatingAttributes .CONTAINER_IMAGE_NAME ;
27+ import static io .opentelemetry .semconv .incubating .ContainerIncubatingAttributes .CONTAINER_IMAGE_TAGS ;
2728import static io .opentelemetry .semconv .incubating .ContainerIncubatingAttributes .CONTAINER_NAME ;
29+ import static java .util .Collections .singletonList ;
2830import static org .assertj .core .api .Assertions .entry ;
2931import static org .mockito .Mockito .when ;
3032
@@ -52,8 +54,6 @@ class EcsResourceTest {
5254
5355 @ Mock private SimpleHttpClient mockHttpClient ;
5456
55- // Suppression is required for CONTAINER_IMAGE_TAG until we are ready to upgrade.
56- @ SuppressWarnings ("deprecation" )
5757 @ Test
5858 void testCreateAttributesV3 () throws IOException {
5959 Map <String , String > mockSysEnv = new HashMap <>();
@@ -78,7 +78,7 @@ void testCreateAttributesV3() throws IOException {
7878 entry (CONTAINER_NAME , "ecs-nginx-5-nginx-curl-ccccb9f49db0dfe0d901" ),
7979 entry (CONTAINER_ID , "43481a6ce4842eec8fe72fc28500c6b52edcc0917f105b83379f88cac1ff3946" ),
8080 entry (CONTAINER_IMAGE_NAME , "nrdlngr/nginx-curl" ),
81- entry (io . opentelemetry . semconv . ResourceAttributes . CONTAINER_IMAGE_TAG , "latest" ),
81+ entry (CONTAINER_IMAGE_TAGS , singletonList ( "latest" ) ),
8282 entry (AWS_ECS_CLUSTER_ARN , "arn:aws:ecs:us-east-2:012345678910:cluster/default" ),
8383 entry (
8484 AttributeKey .stringKey ("aws.ecs.container.image.id" ),
@@ -90,8 +90,6 @@ void testCreateAttributesV3() throws IOException {
9090 entry (AWS_ECS_TASK_REVISION , "5" ));
9191 }
9292
93- // Suppression is required for CONTAINER_IMAGE_TAG until we are ready to upgrade.
94- @ SuppressWarnings ("deprecation" )
9593 @ Test
9694 void testCreateAttributesV4 () throws IOException {
9795 Map <String , String > mockSysEnv = new HashMap <>();
@@ -119,25 +117,22 @@ void testCreateAttributesV4() throws IOException {
119117 entry (CONTAINER_NAME , "ecs-curltest-26-curl-cca48e8dcadd97805600" ),
120118 entry (CONTAINER_ID , "ea32192c8553fbff06c9340478a2ff089b2bb5646fb718b4ee206641c9086d66" ),
121119 entry (CONTAINER_IMAGE_NAME , "111122223333.dkr.ecr.us-west-2.amazonaws.com/curltest" ),
122- entry (io . opentelemetry . semconv . ResourceAttributes . CONTAINER_IMAGE_TAG , "latest" ),
120+ entry (CONTAINER_IMAGE_TAGS , singletonList ( "latest" ) ),
123121 entry (
124122 AttributeKey .stringKey ("aws.ecs.container.image.id" ),
125123 "sha256:d691691e9652791a60114e67b365688d20d19940dde7c4736ea30e660d8d3553" ),
126124 entry (AWS_ECS_CLUSTER_ARN , "arn:aws:ecs:us-west-2:111122223333:cluster/default" ),
127125 entry (
128126 AWS_ECS_CONTAINER_ARN ,
129127 "arn:aws:ecs:us-west-2:111122223333:container/0206b271-b33f-47ab-86c6-a0ba208a70a9" ),
130- entry (AWS_LOG_GROUP_NAMES , Collections . singletonList ("/ecs/metadata" )),
128+ entry (AWS_LOG_GROUP_NAMES , singletonList ("/ecs/metadata" )),
131129 entry (
132130 AWS_LOG_GROUP_ARNS ,
133- Collections .singletonList (
134- "arn:aws:logs:us-west-2:111122223333:log-group:/ecs/metadata" )),
135- entry (
136- AWS_LOG_STREAM_NAMES ,
137- Collections .singletonList ("ecs/curl/8f03e41243824aea923aca126495f665" )),
131+ singletonList ("arn:aws:logs:us-west-2:111122223333:log-group:/ecs/metadata" )),
132+ entry (AWS_LOG_STREAM_NAMES , singletonList ("ecs/curl/8f03e41243824aea923aca126495f665" )),
138133 entry (
139134 AWS_LOG_STREAM_ARNS ,
140- Collections . singletonList (
135+ singletonList (
141136 "arn:aws:logs:us-west-2:111122223333:log-group:/ecs/metadata:log-stream:ecs/curl/8f03e41243824aea923aca126495f665" )),
142137 entry (
143138 AWS_ECS_TASK_ARN ,
0 commit comments