Skip to content

An example repo for a flask app built with opentelemetry

Notifications You must be signed in to change notification settings

highlight/otel-flask-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenTelemetry Flask Example

This repository is built by highlight.io, an open source observability platform that has both a cloud service and a self-hosted offering. OpenTelemetry is a spec supported by many observability providers, but if you want an opinionated, easy to use, and fully featured observability platform, you can head over to highlight.io.

What is this repository?

This repository is a simple Flask application that demonstrates how to use OpenTelemetry to instrument a Flask application. For the full guide, see this blog post.

This repository covers:

  • Setting up basic logs, traces, and metrics and how to forward this over to an OTEL backend (see o11y.py)
  • Catching every incoming request using the standard traceparent header, and creating a span for each request
  • Instrumenting outgoing requests using the requests library

Development Setup

Prerequisites

Installation Steps

  1. Clone the repository

  2. Configure your HIGHLIGHT_PROJECT_ID (or your vendor's specific config) in o11y.py

  3. Install dependencies:

    poetry install --no-root
  4. Run the app:

    poetry run python main.py

About

An example repo for a flask app built with opentelemetry

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages