Overview
The@track_endpoint
decorator provides HTTP endpoint tracing for Flask applications with automatic request/response monitoring. It’s designed to work seamlessly with Flask and extends the functionality of the basic @trace
decorator.
Quick Example with OpenAI
Here’s a simple Flask endpoint that generates text using OpenAI:- HTTP request data (method, URL, headers, body)
- HTTP response data (status code, headers, body)
- OpenAI API calls and their results
- Any errors that occur during request processing
name
: Custom name for the tracetags
: List or dict of tags for categorizing tracescapture_request
: Whether to capture request data (default: True)capture_response
: Whether to capture response data (default: True)