Changelog

Improving AppSignal, one deploy at a time.

Oct 24, 2023

Helper for SQL queries and support tooling improvements

Python0.3.2

Added

  • Add the --environment CLI option to the demo CLI tool. This allow you to configure to which app environment the demo samples should be sent. It would default to development (and only be configurable via the APPSIGNAL_APP_ENV environment variable), but now it's configurable through the CLI options as well.

    Shell
    python -m appsignal demo --environment=production
  • Add the set_sql_body tracing helper to set the body attribute on a span that contains a SQL query. When using this helper the given SQL query will be sanitized, reducing the chances of sending sensitive data to AppSignal.

    Python
    from appsignal import set_sql_body # Must be used in an instrumented context -- e.g. a Django or Flask handler def index(): set_sql_body("SELECT * FROM users WHERE 'password' = 'secret'") # Will be stored as: set_sql_body("SELECT * FROM users WHERE 'password' = ?")

    When the set_body helper is also used, the set_sql_body overwrites the set_body attribute.

    More information about our tracing helpers can be found in our documentation.

Changed

  • When the __appsignal__.py file is found in the directory in which the demo and diagnose CLIs are run (python -m appsignal demo or python -m appsignal diagnose), AppSignal will now load the __appsignal__.py file's configuration. When this file is loaded, the demo and diagnose CLI will use the configuration declared in that file to send the demo data and compile a diagnose report. In this scenario, it will no longer prompt you to enter the application configuration manually.

  • Bump agent to 8260fa1

    • Add appsignal.sql_body magic span attribute for OpenTelemetry spans. When this attribute is detected, we store the value as the span/event body. This span is sanitized beforehand so it doesn't contain any sensitive data and helps to group events in our backend. When used in combination with the appsignal.body attribute, the new appsignal.sql_body attribute is leading.

      More information on AppSignal OpenTelemetry span attributes can be found in our docs.

Fixed

  • Validate the AppSignal configuration before starting the AppSignal agent. This prevents the agent from starting with an invalid config and while reporting no data. The AppSignal client and demo CLI will communicate that they could not send any data in this invalid configuration scenario.
  • Fix the agent diagnostic report in diagnose CLI tool (python -m appsignal diagnose). The agent diagnose report would always contain an error, because it did not pick up the AppSignal configuration properly.

See the Python package 0.3.2 changelog for more information.

View all Python updates

Start your free trial

Don’t let the bad bugs bite. Try AppSignal for free.

AppSignal offers a 30-day free trial, no credit card is required. All features are available in all plans. Start monitoring your application in just a few clicks!