@@ -1372,6 +1372,7 @@ class ClientOptions:
13721372 on_lifecycle_event_connection_success_fn (Callable[[LifecycleConnectSuccessData],]): Callback for Lifecycle Event Connection Success.
13731373 on_lifecycle_event_connection_failure_fn (Callable[[LifecycleConnectFailureData],]): Callback for Lifecycle Event Connection Failure.
13741374 on_lifecycle_event_disconnection_fn (Callable[[LifecycleDisconnectData],]): Callback for Lifecycle Event Disconnection.
1375+ enable_aws_metrics (bool): Whether to append AWS IoT metrics to the username field during CONNECT. Default: True
13751376 """
13761377 host_name : str
13771378 port : int = None
@@ -1398,6 +1399,7 @@ class ClientOptions:
13981399 on_lifecycle_event_connection_success_fn : Callable [[LifecycleConnectSuccessData ], None ] = None
13991400 on_lifecycle_event_connection_failure_fn : Callable [[LifecycleConnectFailureData ], None ] = None
14001401 on_lifecycle_event_disconnection_fn : Callable [[LifecycleDisconnectData ], None ] = None
1402+ enable_aws_metrics : bool = True
14011403
14021404
14031405def _check_callback (callback ):
@@ -1758,11 +1760,10 @@ class Client(NativeResource):
17581760
17591761 Args:
17601762 client_options (ClientOptions): The ClientOptions dataclass to used to configure the new Client.
1761- enable_metrics (bool): Whether to append AWS IoT metrics to the username field during CONNECT. Default: True
17621763
17631764 """
17641765
1765- def __init__ (self , client_options : ClientOptions , enable_metrics : bool = True ):
1766+ def __init__ (self , client_options : ClientOptions ):
17661767
17671768 super ().__init__ ()
17681769
@@ -1789,7 +1790,7 @@ def __init__(self, client_options: ClientOptions, enable_metrics: bool = True):
17891790 will = connect_options .will
17901791
17911792 username = connect_options .username
1792- if enable_metrics :
1793+ if client_options . enable_aws_metrics :
17931794 username = username if username else ""
17941795 username += _get_awsiot_metrics_str (username )
17951796 connect_options .username = username
0 commit comments