|
1 | | -<p> |
2 | | - <a href="https://www.tinybird.co/join-our-slack-community"><img alt="Slack Status" src="https://img.shields.io/badge/slack-chat-1FCC83?style=flat&logo=slack"></a> |
3 | | -</p> |
| 1 | +This repository is archived. |
4 | 2 |
|
5 | | -# Tinybird Log Analytics Starter Kit |
6 | | - |
7 | | -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](https://www.tinybird.co/). |
8 | | - |
9 | | -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! |
10 | | - |
11 | | - |
12 | | - |
13 | | -## What's in the box? |
14 | | - |
15 | | -This Starter Kit includes: |
16 | | - |
17 | | -- [Tinybird](https://www.tinybird.co/) data project |
18 | | -- Analytics Dashboard built with [Next.js](https://nextjs.org/) & [Tremor](https://www.tremor.so/) |
19 | | -- Example Log Capture implementations |
20 | | - - TypeScript & Next.js Logger + example [Vercel](https://vercel.com/) functions |
21 | | - - Python & FastAPI Logger |
22 | | - |
23 | | -### Tinybird Data Project |
24 | | - |
25 | | -The [Tinybird](https://www.tinybird.co/) data project includes all of the Tinybird resources you need to ingest, analyze and publish your logs. This includes [Data Sources](https://www.tinybird.co/docs/concepts/data-sources.html), [Pipes](https://www.tinybird.co/docs/concepts/pipes.html), [Materialized Views](https://www.tinybird.co/docs/guides/materialized-views.html), and [APIs](https://www.tinybird.co/docs/concepts/apis.html). |
26 | | - |
27 | | - |
28 | | - |
29 | | -### Analytics Dashboard |
30 | | - |
31 | | -The Analytics Dashboard is an example of how of you can build your own frontend to visualize the data from Tinybird. |
32 | | - |
33 | | -The dashboard is implemented using [Next.js](https://nextjs.org/) & [Tremor](https://www.tremor.so/). All of the charts on the dashboard consume data over the HTTP API Endpoints that are publish from [Tinybird](https://www.tinybird.co/). |
34 | | - |
35 | | -There is no caching or frontend magic, every chart is consuming live data in real time. |
36 | | - |
37 | | - |
38 | | - |
39 | | -### Example Log Capture |
40 | | - |
41 | | -All examples of capturing logs use the [Tinybird's Events API](https://www.tinybird.co/docs/guides/high-frequency-ingestion.html), 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](https://www.tinybird.co/). |
42 | | - |
43 | | -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. |
44 | | - |
45 | | -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. |
46 | | - |
47 | | -#### TypeScript & Next.js |
48 | | - |
49 | | -In [logger.ts](./logger-examples/typescript-nextjs/logger.ts) you'll find a simple reference implementation for a log capture class in TypeScript. This is built with [Next.js](https://nextjs.org/) in mind, but could be adapted to any other framework. |
50 | | - |
51 | | -##### Vercel Functions |
52 | | - |
53 | | -An example Vercel Function is included at [getProductExample.ts](./logger-examples/typescript-nextjs/getProductExample.ts). This function simply demonstrates how to use the logger in a function. |
54 | | - |
55 | | -#### Python & FastAPI |
56 | | - |
57 | | -In [logger.py](./logger-examples/python-fastapi/logger.py) you'll find a simple reference implementation for a log capture class in Python. This is built with [FastAPI](https://fastapi.tiangolo.com/) in mind, but could be adapted to any other framework. |
58 | | - |
59 | | -##### FastAPI Endpoint |
60 | | - |
61 | | -An example FastAPI Endpoint is included at [main.py](./logger-examples/python-fastapi/main.py). This endpoint simply demonstrates how to use the logger in a function. |
62 | | - |
63 | | -## Deploy |
64 | | - |
65 | | -There are two components to this Starter Kit that you need to deploy. |
66 | | - |
67 | | -### 1. Tinybird Data Project |
68 | | - |
69 | | -Use the button below to deploy this Starter Kit to Tinybird. |
70 | | - |
71 | | -[](https://ui.tinybird.co/workspaces/new?name=log_analytics_starter_kit&starter_kit=log-analytics-starter-kit) |
72 | | - |
73 | | -### 2. Analytics Dashboard |
74 | | - |
75 | | -Use the button below to deploy this Starter Kit to Vercel. |
76 | | - |
77 | | -[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Ftinybirdco%2Flog-analytics-starter-kit&project-name=tinybird-log-analytics-starter-kit&repository-name=tinybird-log-analytics-starter-kit&demo-description=Custom%20analytics%20for%20your%20application%20logs%20using%20Tinybird&demo-url=http%3A%2F%2Flog-analytics.tinybird.co&demo-image=http%3A%2F%2Flog-analytics.tinybird.co%2Fbanner.png&root-directory=dashboard&integration-ids=oac_uoH2YyxhaS1H6UYvtuRbRbDY) |
| 3 | +Go to https://github.com/tinybirdco/logs-explorer-template |
0 commit comments