Skip to main content

pypi

Installation

pip install opencensus-ext-flask

Usage

from flask import Flask
from opencensus.ext.flask.flask_middleware import FlaskMiddleware

app = Flask(__name__)
middleware = FlaskMiddleware(app, excludelist_paths=['_ah/health'])

@app.route('/')
def hello():
    return 'Hello World!'

if __name__ == '__main__':
    import logging
    logger = logging.getLogger('werkzeug')
    logger.setLevel(logging.ERROR)
    app.run(host='localhost', port=8080, threaded=True)

Additional configuration can be provided, please read Customization for a complete reference.

app.config['OPENCENSUS'] = {
    'TRACE': {
        'SAMPLER': 'opencensus.trace.samplers.ProbabilitySampler(rate=1)',
        'EXPORTER': '''opencensus.ext.ocagent.trace_exporter.TraceExporter(
            service_name='foobar',
        )''',
    }
}

References

Release files for opencensus-ext-flask 0.8.2

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

Source distribution (sdist)

Source distribution for opencensus-ext-flask 0.8.2
File Size Uploaded
opencensus-ext-flask-0.8.2.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for opencensus-ext-flask 0.8.2
File Interpreter ABI Platform
opencensus_ext_flask-0.8.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 11.2 kB

Release files / opencensus-ext-flask-0.8.2.tar.gz

Download URL opencensus-ext-flask-0.8.2.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
49155eb91c8582912ea1efd08bf9dea90baa4b29401fb8f17674dbc7aa40cd08
BLAKE2b-256 checksum
How to use checksums
0f4fb3a55685e951d853b5a43c4411af08b29507a4d6b856e064318f285aa73c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.9

Release files / opencensus_ext_flask-0.8.2-py2.py3-none-any.whl

Download URL opencensus_ext_flask-0.8.2-py2.py3-none-any.whl
Size 6.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
f50517d57ad9d004b32c1f308e249c895e222a124e8ded00e580e5030a97372d
BLAKE2b-256 checksum
How to use checksums
f3d6ee462d10167a7596a1cb69b7975cd9ff0516c28b39b7e343429a3618267b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.9

Release history Release notifications | RSS feed

This release

0.8.2 This release

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.6

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

1 release file

0.7.2

1 release file

0.7.1

1 release file

0.7.0

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.0

1 release file

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