diff options
author | CoprDistGit <infra@openeuler.org> | 2023-06-20 06:12:39 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-06-20 06:12:39 +0000 |
commit | 53fd2aea64996e29be74072922efd2339a57d576 (patch) | |
tree | 710b3b1b1fb34d775c3f6c0522436223d95cec57 | |
parent | 1e263b5c9e6552c5f2dc957269b24bd9b12353cd (diff) |
automatic import of python-Flask-ApplicationInsightsopeneuler20.03
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-flask-applicationinsights.spec | 273 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 275 insertions, 0 deletions
@@ -0,0 +1 @@ +/Flask-ApplicationInsights-0.2.6.tar.gz diff --git a/python-flask-applicationinsights.spec b/python-flask-applicationinsights.spec new file mode 100644 index 0000000..13ab16e --- /dev/null +++ b/python-flask-applicationinsights.spec @@ -0,0 +1,273 @@ +%global _empty_manifest_terminate_build 0 +Name: python-Flask-ApplicationInsights +Version: 0.2.6 +Release: 1 +Summary: Microsoft Azure Application Insights integration for Flask. +License: MIT +URL: https://github.com/gghez/flask_applicationinsights +Source0: https://mirrors.aliyun.com/pypi/web/packages/8e/a1/dd536ff2ec4f1bc2f577cf5fda800e7279b5ba157aa1f1d723276588134b/Flask-ApplicationInsights-0.2.6.tar.gz +BuildArch: noarch + + +%description +# flask_applicationinsights + +Flask extension for Microsoft Azure Application Insights. + +Make your Flask application able to send tracking information to an Application Insights Azure component. + +[](https://travis-ci.org/gghez/flask_applicationinsights) +[](https://codecov.io/gh/gghez/flask_applicationinsights) + +## 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. + +```python +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. + +```python +... + +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. + +%package -n python3-Flask-ApplicationInsights +Summary: Microsoft Azure Application Insights integration for Flask. +Provides: python-Flask-ApplicationInsights +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-Flask-ApplicationInsights +# flask_applicationinsights + +Flask extension for Microsoft Azure Application Insights. + +Make your Flask application able to send tracking information to an Application Insights Azure component. + +[](https://travis-ci.org/gghez/flask_applicationinsights) +[](https://codecov.io/gh/gghez/flask_applicationinsights) + +## 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. + +```python +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. + +```python +... + +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. + +%package help +Summary: Development documents and examples for Flask-ApplicationInsights +Provides: python3-Flask-ApplicationInsights-doc +%description help +# flask_applicationinsights + +Flask extension for Microsoft Azure Application Insights. + +Make your Flask application able to send tracking information to an Application Insights Azure component. + +[](https://travis-ci.org/gghez/flask_applicationinsights) +[](https://codecov.io/gh/gghez/flask_applicationinsights) + +## 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. + +```python +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. + +```python +... + +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. + +%prep +%autosetup -n Flask-ApplicationInsights-0.2.6 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-Flask-ApplicationInsights -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 0.2.6-1 +- Package Spec generated @@ -0,0 +1 @@ +d934f5a26293b9c3e21ce328d53c3e7d Flask-ApplicationInsights-0.2.6.tar.gz |