The purpose of this page is to guide users towards tools that may solve
common questions that a Fuchsia developer may have.

## Problems

- [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/reference/troubleshooting/_problems.yaml&searchAndJump=-+key:+%22Runtime+Observation%22 "Edit the Runtime Observation problem")

  ### Runtime Observation

  I want to understand what my component is doing at runtime.

  *** ** * ** ***

  #### Tools

  - Inspect
  - Expose structured diagnositcs information about the state of a component. This helps to monitor the state of a component at an given point in time. The Inspect tool allows a component to expose an arbitrary hierarchy of typed key/value pairs and update it over the course of its execution. This data can be snapshotted and inspected while the component is still running. Inspect is commonly used to represent information about the working set and recent history of a component to help during debugging. A component developer can use Inspect by depending on a library in their language of choice (Rust, C++), and calling the appropriate methods to mutate their recorded state. Inspect data may be read using the `ffx inspect` tool or `ffx target snapshot`.
    - [Overview](https://fuchsia.dev/docs/development/diagnostics/inspect/README)
    - [Quickstart](https://fuchsia.dev/docs/development/diagnostics/inspect/quickstart)
    - [Health check](https://fuchsia.dev/docs/development/diagnostics/inspect/health)
    - [Rust libraries](https://fuchsia.dev/docs/development/diagnostics/inspect/rust)
    - [Codelab - Using Inspect](https://fuchsia.dev/docs/development/diagnostics/inspect/codelab)
  - Logs
  - Print string logs during the execution of a component. Fuchsia, like many systems, supports basic logging of strings to record some information when particular lines of source code are executed. Logs are aggregated by the Archivist component. They may be read using \`ffx log\`.
    - [Overview](https://fuchsia.dev/docs/development/diagnostics/logs/README)
    - [Recording logs](https://fuchsia.dev/docs/development/diagnostics/logs/recording)
    - [Log record severity](https://fuchsia.dev/docs/development/diagnostics/logs/severity)
    - [Viewing logs](https://fuchsia.dev/docs/development/diagnostics/logs/viewing)
    - [Additional logging workflows](https://fuchsia.dev/docs/development/diagnostics/test_and_logs)
  - Structured Logs
  - Store structured key/value pairs in log messages. In addition to text-based logs, Fuchsia supports fully structured log records encoded as typed key/value hierarchies. Developers may write structured logs using the `tracing` crate macros in Rust or the `FX_SLOG` macro in C++.
    - [Structured log encoding reference](https://fuchsia.dev/docs/reference/platform-spec/diagnostics/logs-encoding)
  - Tracing
  - Fuchsia's tracing system offers a comprehensive way to collect, aggregate, and visualize diagnostic tracing information from the Fuchsia user space processes and the Zircon kernel. Traces, like logs, represent events from a Fuchsia system, but are fine grained, higher frequency and are meant for machine consumption to compute other insights and visualizations.
    - [Tracing documentation](https://fuchsia.dev/docs/concepts/kernel/tracing-system)
    - [Tracing guides](https://fuchsia.dev/docs/development/tracing/README)
    - [Use trace events](https://fuchsia.dev/docs/development/tracing/trace_events)
    - [Tutorial on Fuchsia tracing](https://fuchsia.dev/docs/development/tracing/tutorial/README)
    - [Fuchsia trace format](https://fuchsia.dev/docs/reference/tracing/trace-format)
  - zxdb
  - zxdb is a console-mode debugger for native code running on Fuchsia.
    - [zxdb documentation](https://fuchsia.dev/docs/development/debugger/README)
    - [Tutorial - Debug tests using zxdb](https://fuchsia.dev/docs/development/debugger/tutorial-tests)
    - [Tutorial - Debug minidumps using zxdb](https://fuchsia.dev/docs/development/debugger/tutorial-minidumps)

  <!-- -->

  *** ** * ** ***

- [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/reference/troubleshooting/_problems.yaml&searchAndJump=-+key:+%22Snapshot+Triage%22 "Edit the Snapshot Triage problem")

  ### Snapshot Triage

  I want to automatically post-process snapshots to identify notable
  values or error conditions

  *** ** * ** ***

  #### Tools

  - Triage
  - Triage selects and processes values from Diagnostics data, producing useful actions and insights on-device and off-device. Triage can: display calculated values; file snapshots (when running on-device as the engine of Detect); and print warnings about off-nominal values.
    - [Triage documentation](https://fuchsia.dev/docs/development/diagnostics/triage/fx_triage)

  <!-- -->

  *** ** * ** ***

- [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/reference/troubleshooting/_problems.yaml&searchAndJump=-+key:+%22Trigger+Snapshot%22 "Edit the Trigger Snapshot problem")

  ### Trigger Snapshot

  I want to automatically trigger taking a snapshot on a specific condition

  *** ** * ** ***

  #### Tools

  - Detect
  - Detect scans Inspect data on-device to decide when to file crash reports. Detect scans are configured using the Triage language and run every few minutes.
    - [Detect - Snapshot filing](https://fuchsia.dev/docs/development/diagnostics/analytics/detect)

  <!-- -->

  *** ** * ** ***

- [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/reference/troubleshooting/_problems.yaml&searchAndJump=-+key:+%22Trace+a+function%22 "Edit the Trace a function problem")

  ### Trace a function

  I want to measure the runtime of specific functions

  *** ** * ** ***

  #### Tools

  - Tracing
  - Fuchsia's tracing system offers a comprehensive way to collect, aggregate, and visualize diagnostic tracing information from the Fuchsia user space processes and the Zircon kernel. Traces, like logs, represent events from a Fuchsia system, but are fine grained, higher frequency and are meant for machine consumption to compute other insights and visualizations.
    - [Tracing documentation](https://fuchsia.dev/docs/concepts/kernel/tracing-system)
    - [Tracing guides](https://fuchsia.dev/docs/development/tracing/README)
    - [Use trace events](https://fuchsia.dev/docs/development/tracing/trace_events)
    - [Tutorial on Fuchsia tracing](https://fuchsia.dev/docs/development/tracing/tutorial/README)
    - [Fuchsia trace format](https://fuchsia.dev/docs/reference/tracing/trace-format)

  <!-- -->

  *** ** * ** ***

- [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/reference/troubleshooting/_problems.yaml&searchAndJump=-+key:+%22Collect+metrics+from+devices%22 "Edit the Collect metrics from devices problem")

  ### Collect metrics from devices

  I want to collect metrics from user-owned devices in the field

  *** ** * ** ***

  #### Tools

  - Cobalt
  - Cobalt is a pipeline for collecting metrics data from user-owned devices in the field and producing aggregated reports. Cobalt includes a suite of features for preserving user privacy and anonymity while giving product owners the data they need to improve their products.
    - [Cobalt - Telemetry with built-in privacy](https://fuchsia.googlesource.com/cobalt/+/main/README.md)

  <!-- -->

  *** ** * ** ***

## Tools

- [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/reference/troubleshooting/_problems.yaml&searchAndJump=-+key:+%22Inspect%22 "Edit the Inspect problem")

  ### Inspect

  Expose structured diagnositcs information about the state of a component.
  This helps to monitor the state of a component at an given point in time.

  The Inspect tool allows a component to expose an arbitrary hierarchy of typed
  key/value pairs and update it over the course of its execution. This data can
  be snapshotted and inspected while the component is still running.

  Inspect is commonly used to represent information about the working set and
  recent history of a component to help during debugging.

  A component developer can use Inspect by depending on a library in their
  language of choice (Rust, C++), and calling the appropriate methods to mutate
  their recorded state.

  Inspect data may be read using the `ffx inspect`
  tool or `ffx target snapshot`.

  *** ** * ** ***

  Problems that Inspect can solve:
  - I want to understand what my component is doing at runtime.

  *** ** * ** ***

  - [Overview](https://fuchsia.dev/docs/development/diagnostics/inspect/README)
  - [Quickstart](https://fuchsia.dev/docs/development/diagnostics/inspect/quickstart)
  - [Health check](https://fuchsia.dev/docs/development/diagnostics/inspect/health)
  - [Rust libraries](https://fuchsia.dev/docs/development/diagnostics/inspect/rust)
  - [Codelab - Using Inspect](https://fuchsia.dev/docs/development/diagnostics/inspect/codelab)

  #### Related tools

  - Triage

  *** ** * ** ***

- [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/reference/troubleshooting/_problems.yaml&searchAndJump=-+key:+%22Logs%22 "Edit the Logs problem")

  ### Logs

  Print string logs during the execution of a component.

  Fuchsia, like many systems, supports basic logging of strings to record some information
  when particular lines of source code are executed.

  Logs are aggregated by the Archivist component. They may be read using \`ffx log\`.

  *** ** * ** ***

  Problems that Logs can solve:
  - I want to understand what my component is doing at runtime.

  *** ** * ** ***

  - [Overview](https://fuchsia.dev/docs/development/diagnostics/logs/README)
  - [Recording logs](https://fuchsia.dev/docs/development/diagnostics/logs/recording)
  - [Log record severity](https://fuchsia.dev/docs/development/diagnostics/logs/severity)
  - [Viewing logs](https://fuchsia.dev/docs/development/diagnostics/logs/viewing)
  - [Additional logging workflows](https://fuchsia.dev/docs/development/diagnostics/test_and_logs)

  #### Related tools

  - Structured Logs

  *** ** * ** ***

- [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/reference/troubleshooting/_problems.yaml&searchAndJump=-+key:+%22Structured+Logs%22 "Edit the Structured Logs problem")

  ### Structured Logs

  Store structured key/value pairs in log messages.

  In addition to text-based logs, Fuchsia supports fully structured
  log records encoded as typed key/value hierarchies.

  Developers may write structured logs using the `tracing` crate macros in Rust
  or the `FX_SLOG` macro in C++.

  *** ** * ** ***

  Problems that Structured Logs can solve:
  - I want to understand what my component is doing at runtime.

  *** ** * ** ***

  - [Structured log encoding reference](https://fuchsia.dev/docs/reference/platform-spec/diagnostics/logs-encoding)

  *** ** * ** ***

- [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/reference/troubleshooting/_problems.yaml&searchAndJump=-+key:+%22Persistence%22 "Edit the Persistence problem")

  ### Persistence

  Persistence stores Inspect data and publishes it on the subsequent boot.

  Sometimes Diagnostics data can't be exported from the device until it's
  rebooted, for example, if there's a problem with networking. Persistence
  writes selected Inspect data to disk and then publishes it back to Inspect
  on the next boot.

  *** ** * ** ***

  Problems that Persistence can solve:

  *** ** * ** ***

  - [Persistence documentation](https://fuchsia.dev/docs/development/diagnostics/analytics/persistence)

  #### Related tools

  - Inspect

  *** ** * ** ***

- [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/reference/troubleshooting/_problems.yaml&searchAndJump=-+key:+%22Sampler%22 "Edit the Sampler problem")

  ### Sampler

  Sampler reads data from Inspect and forwards it to Cobalt.

  Sampler provides an easy way to send data to Cobalt. Instead of linking
  your app to the Cobalt service and using it directly, you can just publish
  your data in Inspect and write a simple config file entry to tell Sampler
  to fetch your data and send it to Cobalt.

  *** ** * ** ***

  Problems that Sampler can solve:

  *** ** * ** ***

  - [Sampler documentation](https://fuchsia.dev/docs/development/diagnostics/analytics/sampler)

  #### Related tools

  - Inspect

  *** ** * ** ***

- [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/reference/troubleshooting/_problems.yaml&searchAndJump=-+key:+%22Tracing%22 "Edit the Tracing problem")

  ### Tracing

  Fuchsia's tracing system offers a comprehensive way to collect,
  aggregate, and visualize diagnostic tracing information from the
  Fuchsia user space processes and the Zircon kernel. Traces, like
  logs, represent events from a Fuchsia system, but are fine grained,
  higher frequency and are meant for machine consumption to compute
  other insights and visualizations.

  *** ** * ** ***

  Problems that Tracing can solve:
  - I want to understand what my component is doing at runtime.
  - I want to measure the runtime of specific functions

  *** ** * ** ***

  - [Tracing documentation](https://fuchsia.dev/docs/concepts/kernel/tracing-system)
  - [Tracing guides](https://fuchsia.dev/docs/development/tracing/README)
  - [Use trace events](https://fuchsia.dev/docs/development/tracing/trace_events)
  - [Tutorial on Fuchsia tracing](https://fuchsia.dev/docs/development/tracing/tutorial/README)
  - [Fuchsia trace format](https://fuchsia.dev/docs/reference/tracing/trace-format)

  #### Related tools

  - Inspect
  - Logs

  *** ** * ** ***

- [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/reference/troubleshooting/_problems.yaml&searchAndJump=-+key:+%22Triage%22 "Edit the Triage problem")

  ### Triage

  Triage selects and processes values from Diagnostics data, producing
  useful actions and insights on-device and off-device.

  Triage can: display calculated values; file snapshots (when running
  on-device as the engine of Detect); and print warnings about
  off-nominal values.

  *** ** * ** ***

  Problems that Triage can solve:
  - I want to automatically post-process snapshots to identify notable values or error conditions

  *** ** * ** ***

  - [Triage documentation](https://fuchsia.dev/docs/development/diagnostics/triage/fx_triage)

  #### Related tools

  - Inspect
  - Detect

  *** ** * ** ***

- [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/reference/troubleshooting/_problems.yaml&searchAndJump=-+key:+%22Cobalt%22 "Edit the Cobalt problem")

  ### Cobalt

  Cobalt is a pipeline for collecting metrics data from user-owned devices in
  the field and producing aggregated reports.

  Cobalt includes a suite of features for preserving user privacy and
  anonymity while giving product owners the data they need to improve their
  products.

  *** ** * ** ***

  Problems that Cobalt can solve:
  - I want to collect metrics from user-owned devices in the field

  *** ** * ** ***

  - [Cobalt - Telemetry with built-in privacy](https://fuchsia.googlesource.com/cobalt/+/main/README.md)

  *** ** * ** ***

- [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/reference/troubleshooting/_problems.yaml&searchAndJump=-+key:+%22Detect%22 "Edit the Detect problem")

  ### Detect

  Detect scans Inspect data on-device to decide when to file crash reports.

  Detect scans are configured using the Triage language and run every
  few minutes.

  *** ** * ** ***

  Problems that Detect can solve:
  - I want to automatically trigger taking a snapshot on a specific condition

  *** ** * ** ***

  - [Detect - Snapshot filing](https://fuchsia.dev/docs/development/diagnostics/analytics/detect)

  #### Related tools

  - Inspect
  - Triage

  *** ** * ** ***

- [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/reference/troubleshooting/_problems.yaml&searchAndJump=-+key:+%22zxdb%22 "Edit the zxdb problem")

  ### Zxdb

  zxdb is a console-mode debugger for native code running on Fuchsia.

  *** ** * ** ***

  Problems that zxdb can solve:
  - I want to understand what my component is doing at runtime.

  *** ** * ** ***

  - [zxdb documentation](https://fuchsia.dev/docs/development/debugger/README)
  - [Tutorial - Debug tests using zxdb](https://fuchsia.dev/docs/development/debugger/tutorial-tests)
  - [Tutorial - Debug minidumps using zxdb](https://fuchsia.dev/docs/development/debugger/tutorial-minidumps)

  *** ** * ** ***

[](https://issues.fuchsia.dev/issues/new?component=1439230&template=1881640&description=Issue+on:+https://fuchsia.dev/docs/reference/troubleshooting/README.md "Report a bug or suggest improvements on this page") [](https://cs.opensource.google/fuchsia/fuchsia/+/main:docs/reference/troubleshooting/README.md "View the source code of this page") [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/reference/troubleshooting/README.md&cloneRepo=fuchsia/fuchsia:refs/heads/main&fullPath=fuchsia/docs/reference/troubleshooting/README.md "Edit the source code of this page")