Changelog

Improving AppSignal, one deploy at a time.

May 06, 2024

Support PostgreSQL and MySQL database adapters

Python1.3.2

Add support for the aiopg, asyncpg, mysql (from the mysql-connector-python package), mysqlclient, and pymysql database adapters.

To enable AppSignal to instrument queries performed using these packages, follow the instructions in our PostgreSQL and MySQL documentation pages.


See the Python package 1.3.2 changelog for more information.

Apr 29, 2024

Support SQLAlchemy and SQLite

Python1.3.1

Add support for SQLAlchemy, SQLite and version 3 of the psycopg PostgreSQL adapter.

To enable AppSignal to instrument queries performed using these packages, follow the instructions in our SQLAlchemy, SQLite and PostgreSQL documentation pages.


See the Python package 1.3.1 changelog for more information.

Apr 22, 2024

Add heartbeats

Python1.3.0

Heartbeats are currently only available to beta testers. If you are interested in trying it out, send an email to support@appsignal.com!


Add heartbeats support. You can use the heartbeat function to send heartbeats directly from your code, to track the execution of certain processes:

python
from appsignal import heartbeat def send_invoices(): # ... your code here ... heartbeat("send_invoices")

It is also possible to pass a defined function as an argument to the heartbeat function:

python
def send_invoices(): # ... your code here ... heartbeat("send_invoices", send_invoices)

If an exception is raised within the function, the finish event will not be reported to AppSignal, triggering a notification about the missing heartbeat. The exception will be raised outside of the heartbeat function.


See the Python package 1.3.0 changelog for more information.

Apr 15, 2024

Fix Flask 404 spans

Python1.2.1

When Flask apps received requests that didn't match with any app routes, those 404s were instrumented. This made the actions panel to show tons of actions corresponding to bots requests and the like, giving no meaningful information. This has been fixed and 404s will only be reported if they are part of your Flask app.

Mar 20, 2024

Add minutely probes and other improvements

Python1.2.0

Add minutely probes

Add a minutely probes system. This can be used, alongside our metric helpers, to report metrics to AppSignal once per minute.

python
from appsignal import probes, set_gauge def new_carts(previous_carts=None): current_carts = Cart.objects.all().count() if previous_carts is not None: set_gauge("new_carts", current_carts - previous_carts) return current_carts probes.register("new_carts", new_carts)

The minutely probes system starts by default, but no probes are automatically registered. You can use the enable_minutely_probes configuration option to disable it.

Add CPU count configuration option

Implement CPU count configuration option. Use it to override the auto-detected, cgroups-provided number of CPUs that is used to calculate CPU usage percentages.

To set it, use the the cpu_count configuration option or the APPSIGNAL_CPU_COUNT environment variable.

Fix ASGI events showing up as slow API requests

Fix ASGI events, from Python ASGI applications that have been instrumented with AppSignal, mistakenly showing up in the "Slow API requests" panel.

Mar 11, 2024

Add distribution value custom metric helper

Python1.1.1

Add distribution value custom metric helper. This can be used to add values to distributions in the same way as in our other integrations:

python
# Import the AppSignal metric helper from appsignal import add_distribution_value # The first argument is a string, the second argument a number (int/float) # add_distribution_value(metric_name, value) add_distribution_value("memory_usage", 100) add_distribution_value("memory_usage", 110) # Will create a metric "memory_usage" with the mean field value 105 # Will create a metric "memory_usage" with the count field value 2

See the Python package 1.1.1 changelog for more information.

Mar 04, 2024

Improved container CPU metrics, fix long running traces, histogram support

Python1.1.0

Added

  • Add histogram support to the OpenTelemetry HTTP server. This allows OpenTelemetry-based instrumentations to report histogram data to AppSignal as distribution metrics.

Changed

  • Breaking change: Normalize CPU metrics for cgroups v1 systems. When we can detect how many CPUs are configured in the container's limits, we will normalize the CPU percentages to a maximum of 100%. This is a breaking change. Triggers for CPU percentages that are configured for a CPU percentage higher than 100% will no longer trigger after this update. Please configure triggers to a percentage with a maximum of 100% CPU percentage.
  • Make the debug log message for OpenTelemetry spans from libraries we don't automatically recognize more clear. Mention the span id and the instrumentation library.
  • Fix an issue where queries containing a MySQL leading type indicator would only be partially sanitised.
  • Support fractional CPUs for cgroups v2 metrics. Previously a CPU count of 0.5 would be interpreted as 1 CPU. Now it will be correctly seen as half a CPU and calculate CPU percentages accordingly.
  • Update bundled trusted root certificates.

Fixed

  • Fix (sub)traces not being reported in their entirety when the OpenTelemetry exporter sends one trace in multiple export requests. This would be an issue for long running traces, that are exported in several requests.

See the Python package 1.1.0 changelog for more information.

Jan 15, 2024

Fix Alpine Linux disk usage metrics

Python1.0.4

Changed

  • Fix disk usage returning a Vec with no entries on Alpine Linux when the df --local command fails.

Fixed

  • Fix missing error metrics for the error rate and error count graphs in some scenarios, like with Node.js Koa apps.

See the Python package 1.0.4 changelog for more information.

Nov 29, 2023

Better Requests spans and other improvements

Python1.0.3

Changed

  • Improve extraction of OpenTelemetry span details from the Requests library, by using the HTTP method, scheme, host and port as the event name. This improves grouping in the "Slow API requests" performance panel.
  • Remove extra HTTP attributes from Django root spans.
  • Remove route tag from HTTP server spans. Since the span will already have the route attribute as part of its name, the tag is redundant.
  • Filter more disk mountpoints for disk usage and disk IO stats. This helps reduce noise in the host metrics by focussing on more important mountpoints. Any mountpoint containing /etc/hostname, /etc/hosts, /etc/resolv.conf, /snap/ or /proc/ is ignored.

Fixed

  • Fix an issue where the method tag extracted from an incoming HTTP request span would be overriden with the method used for an outgoing HTTP request span.
  • Support disk usage reporting (using df) on Alpine Linux. This host metric would report an error on Alpine Linux.
  • When a disk mountpoint has no inodes usage percentage, skip the mountpoint, and report the inodes information successfully for the inodes that do have an inodes usage percentage.

See the Python package 1.0.3 changelog for more information.

Nov 21, 2023

CPU stats normalization for cgroups v2

Python1.0.2

Changed

  • CPU usage is now normalized to the number of CPUs available to the container. This means that a container with 2 CPUs will have its CPU usage reported as 50% when using 1 CPU instead of 100%. This is a breaking change for anyone using the cpu probe.
    • If you have CPU triggers set up based on the old behaviour, you might need to update those to these new normalized values to get the same behaviour. Note that this is needed only if the AppSignal integration package you're using includes this change.
  • SQL queries are now sanitized before truncating them. This improves the way long queries are shown in the UI.

Fixed

  • Fix the metadata on the demo CLI's example samples. It will no longer contain unused attributes.
  • Fix a crash on the diagnose report when attempting to report the platform for which AppSignal for Python was installed.

See the Python package 1.0.2 changelog for more information.

Nov 02, 2023

Python diagnose report improvements

Python1.0.1
  • Report the agent's architecture and platform in the diagnose report as the "Agent architecture" field. This helps debug if the installed package version matches the host architecture and platform. If they do not match, the package for the wrong architecture is installed.

  • Report the package install path in the diagnose report as the "Package install path" field. This field will help us debug issues related to paths in the diagnose report viewer.

  • Report whether the app is running in a container in the diagnose report as the "Running in container" field. This field will help notify us about the environment in which the app is running, as containers have different behavior from more standard Virtual Machines.

  • Bump agent to b604345.

    • Add an exponential backoff to the retry sleep time to bind to the StatsD, NGINX and OpenTelemetry exporter ports. This gives the agent a longer time to connect to the ports if they become available within a 4 minute window.
    • Changes to the agent logger:
      • Logs from the agent and extension now use a more consistent format in logs for spans and transactions.
      • Logs that are for more internal use are moved to the trace log level and logs that are useful for debugging most support issues are moved to the debug log level. It should not be necessary to use log level 'trace' as often anymore. The 'debug' log level should be enough.
    • Add running_in_container to agent diagnose report, to be used primarily by the Python package as a way to detect if an app's host is a container or not.

