howfast-apm


Namehowfast-apm JSON
Version 0.8.0 PyPI version JSON
download
home_pagehttps://github.com/HowFast/apm-python
SummaryLightweight Application Performance Monitoring middleware that measures and reports performance data to HowFast APM.
upload_time2024-10-14 13:01:39
maintainerNone
docs_urlNone
authorMickaël Bergem
requires_python<3.13,>=3.9.20
licenseMIT
keywords apm performance timing howfast
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            HowFast APM for Python servers
==============================

Light instrumentation of your Python server for reporting performance data to `HowFast APM <https://www.howfast.tech/>`_.

.. image:: https://github.com/HowFast/apm-python/blob/master/screenshot.png
    :align: center
    :alt: Screenshot from HowFast APM

Install
-------

To install / update the module:

.. code:: bash

    pip install howfast-apm[flask]

Usage
-------

Only the Flask middleware is currently available.

.. code:: python

    from howfast_apm import HowFastFlaskMiddleware

    # Create your Flask app
    app = Flask(__name__, ...)

    # Instanciate all your other middlewares first

    # Setup the APM middleware last, so that it can track the time spent inside other middlewares
    HowFastFlaskMiddleware(app, app_id=HOWFAST_APM_DSN)

Configuration
-------------

You can configure the APM through environment variables. If they are defined, those variables will
be used. Parameters passed to the ``HowFastFlaskMiddleware`` constructor take precedence over environment
variables.

Only one variable is available for now:

* ``HOWFAST_APM_DSN``: The DSN (application identifier) that you can find on your APM dashboard. Can also be passed to the constructor as ``app_id``.

If the environment variable is defined you can then use:

.. code:: python

    # Install the middleware
    HowFastFlaskMiddleware(app)

You can also choose to exclude some URLs from reporting:

.. code:: python

    # Do not report performance data for some URLs
    HowFastFlaskMiddleware(
        app,
        endpoints_blacklist=[
            '/some/internal/url/',
            # You can also use patterns accepted by Python's `fnmatch.fnmatch`, shell-like:
            '/admin/*',
            '/jobs/*/results',
            '/endpoint/?',  # will blacklist /endpoint and /endpoint/
        ],
    )

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/HowFast/apm-python",
    "name": "howfast-apm",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>=3.9.20",
    "maintainer_email": null,
    "keywords": "apm, performance, timing, howfast",
    "author": "Micka\u00ebl Bergem",
    "author_email": "mickael@howfast.tech",
    "download_url": "https://files.pythonhosted.org/packages/7f/4a/cdf83fdcd6a640db9652250288bf21424f9733d9b898d4915ae82703c6f3/howfast_apm-0.8.0.tar.gz",
    "platform": null,
    "description": "HowFast APM for Python servers\n==============================\n\nLight instrumentation of your Python server for reporting performance data to `HowFast APM <https://www.howfast.tech/>`_.\n\n.. image:: https://github.com/HowFast/apm-python/blob/master/screenshot.png\n    :align: center\n    :alt: Screenshot from HowFast APM\n\nInstall\n-------\n\nTo install / update the module:\n\n.. code:: bash\n\n    pip install howfast-apm[flask]\n\nUsage\n-------\n\nOnly the Flask middleware is currently available.\n\n.. code:: python\n\n    from howfast_apm import HowFastFlaskMiddleware\n\n    # Create your Flask app\n    app = Flask(__name__, ...)\n\n    # Instanciate all your other middlewares first\n\n    # Setup the APM middleware last, so that it can track the time spent inside other middlewares\n    HowFastFlaskMiddleware(app, app_id=HOWFAST_APM_DSN)\n\nConfiguration\n-------------\n\nYou can configure the APM through environment variables. If they are defined, those variables will\nbe used. Parameters passed to the ``HowFastFlaskMiddleware`` constructor take precedence over environment\nvariables.\n\nOnly one variable is available for now:\n\n* ``HOWFAST_APM_DSN``: The DSN (application identifier) that you can find on your APM dashboard. Can also be passed to the constructor as ``app_id``.\n\nIf the environment variable is defined you can then use:\n\n.. code:: python\n\n    # Install the middleware\n    HowFastFlaskMiddleware(app)\n\nYou can also choose to exclude some URLs from reporting:\n\n.. code:: python\n\n    # Do not report performance data for some URLs\n    HowFastFlaskMiddleware(\n        app,\n        endpoints_blacklist=[\n            '/some/internal/url/',\n            # You can also use patterns accepted by Python's `fnmatch.fnmatch`, shell-like:\n            '/admin/*',\n            '/jobs/*/results',\n            '/endpoint/?',  # will blacklist /endpoint and /endpoint/\n        ],\n    )\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Lightweight Application Performance Monitoring middleware that measures and reports performance data to HowFast APM.",
    "version": "0.8.0",
    "project_urls": {
        "Homepage": "https://github.com/HowFast/apm-python"
    },
    "split_keywords": [
        "apm",
        " performance",
        " timing",
        " howfast"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e8723c17bd1400138eeb941d0415721e67acc79d82331fdb34df80b8b4af9a72",
                "md5": "54fe8237729c497eec9544e9e8b8a370",
                "sha256": "8039756c56548e3806bdfbf3176000a15392ada457ef740f8fffaa7a03803239"
            },
            "downloads": -1,
            "filename": "howfast_apm-0.8.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "54fe8237729c497eec9544e9e8b8a370",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>=3.9.20",
            "size": 11052,
            "upload_time": "2024-10-14T13:01:36",
            "upload_time_iso_8601": "2024-10-14T13:01:36.738824Z",
            "url": "https://files.pythonhosted.org/packages/e8/72/3c17bd1400138eeb941d0415721e67acc79d82331fdb34df80b8b4af9a72/howfast_apm-0.8.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7f4acdf83fdcd6a640db9652250288bf21424f9733d9b898d4915ae82703c6f3",
                "md5": "055613ef34e0ec03093db932afaa55ee",
                "sha256": "d517d45b6187ebf4c6ec573ab6f703796173a5af5f354baabce9a1440b8f313c"
            },
            "downloads": -1,
            "filename": "howfast_apm-0.8.0.tar.gz",
            "has_sig": false,
            "md5_digest": "055613ef34e0ec03093db932afaa55ee",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>=3.9.20",
            "size": 9849,
            "upload_time": "2024-10-14T13:01:39",
            "upload_time_iso_8601": "2024-10-14T13:01:39.593534Z",
            "url": "https://files.pythonhosted.org/packages/7f/4a/cdf83fdcd6a640db9652250288bf21424f9733d9b898d4915ae82703c6f3/howfast_apm-0.8.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-14 13:01:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "HowFast",
    "github_project": "apm-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "circle": true,
    "tox": true,
    "lcname": "howfast-apm"
}
        
Elapsed time: 0.43741s