tempo-k8s docs - Charm traces and spans
Traces in charm tracing
When we refer to charm tracing, it is concerned with pushing traces of the charm execution flow not with the workload flow itself.
With that, there is an analogy between traces and charm events (hooks) that occur during a charm’s life cycle. With every hook fired, charm execution begins and that starts a new trace indicating the start of an execution flow with a parent span called charm exec.
Spans in charm tracing
There are several occasions where a span will be created under a trace during a charm execution:
- when a
juju eventis fired, achild spanis created whose parent is thecharm execspan. - when an
ops eventis fired, achild spanis created whose parent is thecharm execspan. - when a non-dunder
charm class methodgets called as part of the charm execution, achild spanis created whose parent is either ajuju eventspan or anops eventspan. - when a non-dunder
extra class methodgets called as part of the charm execution, achild spanis created whose parent is either ajuju eventspan or anops eventspan.
Tracing a trace
This section assumes prior knowledge on a charm’s lifecycle and control flow.
Assuming you have a charm instrumented for sending traces to a tempo backend:
When the periodical update_status hook fires, by the end of your charm execution for this hook, an example execution flow can look like the below:

you’ll have a trace created in your tempo backend with a similar structure to the below:
Last updated 1 year, 5 months ago.