See the Python package 1.0.1 changelog for more information.

Oct 31, 2023

Python package version 1.0!

Python1.0.0

Release AppSignal for Python package version 1.0!

Read our Python package version 1.0 announcement blog post!

This release marks the 1.0 release of our Python integration and contains the following features:

  • Track errors in your app.
  • Track performance of HTTP endpoints and background jobs.
  • Dive into more detail with custom instrumentation.
  • View host metrics for Virtual Machines and containers on which the app is running.
  • Report custom metrics that are unique to your app, and get alerted when they change.
  • Deploy tracking whenever a new version of your application gets deployed.
  • Automatic support for the following frameworks and libraries:
    • Celery
    • Django
    • FastAPI
    • Flask
    • Jinja2
    • Psycopg2
    • Redis
    • Requests
    • Starlette
    • WSGI/ASGI

Please see our Python package documentation and guides for more information. Reach out to us on support@appsignal.com if you need any help 👋

Changed

  • The diagnose CLI will now print more details about each path in diagnose CLI output, such as if it exists or not, if it's writable and the ownership details. This will help with debugging path related issues without sending the report to the AppSignal servers.
  • Rename the example error reported by our installer and demo CLIs from ValueError to DemoError to better communicate this is an example error and should not be treated as a real error from the app.
  • Add a message about committing the Push API key in the client file upon generation. We recommend storing this key in environment variables instead or in some kind of separate credentials system instead.

Fixed

  • Fix an issue where the installer would always find the push API key to be invalid, halting the installation process.
  • Fix the diagnose report CLI exiting with an error when a path was not found. When a file, like the appsignal.log file, was not found, the diagnose CLI would exit with an error when trying to read from the file. It will now no longer try to read a non-existing file and no longer error.
  • Fix the demo error and performance incidents that are reported by our install and demo CLI tools to recognize them by our front-end as examples. It will now show the intended box with some additional explanation that you don't have to worry about these example errors and performance measurements. They're there to test if our integration works in your app and report the first bits of data.

See the Python package 1.0.0 changelog for more information.

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.

Oct 16, 2023

Memory metric in percentage and bug fixes

Python0.3.1

Added

  • Add memory_in_percentages and swap_in_percentages host metrics that represents metrics in percentages.

Changed

  • Ignore /snap/ disk mountpoints.

Fixed

  • Fix issue with the open span count in logs being logged as a negative number.
  • Fix agent's TCP server getting stuck when two requests are made within the same fraction of a second.

See the Python package 0.3.1 changelog for more information.

Oct 03, 2023

Counters and gauges support

Python0.3.0

Added

  • Support OpenTelemetry metrics through its metrics exporter. We enable the metrics exporter by default so it can be used to collect data from instrumentations and manually by using an OpenTelemetry metrics meter. Not all metric types are supported at this time, only counters (sums) and gauges.

  • Add error helpers. These helpers simplify reporting errors to AppSignal that are not handled automatically by your framework, alongside the current instrumented context or separately. For example, to report an error from an except clause as a separate sample:

    python
    from appsignal import send_error def index(): cookies = put_hand_in_cookie_jar() except HandStuckError as error: send_error(error)

    More information about error helpers is available in our documentation.

  • Add sample data helpers. These helpers simplify adding properties to OpenTelemetry spans that display specific data in the AppSignal sample UI. For example, to add custom data to the current sample:

    python
    from appsignal import set_custom_data # Must be used in an instrumented context -- e.g. a Flask handler @app.get("/") def index(): set_custom_data({"hello": "there"})

    The full list of sample data helpers is available in our documentation as part of the tagging and sample data guides and namespace guide.

  • Add helper for reporting counter metrics to AppSignal using OpenTelemetry. Use these helpers to simplify sending counter metrics as supported by AppSignal.

    python
    from appsignal import increment_counter # Report a counter increasing increment_counter("counter_name", 1) # Report a counter decreasing increment_counter("counter_name", -1) # Add tags to counter increment_counter("counter_with_tags", 1, {"tag1": "value1"})

    Consult our documentation for more information about AppSignal's custom metrics.

  • Add helper for reporting gauge metrics to AppSignal using OpenTelemetry. Use these helpers to simplify sending gauge metrics as supported by AppSignal.

    python
    from appsignal import set_gauge # Report a gauge value set_gauge("gauge_name", 10) # Add tags to metrics set_gauge("gauge_with_tags", 10, {"tag1": "value1"})

    Consult our documentation for more information about AppSignal's custom metrics.

