1- use std:: collections:: HashMap ;
2- use std:: ops:: Not ;
3-
41use super :: instance_id:: InstanceID ;
52use super :: {
63 client_builder:: { OpAMPClientBuilder , OpAMPClientBuilderError } ,
74 instance_id:: getter:: InstanceIDGetter ,
85} ;
96use crate :: agent_control:: defaults:: {
10- default_sub_agent_custom_capabilities, OPAMP_SERVICE_NAME , OPAMP_SERVICE_NAMESPACE ,
11- PARENT_AGENT_ID_ATTRIBUTE_KEY ,
7+ OPAMP_SERVICE_NAME , OPAMP_SERVICE_NAMESPACE , PARENT_AGENT_ID_ATTRIBUTE_KEY ,
128} ;
139use crate :: {
1410 agent_control:: config:: { AgentID , AgentTypeFQN } ,
@@ -25,6 +21,7 @@ use opamp_client::{
2521 } ,
2622 StartedClient ,
2723} ;
24+ use std:: collections:: HashMap ;
2825use tracing:: info;
2926
3027pub fn build_sub_agent_opamp < CB , OB , IG > (
7471 let ( opamp_publisher, opamp_consumer) = pub_sub ( ) ;
7572 let start_settings = start_settings (
7673 instance_id_getter. get ( & agent_id) ?,
77- & agent_id,
7874 agent_type,
7975 additional_identifying_attributes,
8076 non_identifying_attributes,
8884/// Builds the OpAMP StartSettings corresponding to the provided arguments for any sub agent and agent control.
8985pub fn start_settings (
9086 instance_id : InstanceID ,
91- agent_id : & AgentID ,
9287 agent_fqn : & AgentTypeFQN ,
9388 additional_identifying_attributes : HashMap < String , DescriptionValueType > ,
9489 non_identifying_attributes : HashMap < String , DescriptionValueType > ,
@@ -103,16 +98,10 @@ pub fn start_settings(
10398
10499 identifying_attributes. extend ( additional_identifying_attributes) ;
105100
106- // Agent control does not have custom capabilities
107- let custom_capabilities = agent_id
108- . is_agent_control_id ( )
109- . not ( )
110- . then ( default_sub_agent_custom_capabilities) ;
111-
112101 StartSettings {
113102 instance_id : instance_id. into ( ) ,
114103 capabilities : agent_fqn. get_capabilities ( ) ,
115- custom_capabilities,
104+ custom_capabilities : agent_fqn . get_custom_capabilities ( ) ,
116105 agent_description : AgentDescription {
117106 identifying_attributes,
118107 non_identifying_attributes,
0 commit comments