liveBook · Manning

Stack profile

As explained in Cloud Observability in Action

A stack profile is a collected representation of call-stack samples and their associated execution or resource measurements.

A stack profile collects sampled call stacks with measurements of execution or resource use. In a flame graph, each rectangle represents a sampled function or system call; its width indicates call count or time, while vertical position shows stack depth. section 9.1.2

Reading a Go pprof flame graph

A Go pprof example shows slowTask() called by main(). Because slowTask() occupies more CPU than quickTask(), its rectangle is wider. The colors help navigation but carry no inherent meaning. Similar profiles can represent memory, network I/O, garbage collection, or other runtime and operating-system activity. section 9.1.2

message Profile {
  repeated ValueType sample_type = 1;    #1
  repeated Sample sample = 2;            #2
  repeated Mapping mapping = 3;          #3
  repeated Location location = 4;        #4
  repeated Function function = 5;        #5
  repeated string string_table = 6;      #6
  int64 time_nanos = 9;                  #7
  int64 duration_nanos = 10;             #8
  repeated int64 comment = 13;           #9
}

A pprof Profile records sample types, samples, mappings, locations, functions, string data, and timing metadata. section 9.1.2

How Cloud Observability in Action covers it

How deep it goes
Explains rectangles, widths, stack depth, axes, and color limitations, but does not detail profile serialization internals.
Examples
Uses a Go pprof example featuring main(), slowTask(), quickTask(), and a decoded protobuf profile.
What it assumes
Uses call-stack and function-call terminology while introducing stack-profile and flame-graph interpretation.
What you can do after
Diagnose performance hotspots by interpreting flame-graph widths, stack depth, and sampled call paths.
How it connects
Connects call stacks with flame graphs, pprof, CPU profiling, and runtime or operating-system resource profiling.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Cloud Observability in Action. The section links point to the parts of the book it draws on.