Helper for SQL queries and support tooling improvements
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 theAPPSIGNAL_APP_ENV
environment variable), but now it's configurable through the CLI options as well.Shellpython -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.Pythonfrom 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, theset_sql_body
overwrites theset_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
orpython -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 theappsignal.body
attribute, the newappsignal.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.