AppSignal for Python: Diagnose tool

AppSignal for PythonThis feature requires version 0.2.0 or higher.

The AppSignal for Python package includes a self-diagnostic tool that can be used to debug the installation and configuration of your AppSignal integration. It is one of the first tools that our support team requests you to run when debugging an issue.

The diagnostic report

You can use this diagnostic tool to test and validate your AppSignal installation. It outputs useful information to debug issues and it checks if AppSignal agent is able to run on the machine's architecture and communicate with the AppSignal servers.

This diagnostic tool collects and outputs the following:

  • Information about the AppSignal package.
  • Information about the host system and Python.
  • If the AppSignal agent can run on the host system.
  • All configured configuration options (including default values).
  • If the configuration is valid and active.
  • If the Push API key is present and valid (internet connection required).
  • Where configuration option values originate from.
  • If the required system paths exist, are writable, and which user and group are owners.
  • Small parts of the tail from the available log files.

You can read more about how to use the diagnose command in our Debugging documentation.

Submitting the report

After the report has been created, you will be prompted to send the report to our servers. If this prompt is accepted, the report will be send to our servers and you will receive a support token.

When you send this support token to us we will review the report and help you debug the issue. We've seen that copy-pasting the report output usually loses formatting and makes it harder to read, which is why it's send to our servers in the JSON format.

After sending the report to our servers, a link to the web view of the report is printed in the diagnose output. This web view will also show any validation problems and warnings our system detected.

Usage

On the command-line in your project run:

bash
python -m appsignal diagnose

If you're experiencing an issue in production and need to send the report to AppSignal for support, you can run the following command to generate and send the report to our servers:

bash
python -m appsignal diagnose --send-report

Options

OptionUsageDescription
[no]-send-report--[no-]send-reportAutomatically send, or do not send the report.

Report submission flag

Using the --send-report flag it's possible to automatically send the report without being prompted. This makes it easier to use in non-interactive environments.

To run diagnose and submit the report data to AppSignal, run the below command:

bash
python -m appsignal diagnose --send-report

To run diagnose without sending the report data to AppSignal, run the below command:

bash
python -m appsignal diagnose --no-send-report

Configuration output format

Configuration option values format

The configuration options are printed to the CLI as their inspected values. This means we print them as Python would in a console.

  • Strings values are printed with double quotes around them, e.g. "My app name".
  • Booleans values are printed as their raw values: True and False.
  • Arrays values are printed as a collection of values surrounded by square brackets, e.g. ["accept", "accept-charset"].
    • Empty Arrays are printed as two square brackets: [].

Configuration sources

The configuration section also displays the origin of config option values, which can help identify sources that override values defined in other config sources.

You can read more about configuration sources their load order, and priority in the configuration load order documentation.

The configuration options are displayed based on the source of their values and the number of sources that set them, like in the below example:

shell
Configuration # Option with a value loaded only from the default source send_params: True # Option with one source # A different source than the default source name: "My app name" (Loaded from file) # Option with multiple sources # Listed in order of priority (highest priority last) active: True Sources: default: False file: False env: True