Comment 0 for bug 1981588

Revision history for this message
Dmitrii Shcherbakov (dmitriis) wrote : [ux] Ability to easily show relation data

A common repetitive task when debugging charms (in my experience) is getting relation data bag contents.

While it is possible to do something like this:

# juju run --unit etcd-operator/0 'relation-ids cluster'
cluster:41

# juju run --unit etcd-operator/0 'relation-get -r 41 - etcd-operator/1'
egress-subnets: 10.152.183.208/32
ingress-address: 10.152.183.208
peer-url: https://etcd-operator-1.etcd-operator-endpoints.skydive.svc.cluster.local:2380
private-address: 10.152.183.208

it seems like a Juju client command to dump a snapshot of relation data (and server side unit state data) at a particular point in time from the point of view of a given unit would be useful.

This may also be useful for integration QA runs so that this data can be collected as well and included for charm engineering teams to resolve issues faster. The relation data state is often needed to simulate the problematic case without being able to reproduce it as it may be difficult to trigger it due to timing, environment specifics or other reasons.

Likewise, whenever a hook error happens, it would be useful to save a snapshot of controller data that a unit has retrieved from the agent's PoV. That would make it possible to observe the exact state snapshot that triggered an error. I recognize that this will not capture the state of a unit's host but that can be analyzed via other means.