-
-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aiohttp client tracing #791
Comments
The only clue to adding some tracing or monitoring is in # snippet from botocore.session.Session.create_client
client_creator = botocore.client.ClientCreator(
loader, endpoint_resolver, self.user_agent(), event_emitter,
retryhandler, translate, response_parser_factory,
exceptions_factory, config_store)
client = client_creator.create_client(
service_name=service_name, region_name=region_name,
is_secure=use_ssl, endpoint_url=endpoint_url, verify=verify,
credentials=credentials, scoped_config=self.get_scoped_config(),
client_config=config, api_version=api_version)
monitor = self._get_internal_component('monitor')
if monitor is not None:
monitor.register(client.meta.events)
return client The monitor seems to be created with def _create_csm_monitor(self):
if self.get_config_variable('csm_enabled'):
client_id = self.get_config_variable('csm_client_id')
host = self.get_config_variable('csm_host')
port = self.get_config_variable('csm_port')
handler = monitoring.Monitor(
adapter=monitoring.MonitorEventAdapter(),
publisher=monitoring.SocketPublisher(
socket=socket.socket(socket.AF_INET, socket.SOCK_DGRAM),
host=host,
port=port,
serializer=monitoring.CSMSerializer(
csm_client_id=client_id)
)
)
return handler
return None |
actually there's an event you can trace: await self._event_emitter.emit(
'creating-client-class.%s' % service_id,
class_attributes=class_attributes,
base_classes=bases) could you state the goal you want with tracing the underlying aiohttp client? |
Essentially, it would be ideal to better understand and monitor how the clients are using a connection pool so that concurrent processes can be optimized for repeatable workloads or debugged for performance issues. Some relevant notes on the connection pool for botocore/urllib3 are in https://gitlab.com/dazza-codes/aio-aws/-/wikis/botocore-clients and similar notes for aiobotocore would be great, with additional notes on how to monitor and tune the connection pools. Hooking into the 'creating-client-class' event is not quite enough to actually trace the number of connections used and whether or not they are part of a connection pool or not. Some of the terms in botocore (hence aiobotocore) are confusing. For example, a The It would help to know whether |
Most of the answers to some details are in Looking at There is also an interesting |
This issue has been marked as stale because it has been inactive for more than 60 days. Please update this pull request or it will be automatically closed in 7 days. |
It could help to somehow expose aiohttp client tracing
The text was updated successfully, but these errors were encountered: