OpenTelemetry collector for DuckDB
  • Go 88.6%
  • HTML 6.4%
  • Nix 5%
Find a file
renovate 68a5ae2085
All checks were successful
check / check (push) Successful in 30s
chore(deps): update spotdemo4/nix-init action to v1.58.0 (#39)
2026-07-15 05:19:45 -04:00
.forgejo chore(deps): update spotdemo4/nix-init action to v1.58.0 (#39) 2026-07-15 05:19:45 -04:00
.github/workflows chore(deps): update spotdemo4/nix-init action to v1.58.0 (#39) 2026-07-15 05:19:45 -04:00
.vscode Initial commit 2026-06-09 15:02:05 -04:00
.zed chore(zed): enable oxfmt formatting for HTML, JS, and CSS 2026-06-11 05:17:56 -04:00
benchmarks/victoriametrics build(duckdb): use prepackaged quack in linked DuckDB 2026-07-09 09:29:47 -04:00
examples/quack-dashboard build(duckdb): use prepackaged quack in linked DuckDB 2026-07-09 09:29:47 -04:00
internal build(duckdb): use prepackaged quack in linked DuckDB 2026-07-09 09:29:47 -04:00
.envrc.project Initial commit 2026-06-09 15:02:05 -04:00
.gitignore chore(gitignore): ignore duckmetrics duckdb generated files 2026-06-10 07:27:07 -04:00
.sqlfluff refactor(duckdbexporter): use duckdb appender for batched inserts 2026-06-09 16:28:24 -04:00
.sqlfluffignore build(duckdb): use prepackaged quack in linked DuckDB 2026-07-09 09:29:47 -04:00
AGENTS.md Initial commit 2026-06-09 15:02:05 -04:00
CLAUDE.md Initial commit 2026-06-09 15:02:05 -04:00
config.go feat: add telemetry endpoint and inserted metrics 2026-06-11 09:21:28 -04:00
config_test.go feat: add telemetry endpoint and inserted metrics 2026-06-11 09:21:28 -04:00
flake.lock chore(deps): lock file maintenance (#38) 2026-07-12 06:07:49 -04:00
flake.nix bump: v1.1.5 -> v1.1.6 2026-07-09 22:01:38 +00:00
go.mod fix(deps): update go modules (#36) 2026-07-09 12:32:44 -04:00
go.sum fix(deps): update go modules (#36) 2026-07-09 12:32:44 -04:00
LICENSE Initial commit 2026-06-09 15:02:05 -04:00
main.go bump: v1.1.5 -> v1.1.6 2026-07-09 22:01:38 +00:00
README.md build(duckdb): use prepackaged quack in linked DuckDB 2026-07-09 09:29:47 -04:00
treefmt.toml style(dashboard): reformat template and formatter globs 2026-06-11 05:14:04 -04:00

DuckMetrics

check vulnerable go

OpenTelemetry collector for DuckDB. Ingest metrics, traces, and logs with OpenTelemetry Protocol (OTLP) and Prometheus, and query them with SQL using Quack.

flowchart LR
    metrics[Metrics]
    traces[Traces]
    logs[Logs]

    metrics -- Prometheus --> duckmetrics[DuckMetrics]
    traces -- OTel gRPC --> duckmetrics
    logs -- OTel HTTP --> duckmetrics

    duckmetrics -- Quack --> dashboard[Dashboard]

Usage

DuckMetrics --duckdb ./telemetry.duckdb --quack.token super_secret

This starts Quack on quack:0.0.0.0:9494 by default. If --quack.token is empty, DuckMetrics generates one before starting; set --quack.token when another client needs to connect:

ATTACH 'quack:duckmetrics.example.com' AS duckmetrics (TOKEN 'super_secret');
FROM duckmetrics.query('
SELECT *
FROM otel_number_points AS points
JOIN otel_metric_series AS series USING (series_id)
');

After the Quack attach handshake, remote Quack data queries are restricted to read-only statements beginning with SELECT, FROM, WITH, DESCRIBE, or SHOW.

Dashboard

Run DuckMetrics with the dashboard enabled:

DuckMetrics --duckdb ./telemetry.duckdb --dashboard --dashboard.refresh 5s

The dashboard opens an in-memory DuckDB client, loads the linked Quack extension, attaches DuckMetrics, and serves OTel table totals plus recent metrics, traces, and logs on 0.0.0.0:8080 by default. Use --dashboard.listen to change the HTTP address.

Options

Each CLI option can also be set with an environment variable. CLI flags take precedence over environment variables.

CLI option Environment variable
--prometheus.config DUCKMETRICS_PROMETHEUS_CONFIG
--duckdb DUCKMETRICS_DUCKDB_PATH
--otlp.grpc-endpoint DUCKMETRICS_OTLP_GRPC_ENDPOINT
--otlp.http-endpoint DUCKMETRICS_OTLP_HTTP_ENDPOINT
--quack.uri DUCKMETRICS_QUACK_URI
--quack.token DUCKMETRICS_QUACK_TOKEN
--telemetry.metrics-endpoint DUCKMETRICS_TELEMETRY_METRICS_ENDPOINT

Dashboard options are available when --dashboard is set: --dashboard.listen, --dashboard.limit, and --dashboard.refresh.

Prometheus

Scrape a Prometheus config in addition to OTLP:

DuckMetrics --prometheus.config ./prometheus.yml --duckdb ./metrics.duckdb

Install

go

GOPROXY=https://trev.zip/api/packages/llc/DuckMetrics \
    go install trev.zip/llc/DuckMetrics@latest
go run trev.zip/llc/DuckMetrics@latest

docker

docker run trev.zip/llc/duckmetrics:latest

nix

nix run git+https://trev.zip/llc/DuckMetrics.git

download

https://trev.zip/llc/DuckMetrics/releases

Development

requirements

getting started

nix develop

run

nix run .#dev

format

nix fmt

check

nix flake check

build

nix build