Reader small image

You're reading from  Cloud-Native Observability with OpenTelemetry

Product typeBook
Published inMay 2022
PublisherPackt
ISBN-139781801077705
Edition1st Edition
Right arrow
Author (1)
Alex Boten
Alex Boten
author image
Alex Boten

Alex Boten is a senior staff software engineer that has spent the last ten years helping organizations adapt to a cloud-native landscape. From building core network infrastructure to client mobile applications and everything in between, Alex has first-hand knowledge of how difficult troubleshooting distributed applications is. This led him to the domain of observability and to contributing to related open source projects. An approver and maintainer in several OpenTelemetry projects, Alex has helped implement and evolve the project from its early days in 2019 into the massive community effort that it is today. Alex has contributed to the Python and Go OpenTelemetry implementations, as well as to the specification and the collector projects. More than anything, Alex by codeboten on Twitter loves making sense of the technology around us and sharing his learnings with others.
Read more about Alex Boten

Right arrow

Flask library instrumentor

Like the Requests library, the Flask instrumentation library contains an implementation of the BaseInstrumentor interface. The code is available in the OpenTelemetry Python contrib repository at https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py. The implementation leverages a few different aspects of the Flask library to achieve instrumentation. It wraps the original Flask app and registers a callback via the before_request method. It then provides a middleware to execute instrumentation code at response time. This allows the instrumentation to capture the beginning and the end of requests through the library.

Additional configuration options

The following options are available to configure FlaskInstrumentor further:

  • excluded_urls: Supports a comma-separated list of regular expressions for excluding specific URLs from...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Cloud-Native Observability with OpenTelemetry
Published in: May 2022Publisher: PacktISBN-13: 9781801077705

Author (1)

author image
Alex Boten

Alex Boten is a senior staff software engineer that has spent the last ten years helping organizations adapt to a cloud-native landscape. From building core network infrastructure to client mobile applications and everything in between, Alex has first-hand knowledge of how difficult troubleshooting distributed applications is. This led him to the domain of observability and to contributing to related open source projects. An approver and maintainer in several OpenTelemetry projects, Alex has helped implement and evolve the project from its early days in 2019 into the massive community effort that it is today. Alex has contributed to the Python and Go OpenTelemetry implementations, as well as to the specification and the collector projects. More than anything, Alex by codeboten on Twitter loves making sense of the technology around us and sharing his learnings with others.
Read more about Alex Boten