Data can help developers build better software, but it can be hard to find data tools that are easy to integrate, scale with you as you grow, and are flexible enough to meet different demands. This Stater Kit provides an example for you can build your own logging & telemetry solution powered by Tinybird.
This is an opinionated Starter Kit that uses Web Applications as the example, but you can use this kit to bootstrap logging for any software project. Take this kit and make it your own!
This Starter Kit includes:
- Tinybird data project
- Analytics Dashboard built with Next.js & Tremor
- Example Log Capture implementations
- TypeScript & Next.js Logger + example Vercel functions
- Python & FastAPI Logger
The Tinybird data project includes all of the Tinybird resources you need to ingest, analyze and publish your logs. This includes Data Sources, Pipes, Materialized Views, and APIs.
The Analytics Dashboard is an example of how of you can build your own frontend to visualize the data from Tinybird.
The dashboard is implemented using Next.js & Tremor. All of the charts on the dashboard consume data over the HTTP API Endpoints that are publish from Tinybird.
There is no caching or frontend magic, every chart is consuming live data in real time.
All examples of capturing logs use the Tinybird's Events API, sending logs as JSON via a standard HTTP POST request. Because this is simply JSON over HTTP, you can use this approach to integrate any framework, language or application to send data to Tinybird.
Each logger exposes 3 methods info
, warn
and error
that can be used to capture log messages with different log levels. Each one in turn calls the log
method, which captures additional information about the incoming request.
Note that each logger expects an Environment Variable TINYBIRD_TOKEN
to authenticate the request to Tinybird. You can copy this token from your Tinybird account by logging into the Tinybird UI.
In logger.ts you'll find a simple reference implementation for a log capture class in TypeScript. This is built with Next.js in mind, but could be adapted to any other framework.
An example Vercel Function is included at getProductExample.ts. This function simply demonstrates how to use the logger in a function.
In logger.py you'll find a simple reference implementation for a log capture class in Python. This is built with FastAPI in mind, but could be adapted to any other framework.
An example FastAPI Endpoint is included at main.py. This endpoint simply demonstrates how to use the logger in a function.
There are two components to this Starter Kit that you need to deploy.
Use the button below to deploy this Starter Kit to Tinybird.
Use the button below to deploy this Starter Kit to Vercel.