Closed PietroPasotti closed 3 months ago
This PR adds a charm library that offers a charm the possibility to snapshot its own state. State here refers to scenario's State data structure.
State
Internally it uses a ripoff of the jhack scenario snapshot functionality.
jhack scenario snapshot
Goal is to offer charms the possibility to add state snapshots to traces as event datapoints for troubleshooting.
This PR also updates charm_tracing.py to expose API to hook up snapshotting automatically from the @trace_charm decorator as one would expect:
@trace_charm
from charms.tempo_k8s.v0.snapshot import get_state @trace_charm( tracing_endpoint="something", state="state", ) class MyCharm(CharmBase): @property def state(self) -> scenario.State: return get_state()
(that will be split out to a separate PR once the design is validated)
Result: scenario.States attached to the "charm_exec" root span in grafana!
scenario.State
"charm_exec"
this requires some further speccing
This PR adds a charm library that offers a charm the possibility to snapshot its own state. State here refers to scenario's
State
data structure.Internally it uses a ripoff of the
jhack scenario snapshot
functionality.Goal is to offer charms the possibility to add state snapshots to traces as event datapoints for troubleshooting.
This PR also updates charm_tracing.py to expose API to hook up snapshotting automatically from the
@trace_charm
decorator as one would expect:(that will be split out to a separate PR once the design is validated)
Result:
scenario.State
s attached to the"charm_exec"
root span in grafana!