Changed

  • Bump agent to 6133900.
    • Fix disk_inode_usage metric name format to not be interpreted as a JSON object.
    • Convert all OpenTelemetry sum metrics to AppSignal non-monotonic counters.
    • Rename standalone agent's role option to host_role so it's consistent with the integrations naming.

See the Python package 0.3.0 changelog for more information.

Aug 28, 2023

Installer fix using `python -m appsignal`

Python0.2.3

Fixed

  • Fix CLI using python -m appsignal. It would error with a ModuleNotFoundError.

See the Python package 0.2.3 changelog for more information.

Aug 22, 2023

Ports and host role config options

Python0.2.2

Added

  • Add the statsd_port config option to change the StatsD UDP server port of the appsignal-agent process. By default the port is set to 8125.
  • Add the host_role config option. This config option can be set per host to generate some metrics automatically per host and possibly do things like grouping in the future.
  • Add the OpenTelemetry HTTP server port config option (opentelemetry_port) to configure on which port the appsignal-agent server process will listen for OpenTelemetry data from the HTTP exporter. This can be used to configure two apps on the same machine to use different ports so it's possible to run two AppSignal apps on the same machine. See our Running multiple applications on one host docs page for more information.

Changed

  • Bump agent to version d789895.
    • Increase short data truncation from 2000 to 10000 characters.

See the Python package 0.2.2 changelog for more information.

Aug 14, 2023

Deprecate appsignal-beta package

Python0.2.1

Warn if the appsignal-beta package is present in the dependencies list to nudge people into switching to the new appsignal package. If you have appsignal-beta as a dependency in your project, please update it to say appsignal instead.

See the Python package 0.2.1 changelog for more information.

Aug 11, 2023

New Python package name!

Python0.2.0

In this release we've renamed the AppSignal for Python package to appsignal (previously appsignal-beta)! Please update your dependencies (for example, in requirements.txt) accordingly.

Added

  • Use RENDER_GIT_COMMIT environment variable as revision if no revision is specified.
  • Allow configuration of the agent's TCP and UDP servers using the bind_address config option. This is by default set to 127.0.0.1, which only makes it accessible from the same host. If you want it to be accessible from other machines, use 0.0.0.0 or a specific IP address.
  • Report total CPU usage host metric for VMs. This change adds another state tag value on the cpu metric called total_usage, which reports the VM's total CPU usage in percentages.
  • Add diagnose command for easier debugging.

Changed

  • Rename package from appsignal-beta to appsignal. Please update your dependencies (for example, in requirements.txt) accordingly.
  • Bump agent to 32590eb.
    • Only ignore disk metrics that start with "loop", not all mounted disks that end with a number to report metrics for more disks.
  • Bump agent to 6bec691.
    • Upgrade sql_lexer to v0.9.5. It adds sanitization support for the THEN and ELSE logical operators.

See the Python package 0.2.0 changelog for more information.

Jun 27, 2023

Support for ASGI-based frameworks

Python0.1.4

Add support for ASGI-based frameworks such as FastAPI and Starlette.

See the changelog for more information.

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!