@@ -80,34 +80,34 @@ class PetClinicAgentsStack extends Stack {
8080 } ) ;
8181
8282 // Deploy nutrition agent with optional environment variable
83+ const nutritionAgentName = 'nutrition_agent' ;
8384 const nutritionAgentProps = {
84- AgentName : 'nutrition_agent' ,
85+ AgentName : nutritionAgentName ,
8586 ImageUri : nutritionAgentImage . imageUri ,
8687 ExecutionRole : agentCoreRole . roleArn ,
87- Entrypoint : 'nutrition_agent.py'
88+ Entrypoint : 'nutrition_agent.py' ,
89+ EnvironmentVariables : {
90+ OTEL_RESOURCE_ATTRIBUTES : `service.name=${ nutritionAgentName } ,deployment.environment=bedrock-agentcore:default,Application=Audit,Team=AnalyticsTeam,Tier=Tier-4,aws.application_signals.metric_resource_keys=Application&Team&Tier` ,
91+ OTEL_PYTHON_DISABLED_INSTRUMENTATIONS : 'sqlalchemy,psycopg2,pymysql,sqlite3,aiopg,asyncpg,mysql_connector,system_metrics,google-genai'
92+ }
8893 } ;
8994
9095 if ( props ?. nutritionServiceUrl ) {
91- nutritionAgentProps . EnvironmentVariables = {
92- NUTRITION_SERVICE_URL : props . nutritionServiceUrl ,
93- OTEL_PYTHON_DISABLED_INSTRUMENTATIONS : 'sqlalchemy,psycopg2,pymysql,sqlite3,aiopg,asyncpg,mysql_connector,system_metrics,google-genai'
94- } ;
95- } else {
96- nutritionAgentProps . EnvironmentVariables = {
97- OTEL_PYTHON_DISABLED_INSTRUMENTATIONS : 'sqlalchemy,psycopg2,pymysql,sqlite3,aiopg,asyncpg,mysql_connector,system_metrics,google-genai'
98- } ;
96+ nutritionAgentProps . EnvironmentVariables . NUTRITION_SERVICE_URL = props . nutritionServiceUrl ;
9997 }
10098
10199 const nutritionAgent = new BedrockAgentCoreDeployer ( this , 'NutritionAgent' , nutritionAgentProps ) ;
102100
103101 // Deploy primary agent
102+ const petClinicAgentName = 'pet_clinic_agent'
104103 const primaryAgent = new BedrockAgentCoreDeployer ( this , 'PrimaryAgent' , {
105- AgentName : 'pet_clinic_agent' ,
104+ AgentName : petClinicAgentName ,
106105 ImageUri : primaryAgentImage . imageUri ,
107106 ExecutionRole : agentCoreRole . roleArn ,
108107 Entrypoint : 'pet_clinic_agent.py' ,
109108 EnvironmentVariables : {
110- NUTRITION_AGENT_ARN : nutritionAgent . agentArn
109+ NUTRITION_AGENT_ARN : nutritionAgent . agentArn ,
110+ OTEL_RESOURCE_ATTRIBUTES : `service.name=${ petClinicAgentName } ,deployment.environment=bedrock-agentcore:default,Application=Audit,Team=AnalyticsTeam,Tier=Tier-4,aws.application_signals.metric_resource_keys=Application&Team&Tier`
111111 }
112112 } ) ;
113113
@@ -118,4 +118,4 @@ class PetClinicAgentsStack extends Stack {
118118 }
119119}
120120
121- module . exports = { PetClinicAgentsStack } ;
121+ module . exports = { PetClinicAgentsStack } ;
0 commit comments