canonical / data-platform-libs

A collection of charm libraries curated by the Data Platform Team
https://charmhub.io/data-platform-libs
Apache License 2.0
10 stars 9 forks source link

Wrapper methods don't update their context, making harder to trace / follow in logs #186

Open gboutry opened 1 month ago

gboutry commented 1 month ago

The data_interfaces library defines 4 wrapper methods: https://github.com/canonical/data-platform-libs/blob/c0d638734c975dcfccd89b7e294d533a96f31fd6/lib/charms/data_platform_libs/v0/data_interfaces.py#L485 https://github.com/canonical/data-platform-libs/blob/c0d638734c975dcfccd89b7e294d533a96f31fd6/lib/charms/data_platform_libs/v0/data_interfaces.py#L500 https://github.com/canonical/data-platform-libs/blob/c0d638734c975dcfccd89b7e294d533a96f31fd6/lib/charms/data_platform_libs/v0/data_interfaces.py#L511 https://github.com/canonical/data-platform-libs/blob/c0d638734c975dcfccd89b7e294d533a96f31fd6/lib/charms/data_platform_libs/v0/data_interfaces.py#L524

These method do not update the wrapper context to the original method context, making it harder to trace / follow in logs.

In the case of the charm library: charms.tempo_k8s.v1.charm_tracing. it even makes impossible as the the trace_type method will fail: https://github.com/canonical/tempo-k8s-operator/issues/155

github-actions[bot] commented 1 month ago

https://warthogs.atlassian.net/browse/DPE-4995