{"id":32624578,"url":"https://github.com/smithclay/duckdb-otlp","last_synced_at":"2026-05-09T05:11:00.470Z","repository":{"id":320948106,"uuid":"1069840008","full_name":"smithclay/duckdb-otlp","owner":"smithclay","description":"query OpenTelemetry metrics, logs, and traces (OTLP) in duckdb","archived":false,"fork":false,"pushed_at":"2026-03-09T23:15:29.000Z","size":1929,"stargazers_count":37,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-10T01:53:48.622Z","etag":null,"topics":["duckdb","duckdb-extension","opentelemetry"],"latest_commit_sha":null,"homepage":"https://smithclay.github.io/duckdb-otlp/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smithclay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-10-04T18:14:23.000Z","updated_at":"2026-03-09T23:15:35.000Z","dependencies_parsed_at":"2025-10-26T23:25:11.203Z","dependency_job_id":"7b35ac01-b54a-4354-b329-ef47f131156b","html_url":"https://github.com/smithclay/duckdb-otlp","commit_stats":null,"previous_names":["smithclay/duckdb-otlp"],"tags_count":2,"template":false,"template_full_name":"duckdb/extension-template","purl":"pkg:github/smithclay/duckdb-otlp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smithclay%2Fduckdb-otlp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smithclay%2Fduckdb-otlp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smithclay%2Fduckdb-otlp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smithclay%2Fduckdb-otlp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smithclay","download_url":"https://codeload.github.com/smithclay/duckdb-otlp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smithclay%2Fduckdb-otlp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32807896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["duckdb","duckdb-extension","opentelemetry"],"created_at":"2025-10-30T20:02:30.330Z","updated_at":"2026-05-09T05:11:00.463Z","avatar_url":"https://github.com/smithclay.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DuckDB OpenTelemetry (OTLP) Extension\n\nQuery OpenTelemetry traces, logs, and metrics with SQL. Works with OTLP file exports from any OpenTelemetry Collector, uses a row-based schema inspired by the [Clickhouse OpenTelemetry exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/clickhouseexporter/README.md).\n\n```sql\n-- Install from DuckDB community extensions\nINSTALL otlp FROM community;\nLOAD otlp;\n\n-- Query slow traces\nSELECT\n    trace_id,\n    span_name,\n    duration / 1000000 AS duration_ms\nFROM read_otlp_traces('traces.jsonl')\nWHERE duration \u003e 1000000000  -- over 1 second\nORDER BY duration DESC\nLIMIT 5;\n```\n\n**Output:**\n```\n┌─────────────────────────────────┬──────────────────┬──────────────┐\n│            trace_id             │    span_name     │ duration_ms  │\n├─────────────────────────────────┼──────────────────┼──────────────┤\n│ 7a3f92e8b4c1d6f0a9e2...         │ POST /checkout   │    1523.4    │\n│ 8b1e45c9f2a7d3e6b0f1...         │ GET /search      │    1205.7    │\n│ 3c2d19f8e4b6a0c7d1f9...         │ PUT /cart/items  │    1089.2    │\n└─────────────────────────────────┴──────────────────┴──────────────┘\n```\n\n\u003e Want to _stream_ OTLP data directly to duckdb / Parquet in cloud storage? Check out https://github.com/smithclay/otlp2parquet\n\n## What you can do\n\n- **Analyze production telemetry** - Query OTLP file exports with familiar SQL syntax\n- **Archive to your data lake** - Convert OpenTelemetry data to Parquet with schemas intact\n- **Debug faster** - Filter logs by severity, find slow traces, aggregate metrics\n- **Integrate with data tools** - Use DuckDB's ecosystem (MotherDuck, Jupyter, DBT, etc.)\n\n## Get started in 3 minutes\n\n**[→ Quick Start Guide](docs/get-started.md)** - Install, load sample data, run your first query\n\n## Try it in your browser\n\n**[→ Interactive Demo](https://smithclay.github.io/duckdb-otlp/)** - Query OTLP data directly in your browser using DuckDB-WASM\n\nThe browser demo lets you:\n- Load sample OTLP traces, logs, and metrics\n- Run SQL queries without installing anything\n- Upload your own JSONL files for analysis\n\n**Note:** The WASM demo supports JSON format only. For protobuf support, install the native extension.\n\n## Common use cases\n\n### Find slow requests\n```sql\nSELECT span_name, AVG(duration) / 1000000 AS avg_ms\nFROM read_otlp_traces('prod-traces/*.jsonl')\nWHERE span_kind = 2  -- SERVER\nGROUP BY span_name\nHAVING AVG(duration) \u003e 1000000000\nORDER BY avg_ms DESC;\n```\n\n### Export telemetry to Parquet\n```sql\nCOPY (\n  SELECT * FROM read_otlp_traces('otel-export/*.jsonl')\n) TO 'data-lake/daily_traces.parquet' (FORMAT PARQUET);\n```\n\n### Filter logs by severity\n```sql\nSELECT timestamp, service_name, body\nFROM read_otlp_logs('app-logs/*.jsonl')\nWHERE severity_text IN ('ERROR', 'FATAL')\nORDER BY timestamp DESC;\n```\n\n### Build metrics dashboards\n```sql\nCREATE TABLE metrics_gauge AS\nSELECT timestamp, service_name, metric_name, value\nFROM read_otlp_metrics_gauge('metrics/*.jsonl');\n```\n\n**[→ See more examples in the Cookbook](docs/guides/cookbook.md)**\n\n## Limits\n\nIndividual files are limited to **100 MB** to prevent memory exhaustion. This applies to entire protobuf files or individual documents in JSONL files.\n\n## What's inside\n\n**Table Functions**\n\n| Function | What it does |\n|----------|-------------|\n| `read_otlp_traces(path)` | Stream trace spans (25 columns) with identifiers, attributes, events, and links |\n| `read_otlp_logs(path)` | Read log records (15 columns) with severity, body, and trace correlation |\n| `read_otlp_metrics_gauge(path)` | Read gauge metrics (16 columns) |\n| `read_otlp_metrics_sum(path)` | Read sum/counter metrics (18 columns) with aggregation temporality |\n\n**[→ Full API Reference](docs/reference/api.md)**\n\n**Features**\n\n- **Automatic format detection** - Works with JSON, JSONL, and protobuf OTLP files (protobuf requires native extension)\n- **DuckDB file systems** - Read from local files, S3, HTTP(S), Azure Blob, GCS\n- **ClickHouse-inspired schema** - Row-based schema inspired by OpenTelemetry ClickHouse exporter\n- **Browser support** - Run queries in-browser with DuckDB-WASM (JSON only)\n\n## Installation\n\n**Option 1: Install from community (recommended)**\n\n```sql\nINSTALL otlp FROM community;\nLOAD otlp;\n```\n\n**Option 2: Build from source**\n\nSee **[CONTRIBUTING.md](CONTRIBUTING.md)** for build instructions.\n\n## Documentation\n\n**[Documentation Hub →](docs/)**\n\n📚 **Guides** - Task-based tutorials with real examples\n📖 **Reference** - Schemas, API signatures, error handling\n⚙️  **Setup** - Installation, collector configuration, sample data\n\n## How it works\n\nGenerally speaking: the idea is you load files created using the OpenTelemetry Collector file exporter.\n\n```\nOpenTelemetry     File         DuckDB OTLP          SQL\nCollector      Exporter       Extension          Results\n   │              │               │                 │\n   │  OTLP/gRPC   │               │                 │\n   ├─────────────►│  .jsonl/.pb   │                 │\n   │              ├──────────────►│  read_otlp_*()  │\n   │              │               ├────────────────►│\n   │              │               │                 │\n```\n\nThe extension reads OTLP files (JSON or protobuf), detects the format automatically, and streams strongly-typed rows into DuckDB tables. Schemas match the ClickHouse exporter format for compatibility.\n\n**[→ Learn more in Architecture Guide](docs/architecture.md)**\n\n## Schemas\n\nAll table functions emit strongly-typed columns with `snake_case` naming:\n\n- **Traces**: 25 columns - identifiers, timestamps, attributes, events, links\n- **Logs**: 15 columns - severity, body, trace correlation, attributes\n- **Metrics**: 16-18 columns depending on metric type (gauge, sum)\n\n**[→ Schema Reference](docs/reference/schemas.md)**\n\n## Need help?\n\n- **Getting started?** Read the **[Quick Start Guide](docs/get-started.md)**\n- **Have a question?** Check **[Discussions](https://github.com/smithclay/duckdb-otlp/discussions)**\n- **Found a bug?** **[Open an issue](https://github.com/smithclay/duckdb-otlp/issues)**\n- **Want to contribute?** See **[CONTRIBUTING.md](CONTRIBUTING.md)**\n\n## License\n\nMIT - See [LICENSE](LICENSE) for details\n\n---\n\n**Learn more**: [OpenTelemetry Protocol (OTLP)](https://opentelemetry.io/docs/specs/otlp/) | [ClickHouse Exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/clickhouseexporter) | [DuckDB Extensions](https://duckdb.org/docs/extensions/overview)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmithclay%2Fduckdb-otlp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmithclay%2Fduckdb-otlp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmithclay%2Fduckdb-otlp/lists"}