Changelog

Improving AppSignal, one deploy at a time.

Oct 09, 2024

Add support for heartbeat check-ins

Python1.4.0

Added

  • Add support for heartbeat check-ins.

    Use the appsignal.check_in.heartbeat function to send a single heartbeat check-in event from your application. This can be used, for example, in your application's main loop:

    Python
    from appsignal.check_in import heartbeat while True: heartbeat("job_processor") process_job()

    Heartbeats are deduplicated and sent asynchronously, without blocking the current thread. Regardless of how often the .heartbeat function is called, at most one heartbeat with the same identifier will be sent every ten seconds.

    Pass continuous=True as the second argument to send heartbeats continuously during the entire lifetime of the current process. This can be used, for example, after your application has finished its boot process:

    Python
    def main(): start_app() heartbeat("my_app", continuous=True)

Changed

  • Change the primary download mirror for integrations.
  • Send check-ins concurrently. When calling appsignal.check_in.cron, instead of blocking the current thread while the check-in events are sent, schedule them to be sent in a separate thread.

View the Python package v1.4.0 changelog for more information.

Aug 19, 2024

Python package v1.3.9

Python1.3.9

Added

  • Add helper to manually stop the agent process for this AppSignal instance.

    Some contexts, like serverless functions, exit before AppSignal can ensure all data is sent to our servers. To ensure the data is sent, the new appsignal.stop() method can be called to gracefully stop the AppSignal agent process.

View the Python package v1.3.9 changelog for more information.

Aug 14, 2024

Rename heartbeats to cron check-ins

Python1.3.8

Changed

  • Rename heartbeats to cron check-ins. Calls to appsignal.heartbeat and appsignal.Heartbeat should be replaced with calls to appsignal.check_in.cron and appsignal.check_in.Cron, for example:

    Python
    # Before from appsignal import heartbeat def do_something(): pass heartbeat("do_something", do_something) # After from appsignal.check_in import cron def do_something(): pass cron("do_something", do_something)

Deprecated

  • Calls to appsignal.heartbeat and to the appsignal.Heartbeat constructor will emit a deprecation warning.

View the Python package v1.3.8 changelog for more information.

Jun 11, 2024

Python package v1.3.5

Python1.3.5

Added

  • Add basic OpenTelemetry messaging support. This adds support for any OpenTelemetry instrumentation that complies with the OpenTelemetry Semantic Conventions specification for messaging.

Changed

  • Rename the hostname tag, which contains the host of the URI that an HTTP request was made against, to request_host.

    This fixes an issue where the hostname tag would later be internally overriden to the hostname of the machine processing the request, but notifications would still be emitted containing the previous hostname value.

View the Python package v1.3.5 changelog for more information.

May 14, 2024

Support Kamal deployments

Python1.3.3

Support Kamal-based deployments. Read the KAMAL_VERSION environment variable, which Kamal exposes within the deployed container, if present, and use it as the application revision if it is not set. This will automatically report deploy markers for applications using Kamal.


See the Python package 1.3.3 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.

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.

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!