Skip to content

Latest commit

 

History

History
543 lines (335 loc) · 32.5 KB

CHANGELOG.md

File metadata and controls

543 lines (335 loc) · 32.5 KB

AppSignal for Python Changelog

1.3.10

Published on 2024-08-23.

Changed

  • f9b17a7 patch - Simplify the implementation of set_gauge in favor of the newer OpenTelemetry's sync implementation.

1.3.9

Published on 2024-08-19.

Added

  • c2e3f26 patch - 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.

1.3.8

Published on 2024-08-14.

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:

    # 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)

    (patch b530263)

Deprecated

  • Calls to appsignal.heartbeat and to the appsignal.Heartbeat constructor will emit a deprecation warning. (patch b530263)

1.3.7

Published on 2024-06-26.

Added

  • d6d9724 patch - Add support for Pika
  • 626db80 patch - AMQP messaging processing with Pika tracing data is now supported.

1.3.6

Published on 2024-06-12.

Fixed

  • 21ce8fb patch - Fix an issue where Redis events are misidentified as HTTP events.

1.3.5

Published on 2024-06-11.

Added

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

Changed

  • 8d036f8 patch - 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.

1.3.4

Added

  • 5ed6e44 patch - Unsupported systems, like Microsoft Windows, won't start the agent and other integration components to prevent them from failing and allowing apps to be run normally.

1.3.3

Published on 2024-05-14.

Added

  • b3db311 patch - 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.

1.3.2

Published on 2024-05-06.

Added

  • c4a2ac4 patch - Add support for the aiopg, asyncpg, mysql, pymysql and mysqlclient Python SQL database adapters.

1.3.1

Published on 2024-04-29.

Added

  • a455252 patch - Add automatic instrumentation support for SQLAlchemy, SQLite and version 3 of the psycopg PostgreSQL adapter.

1.3.0

Published on 2024-04-22.

Added

  • 6ac44b7 minor - 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:

    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:

    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.

1.2.1

Fixed

  • bf4aa09 patch - Unmatching Flask app routes are no longer recorded as valid spans.

1.2.0

Published on 2024-03-20.

Added

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

    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.

  • 3a27381 patch - 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.

Fixed

  • 3a797e1 patch - Fix ASGI events (from Python ASGI applications) showing up in the "Slow API requests" panel.

1.1.1

Published on 2024-03-11.

Added

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

    # 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

1.1.0

Published on 2024-03-04.

Added

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

Changed

  • 0e3733e minor - 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.
  • fdbc92c patch - 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.
  • fdbc92c patch - Fix an issue where queries containing a MySQL leading type indicator would only be partially sanitised.
  • 0e3733e patch - 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.
  • ce6ebf2 patch - Update bundled trusted root certificates.

Fixed

  • f8cf85a patch - 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.

1.0.4

Changed

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

Fixed

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

1.0.3

Changed

  • 11e205a patch - 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.

  • 11e205a patch - Remove extra HTTP attributes from Django root spans.

  • 11e205a patch - 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.

  • 11e205a patch - 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.

    The following mountpoint are ignored. Any mountpoint containing:

    • /etc/hostname
    • /etc/hosts
    • /etc/resolv.conf
    • /snap/
    • /proc/

Fixed

  • 11e205a patch - 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.
  • 11e205a patch - - 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.

1.0.2

Changed

  • 7ab8753 patch - Bump agent to 1dd2a18.

    • When adding an SQL body attribute via the extension, instead of truncating the body first and sanitising it later, sanitise it first and truncate it later. This prevents an issue where queries containing very big values result in truncated sanitisations.
  • addb832 patch - Bump agent to eec7f7b

    Updated the probes dependency to 0.5.2. 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.

Fixed

  • 1243c3c patch - Fix the metadata on the demo CLI's example samples. It will no longer contain unused attributes. The performance sample will report a named process_request.http event, rather than report an unknown event, in the event timeline.
  • 5e91cef patch - Fix a crash on the diagnose report when attempting to report the platform for which AppSignal for Python was installed.

