Examples¶
These are working, stand-alone apps and projects that you can clone, spin up locally and play around with to get a feel for the different capabilities of Logfire.
Got a suggestion?
If you want to see an example of a particular language or library, get in touch.
Python¶
Flask and SQLAlchemy example¶
This example is a simple Python financial calculator app using Flask and SQLAlchemy which is instrumented using the appropriate integrations as well as auto-tracing. If you spin up the server locally and interact with the calculator app, you'll be able to see traces come in automatically:
JavaScript¶
Currently we only have a Python SDK, but the Logfire backend and UI support data sent by any OpenTelemetry client. See the alternative clients guide for details on setting up OpenTelemetry in any language. We're working on a JavaScript SDK, but in the meantime here are some examples of using plain OpenTelemetry in JavaScript:
Cloudflare worker example¶
This example is based on the scaffolding created from npm create cloudflare@latest
, and uses the otel-cf-workers package to instrument a Cloudflare Worker and send traces and metrics to Logfire.
Express example¶
This example demonstrates how to use OpenTelemetry to instrument an Express application and send traces and metrics to Logfire.