Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
docs: Explain shutdown behaviour with tracing
Browse files Browse the repository at this point in the history
Update `TRACING.md` to explain two important points, both relating to
static tracing:

- It currently requires systemd support.
- It is the only scenario where the agent will actually exit.

Signed-off-by: James O. D. Hunt <[email protected]>
  • Loading branch information
jodh-intel committed Mar 19, 2019
1 parent eddd52b commit fbd10f9
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions TRACING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* [Agent tracing terminology](#agent-tracing-terminology)
* [Trace modes](#trace-modes)
* [Trace types](#trace-types)
* [Agent shutdown behaviour](#agent-shutdown-behaviour)
* [Enabling tracing](#enabling-tracing)
* [Enabling dynamic tracing](#enabling-dynamic-tracing)
* [Enabling static tracing](#enabling-static-tracing)
Expand Down Expand Up @@ -36,9 +37,7 @@ the following attributes:
- A reference to the span's parent span

All spans need to be *finished*, or *completed*, to allow the OpenTracing
framework to generate the final trace information. This implies that the
agent must be shutdown to obtain a full trace. This will occur after the
workload has ended.
framework to generate the final trace information.

# Jaeger tracing architecture

Expand Down Expand Up @@ -104,7 +103,7 @@ The agent supports two different tracing modes:

| Trace mode | Description | Use-case | VM shutdown controller | Limitations |
|-|-|-|-|-|
| Static | Traces from agent start to agent shutdown. | Obtain holistic view of agent activities. | Agent | None |
| Static | Traces from agent start to agent shutdown. | Obtain holistic view of agent activities. | Agent | Requires systemd - see section [Agent shutdown behaviour](#agent-shutdown-behaviour). |
| Dynamic | Traces begin when the gRPC `StartTracing()` API is called and end when the corresponding `StopTracing()` API is called. | on-demand (partial) tracing. | Runtime | Only "isolated" type supported. |

## Trace types
Expand All @@ -116,6 +115,21 @@ Each trace mode is sub-divided into two different types:
| isolated | The traces only apply to the agent; after the container has been destroyed, the first span will start at agent startup and the last at agent shutdown | Observing agent lifespan. | |
| collated | In this mode, spans are associated with their `kata-runtime` initiated counterparts. | Understanding how the runtime calls the agent. | Requires runtime tracing to be enabled in `configuration.toml` (`enable_tracing=true`). |

# Agent shutdown behaviour

As shown in [Trace modes](#trace-modes) section, the different trace modes
change how the VM is shutdown. In normal operation, the `kata-runtime` manages
the VM shutdown. The **only** scenario when the agent itself is responsible for
shutting down the VM is when static tracing is enabled. In this scenario, the
agent finishes the trace spans and actually exits. The systemd unit that
launches the `kata-agent` detects this and then runs the `ExecStop=` commands,
which shutdown the VM.

> **Note:** that this implies that currently systemd is required for static
> tracing. However, that requirement is not a hard one; the agent could be
> modified to invoke the `ExecStop=` commands itself to avoid having to rely
> on systemd to handle VM shutdown.
# Enabling tracing

## Enabling dynamic tracing
Expand Down

0 comments on commit fbd10f9

Please sign in to comment.