# Continuous Profiling

> Inspect CPU flamegraphs and top-function rankings for your Kubernetes services in Last9 Profiling, without leaving the dashboard.

Source: https://last9.io/docs/discover/profiling/

Last9 Profiling shows where CPU time is going inside your services. Open **Profiling** in the left navigation to see a continuous flamegraph and top-functions table for any instrumented service — without leaving Last9.

Profiling is a peer signal to Logs, Traces, and Metrics. You can jump from a slow trace or a firing alert into the flamegraph for the same service and time window.

## Prerequisites

- Profiling data flowing into Last9. See [Kubernetes profiling](/docs/integrations/observability/kubernetes-profiling/) for the eBPF DaemonSet setup.
- A service with the `last9.profiling/enabled: "true"` pod label on at least one workload.
- Profiling enabled for your organization. Contact [support@last9.io](mailto:support@last9.io) if the **Profiling** nav item is not visible.

## Open Profiling

Click **Profiling** in the left navigation (between **Traces** and **Synthetic Monitoring**) or navigate to [app.last9.io/profiles](https://app.last9.io/profiles).

## Select a service

When you open Profiling without a service selected, the page shows all services that have profile data in the current time window as clickable chips. Click a service chip to load its flamegraph.

## Filters

All filters apply immediately (300 ms debounce) and sync to the URL so you can share the exact view.

| Filter           | Description                                                                                                                                                                               |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Service**      | Required to see data. Select from the suggestion chips or the service dropdown.                                                                                                           |
| **Cluster**      | Restrict to profiles from a specific Kubernetes cluster.                                                                                                                                  |
| **Namespace**    | Restrict to profiles from a specific Kubernetes namespace.                                                                                                                                |
| **Env**          | Filter by the `deployment.environment.name` attribute. This is an exact match — selecting `prod` does not also match `production`.                                                        |
| **Runtime**      | Restrict to a specific language runtime: Java, Node, Go, Python, or all.                                                                                                                  |
| **Profile type** | Switch between available profile types (CPU, allocation, wall). Profile types that have no data in the selected window are shown as disabled. Phase 1 ships CPU-only for eBPF collection. |
| **Time range**   | Default is the last 1 hour. Use the time picker to select any window.                                                                                                                     |

## Views

Use the **Flamegraph / Top Functions** toggle to switch between the two views. Switching does not re-fetch data — both views are computed from the same loaded profile.

### Flamegraph

The flamegraph shows the full call-stack tree for the selected service and time window. Width represents cumulative CPU time.

| Interaction   | What it does                                                                                                                                                                                                                                 |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Hover a frame | Shows the function name, self time %, and total time % in a tooltip.                                                                                                                                                                         |
| Click a frame | Zooms into that frame and pins its details panel: function name, self/total samples, stack hash, and file location when available. A breadcrumb at the top tracks the zoom path. Click a breadcrumb entry or press **Esc** to zoom back out. |
| Search        | Type a substring in the search box to highlight matching frames and dim everything else.                                                                                                                                                     |
| Hide runtime  | Toggle off OS and runtime-internal frames (`runtime.*`, `libc.*`, GC, syscall) to focus on application code.                                                                                                                                 |

Frame colors group packages: each unique top-level package (Go package path, Java class root, Node module) gets a consistent color. The **Show top N stacks** note appears when the loaded tree was capped at 1,000 stacks.

### Top Functions

The **Top Functions** table ranks every function by exclusive (self) sample count. Sort by **Self %**, **Total %**, or **Samples**. Function names without file and line information appear when the profiled binary has no debug symbols.

## Share a profile view

The selected service, filters, time range, and view are all synced to the URL. Copy the address bar URL to share the exact view — recipients see the same flamegraph without having to re-select filters.

## Profiling in the service detail tab

Profiling data is also available on the **Profiling** tab inside any service's detail panel in **Discover → Services**. The tab shows a flamegraph scoped to that service with the same time range and controls. If the service has no profiling data, the tab shows a setup prompt.

## Agent-driven profiling investigation

Use [Last9 MCP](/docs/ai/mcp/) to query profiling data from a coding agent or an automated investigation. Four tools are available:

| Tool                   | Use for                                                                                                             |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `get_profile_services` | List services that have profiling data in a time window                                                             |
| `get_profile_summary`  | Short natural-language triage summary for a service — call first to decide whether a deeper investigation is needed |
| `get_top_functions`    | Self-sample function ranking for a service and profile type                                                         |
| `get_flamegraph`       | Full nested flamegraph tree for building a structured report                                                        |

Include `profiles` in `LAST9_TOOLSETS` or use `investigate` (which includes profiling tools). See the [MCP profiling tools reference](/docs/ai/mcp/#continuous-profiling) for parameters.

---

## Troubleshooting

- **No services appear on the landing page**

  Check that at least one workload has the `last9.profiling/enabled: "true"` pod label and that the eBPF profiler DaemonSet is running. Use `kubectl rollout status daemonset/last9-profiler --namespace last9-profiler` to confirm. Widen the time range — new data takes up to a few minutes to appear.

- **Frames show as `[unknown]`**

  The eBPF profiler records stacks but cannot always resolve symbols for stripped binaries or shell-only images. Use a Go, Java, or Node workload built with debug symbols to verify the pipeline before profiling production services. Unknown frames from historical data are not re-symbolized after ingestion.

- **Profile type is disabled (greyed out)**

  The selected service has no data for that profile type in the current window. Phase 1 collects CPU profiles only. Other types (allocation, wall) appear when data is available.

- **Profiling nav item not visible**

  Profiling is currently in early access. Contact [support@last9.io](mailto:support@last9.io) to enable it for your organization.

## Related

- [Kubernetes profiling setup](/docs/integrations/observability/kubernetes-profiling/) — install the eBPF DaemonSet and send profiles to Last9
- [Last9 MCP profiling tools](/docs/ai/mcp/#continuous-profiling) — query profiles from a coding agent
- [Investigate an incident with AI](/docs/ai/investigate-an-incident/) — correlate profiles with traces and logs in a single investigation

Please get in touch with us on [Discord](https://discord.com/invite/Q3p2EEucx9) or [Email](mailto:support@last9.io) if you have any questions.