1.0.1

Changed

  • 4c59581 patch - 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.

  • 42c12a2 patch - 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.

  • c126167 patch - 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.

  • 75f9599 patch - 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.

1.0.0

Added

  • c1b31b8 major - 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

  • cd360e6 patch - 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.
  • bde96cb patch - 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.
  • 4e854df patch - 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

  • 05f7f8d patch - Fix an issue where the installer would always find the push API key to be invalid, halting the installation process.
  • cd360e6 patch - 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.
  • ccd49ad patch - 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.

0.3.2

Added

  • 48fbe34 patch - 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.

    python -m appsignal demo --environment=production
    
  • 3f97c9d patch - 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.

    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

  • 9cca18d patch - 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.

  • b0c6c28 patch - 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

  • 791f874 patch - 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.
  • 6d42381 patch - 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.

0.3.1

Changed

  • 4b94772 patch - Bump agent to e8207c1.

    • Add memory_in_percentages and swap_in_percentages host metrics that represents metrics in percentages.
    • Ignore /snap/ disk mountpoints.
    • 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.

0.3.0

Added

  • 9e4d6ef minor - 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 sums and gauges.

  • 073b3c2 patch - 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:

    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.

  • 073b3c2 patch - 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:

    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.

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

    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.

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

    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

  • 1d72ea7 patch - 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.

0.2.3

Fixed

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

0.2.2

Added

  • 381638e patch - 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.
  • 7f5c848 patch - 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.
  • c2e0e2c patch - 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

  • 5a0cfa9 patch - Bump agent to version d789895.

    • Increase short data truncation from 2000 to 10000 characters.

0.2.1

Changed

  • bb0d90b patch - Warn if the appsignal-beta package is present in the dependencies list to nudge people into switching to the new appsignal package.

0.2.0

Added

  • 6b164d2 patch - Use RENDER_GIT_COMMIT environment variable as revision if no revision is specified.
  • 74a961e patch - 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.
  • 0d1de38 patch - 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.
  • c186236 patch - Add diagnose command

Changed

  • ebdcdec minor - Rename package from appsignal-beta to appsignal. Please update your dependencies (for example, in requirements.txt) accordingly.

  • 6c8dc88 patch - 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.
  • 61c3537 patch - Bump agent to 6bec691.

    • Upgrade sql_lexer to v0.9.5. It adds sanitization support for the THEN and ELSE logical operators.

0.1.4

Added

  • 8490ba0 patch - Add support for OpenTelemetry instrumentation of ASGI-based frameworks, such as FastAPI and Starlette.

0.1.3

Changed

  • e2572ea patch - Change the configuration source load order. The environment variables are no longer leading, but the __appsignal__.py file source is. The load order is now:

    • Default source (hardcoded config)
    • System source (context dependent config)
    • Environment source (environment variables)
    • Initial source (any config given to Config() in __appsignal__.py)
  • 6a23212 patch - Bump agent to 91f1a7c

    • Fall back on the revision option for OpenTelemetry endpoint from config, rather than only read it from the OpenTelemetry resource attributes.
    • Fix agent restart when the config changes, not detecting a config change and not starting a new agent process.
    • Retry agent servers port binding when port is busy. This fixes Python package restarting the agent when another agent instance is still running.

0.1.2

Changed

  • a96736a patch - Bump agent to 8cb4ef2

    • Fix backtrace parsing for Python.
    • Add Flask support.
    • Fix running_in_container detecting for hosts running Docker.
    • Improve running_in_container config option load order.
  • 7fbf731 patch - Bump agent d21e1f4

    • Don't report incidents for root spans that are only psycopg2 queries.

0.1.1

Fixed

  • 7f4fb7a patch - Fix an issue where the installer would fail due to the certificate bundle being missing.

0.1.0

Changed

  • 0bb38d1 minor - Initial beta release