Skip to main content

flask_applicationinsights

Flask extension for Microsoft Azure Application Insights.

Make your Flask application able to send tracking information to an Application Insights Azure component.

Build Status codecov

Dependencies

  • flask>=1.0.2
  • applicationinsights==0.11.6

If you are encountering locale issues with application insights, please check this hack: https://github.com/Azure/azure-cli-shell/issues/63

Usage

Retrieve package from pypi:

pip install flask_applicationinsights

Instrumentation key can be provided programmatically as well as by environment variable or flask configuration key. Key name is APPINSIGHTS_INSTRUMENTATION_KEY.

Basic

Will track all requests (succeeded or failed) to your application insight referenced by its instrumentation key.

from flask import Flask
from flask_applicationinsights import ApplicationInsights

app = Flask(__name__)

insight = ApplicationInsights(instrumentation_key='<yours>')
insight.init_app(app)

@app.route('/')
def index():
    return 'HIT'

app.run()

Advanced

You can also add custom properties or measurements to each tracked request by using special decorators.

...

insight = ApplicationInsights(...)
...

@insight.properties
def custom_properties(req: Request, resp: Response):
    return {
        'req_pragma': req.headers.get('Pragma'),
        'resp_charset': resp.charset
    }

Contribution

Not open yet due to initial WIP.

Metadata

Release files for Flask-ApplicationInsights 0.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Flask-ApplicationInsights 0.2.6
File Size Uploaded Provenance Actions
Flask-ApplicationInsights-0.2.6.tar.gz 4.5 kB Without provenance Details for Flask-ApplicationInsights-0.2.6.tar.gz

Release files / Flask-ApplicationInsights-0.2.6.tar.gz

Download URL Flask-ApplicationInsights-0.2.6.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e1ef0cba5e72c9962e2c425322235648c1cd0612dae5c72d3d95dd584a403dbe
BLAKE2b-256 checksum
How to use checksums
8ea1dd536ff2ec4f1bc2f577cf5fda800e7279b5ba157aa1f1d723276588134b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.3

Security for Flask-ApplicationInsights 0.2.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page