|
1 | | -# Tinybird OTEL Template |
2 | | - |
3 | | -This repository is a template for building Tinybird projects that leverage [OpenTelemetry](https://opentelemetry.io/) (OTEL) for observability and analytics. Use this project as a starting point to instrument your applications with OpenTelemetry, collect metrics, traces, and logs, and analyze or expose them efficiently via Tinybird. |
4 | | - |
5 | | -## Overview |
6 | | -- **Project type:** Tinybird SRC repository |
7 | | -- **Purpose:** Enable rapid ingestion and analysis of OpenTelemetry data using Tinybird |
8 | | -- **Contents:** |
9 | | - - `.datasource` files defining Tinybird tables for OTEL metrics, logs, and traces |
10 | | - - Folders for connections, pipes, endpoints, and materializations |
11 | | - |
12 | | -## How to Use |
13 | | -1. **Fork/clone this repository as your Tinybird project root.** |
14 | | -2. **Instrument your services using OpenTelemetry SDKs.** |
15 | | -3. **Forward OTEL metrics, logs, and traces to this project's datasources (using the OpenTelemetry Collector, for example).** |
16 | | -4. **Create and publish Tinybird pipes and endpoints as needed for analytics and querying.** |
17 | | - |
18 | | -## Typical Structure |
19 | | -- `datasources/`: Definitions for raw OTEL data ingestion |
20 | | -- `pipes/`: Transform/query data |
21 | | -- `endpoints/`: Expose analytics via API |
22 | | -- Other folders: `connections/`, `copies/`, `fixtures/`, `materializations/`, `tests/` |
23 | | - |
24 | | -## Getting Started |
25 | | -- See Tinybird documentation: [docs.tinybird.co](https://docs.tinybird.co/) |
26 | | -- See OpenTelemetry docs: [opentelemetry.io/docs/](https://opentelemetry.io/docs/) |
27 | | - |
28 | | -## Who is this for? |
29 | | -Developers and SREs who want plug-and-play observability using OTEL and analytical capabilities via Tinybird. |
30 | | - |
31 | | ---- |
32 | | -Want to contribute or extend? Open issues or submit PRs! |
| 1 | +# Ingest from OpenTelemetry |
| 2 | + |
| 3 | +[OpenTelemetry](https://opentelemetry.io/) is an open-source observability framework for collecting, processing, and exporting telemetry data (metrics, traces, and logs) from your applications and infrastructure. |
| 4 | + |
| 5 | +By integrating OpenTelemetry with Tinybird, you can analyze observability data in real time, build dashboards, and enrich it with other data sources. |
| 6 | + |
| 7 | +Some common use cases for sending OpenTelemetry data to Tinybird include: |
| 8 | + |
| 9 | +1. Centralizing metrics, traces, and logs for unified analytics. |
| 10 | +2. Building custom dashboards and alerts on top of observability data. |
| 11 | +3. Enriching telemetry with business or application data. |
| 12 | + |
| 13 | +Read on to learn how to send data from OpenTelemetry to Tinybird. |
| 14 | + |
| 15 | +## Before you start |
| 16 | + |
| 17 | +Before you connect OpenTelemetry to Tinybird, ensure: |
| 18 | + |
| 19 | +* You have a Tinybird workspace. |
| 20 | +* You have a Tinybird Token with **append** permissions to the target Data Sources. |
| 21 | +* You are running the Tinybird distribution of the OpenTelemetry Collector. |
| 22 | + |
| 23 | +You can find the latest release of the Tinybird OpenTelemetry Collector here: |
| 24 | + |
| 25 | +- [GitHub Releases](https://github.com/tinybirdco/opentelemetry-collector-contrib/releases) |
| 26 | +- [Docker Hub](https://hub.docker.com/r/tinybirdco/opentelemetry-collector-contrib/tags) |
| 27 | + |
| 28 | +## Use the Tinybird OpenTelemetry project template |
| 29 | + |
| 30 | +To get started quickly, you can use the [Tinybird OpenTelemetry project template](https://github.com/tinybirdco/tinybird-otel-template). This template provides ready-to-use Data Sources and Pipes for storing and analyzing your telemetry data in Tinybird. |
| 31 | + |
| 32 | +## Minimal OpenTelemetry Collector configuration |
| 33 | + |
| 34 | +Below is a minimal example configuration for the Tinybird OpenTelemetry Collector to export metrics, traces, and logs to Tinybird: |
| 35 | + |
| 36 | +```yaml |
| 37 | +receivers: |
| 38 | + otlp: |
| 39 | + protocols: |
| 40 | + grpc: |
| 41 | + http: |
| 42 | + |
| 43 | +processors: |
| 44 | + batch: |
| 45 | + timeout: 10s |
| 46 | + send_batch_size: 8192 |
| 47 | + |
| 48 | +exporters: |
| 49 | + tinybird: |
| 50 | + endpoint: ${OTEL_TINYBIRD_API_HOST} |
| 51 | + token: ${OTEL_TINYBIRD_TOKEN} |
| 52 | + metrics_sum: |
| 53 | + datasource: opentelemetry_metrics_sum |
| 54 | + metrics_histogram: |
| 55 | + datasource: opentelemetry_metrics_histogram |
| 56 | + metrics_exponential_histogram: |
| 57 | + datasource: opentelemetry_metrics_exponential_histogram |
| 58 | + metrics_gauge: |
| 59 | + datasource: opentelemetry_metrics_gauge |
| 60 | + traces_datasource: otel_traces |
| 61 | + logs_datasource: otel_logs |
| 62 | + |
| 63 | +service: |
| 64 | + pipelines: |
| 65 | + metrics: |
| 66 | + receivers: [otlp] |
| 67 | + processors: [batch] |
| 68 | + exporters: [tinybird] |
| 69 | + |
| 70 | + traces: |
| 71 | + receivers: [otlp] |
| 72 | + processors: [batch] |
| 73 | + exporters: [tinybird] |
| 74 | + |
| 75 | + logs: |
| 76 | + receivers: [otlp] |
| 77 | + processors: [batch] |
| 78 | + exporters: [tinybird] |
| 79 | +``` |
| 80 | +
|
| 81 | +### Environment variables |
| 82 | +
|
| 83 | +- `OTEL_TINYBIRD_API_HOST`: The API host for your Tinybird workspace (e.g., `https://api.tinybird.co`). |
| 84 | +- `OTEL_TINYBIRD_TOKEN`: A Tinybird token with **append** permissions to the target Data Sources (`otel_metrics`, `otel_traces`, `otel_logs`). |
| 85 | + |
| 86 | +You can create a token in the Tinybird UI under **Tokens**. Make sure it has the required append permissions for the Data Sources you want to ingest into. |
| 87 | + |
| 88 | +## Next steps |
| 89 | + |
| 90 | +- Explore and customize the [Tinybird OpenTelemetry project template](https://github.com/tinybirdco/tinybird-otel-template) to fit your needs. |
| 91 | +- Use the ingested data to build real-time analytics, dashboards, and alerts in Tinybird. |
| 92 | + |
| 93 | +For more details on the available configuration options, see the [Tinybird OpenTelemetry Collector documentation](https://github.com/tinybirdco/opentelemetry-collector-contrib). |
0 commit comments