3131import io .opentelemetry .sdk .metrics .data .AggregationTemporality ;
3232import io .opentelemetry .sdk .metrics .export .MetricExporter ;
3333import io .opentelemetry .sdk .resources .Resource ;
34+ import io .opentelemetry .semconv .DeploymentAttributes ;
3435import io .opentelemetry .semconv .incubating .DeploymentIncubatingAttributes ;
3536import java .util .HashMap ;
3637import java .util .List ;
@@ -148,7 +149,7 @@ void legacyDeploymentEnvironment() {
148149 .hasSize (3 )
149150 .describedAs ("when legacy attribute set agent should send both" )
150151 .containsEntry (DeploymentIncubatingAttributes .DEPLOYMENT_ENVIRONMENT , "test" )
151- .containsEntry (DeploymentIncubatingAttributes .DEPLOYMENT_ENVIRONMENT_NAME , "test" )
152+ .containsEntry (DeploymentAttributes .DEPLOYMENT_ENVIRONMENT_NAME , "test" )
152153 .containsEntry ("other" , "other" );
153154 }
154155
@@ -157,15 +158,15 @@ void legacyDeploymentRemoveLegacyWhenBothSet() {
157158 Resource input =
158159 Resource .builder ()
159160 .put (DeploymentIncubatingAttributes .DEPLOYMENT_ENVIRONMENT , "legacy" )
160- .put (DeploymentIncubatingAttributes .DEPLOYMENT_ENVIRONMENT_NAME , "new" )
161+ .put (DeploymentAttributes .DEPLOYMENT_ENVIRONMENT_NAME , "new" )
161162 .put ("other" , "other" )
162163 .build ();
163164 Resource resource = resourceProviders ().apply (input , null );
164165 assertThat (resource .getAttributes ())
165166 .hasSize (3 )
166167 .describedAs ("when both attributes are set, agent should send them as-is" )
167168 .containsEntry (DeploymentIncubatingAttributes .DEPLOYMENT_ENVIRONMENT , "legacy" )
168- .containsEntry (DeploymentIncubatingAttributes .DEPLOYMENT_ENVIRONMENT_NAME , "new" )
169+ .containsEntry (DeploymentAttributes .DEPLOYMENT_ENVIRONMENT_NAME , "new" )
169170 .containsEntry ("other" , "other" );
170171 }
171172}
0 commit comments