operator
operator copied to clipboard
Tracing: note the container name in Pebble spans
Today, a charm would call:
self._amf_container = self.unit.get_container(self._amf_container_name)
...
if not self._amf_container.can_connect(): ...
Which is:
def can_connect(self) -> bool:
try:
self._pebble.get_system_info()
...
Which is:
def get_system_info(self) -> SystemInfo:
"""Get system info."""
with tracer.start_as_current_span('pebble get_system_info'):
resp = self._request('GET', '/v1/system-info')
return SystemInfo.from_dict(resp['result'])
Where neither ._request nor ._request_raw are instrumented.
This generates a tracing span.
Except we lost the container name in the process.
Which is fine for ~90% charms that have only one container, but must be clunky for those charms that have at least two.