Grafana data source plugin for PFC-JSONL cold archives — query
.pfcfiles directly from Grafana dashboards via pfc-gateway.
Visualize historical logs and metrics stored as .pfc archives in Grafana — without loading them into a database. Block-level timestamp filtering means only the relevant data is decompressed.
Telegraf / Fluent Bit / Vector
↓
pfc-gateway:8765 ←──── pfc-grafana plugin
.pfc archives on S3 ↓
Grafana Dashboard
| Pain | Solution |
|---|---|
| Historical logs/metrics live in cold storage, invisible in Grafana | Query .pfc archives directly — no hot DB needed |
| Full decompression for every query is too slow | Block-level index: only relevant time windows are read |
| DuckDB power users want SQL in Grafana | Optional SQL mode via POST /query/sql |
- pfc-gateway v0.3.0+ running
- Grafana 10.0+
.pfcarchives created by any PFC ingest tool (pfc-fluentbit, pfc-vector, pfc-telegraf, etc.)
grafana cli plugins install impossibleforge-pfc-datasource# Download and extract to Grafana plugins directory
cd /var/lib/grafana/plugins
curl -L https://github.com/ImpossibleForge/pfc-grafana/releases/latest/download/impossibleforge-pfc-datasource.zip \
-o pfc-grafana.zip && unzip pfc-grafana.zip
systemctl restart grafana-server- In Grafana: Connections → Data Sources → Add → PFC-JSONL
- Set pfc-gateway URL:
http://localhost:8765 - Set API Key (if your gateway uses authentication)
- Click Save & Test — shows gateway version and SQL mode status
Select Table, Time Series, or Logs format.
- PFC File: path to
.pfcarchive (local ors3://bucket/key.pfc) - Filter: optional JSON filter
{"level": "ERROR"}— only matching rows returned - Grafana time picker sets the time range automatically
Select SQL format and write any DuckDB SQL query:
-- Log level breakdown
SELECT json_extract_string(line, '$.level') AS level,
COUNT(*) AS cnt
FROM pfc_scan('/var/lib/pfc/logs_20260101.pfc')
GROUP BY level ORDER BY cnt DESC;
-- Avg latency per service (Time Series compatible)
SELECT json_extract_string(line, '$.timestamp') AS timestamp,
json_extract_string(line, '$.service') AS service,
json_extract(line, '$.latency_ms')::FLOAT AS latency_ms
FROM pfc_scan('/var/lib/pfc/logs.pfc')
ORDER BY timestamp;sql_mode: true appears in the Save & Test output when DuckDB + pfc extension are available.
Enable SQL mode on pfc-gateway:
# Install DuckDB
curl -L https://github.com/duckdb/duckdb/releases/latest/download/duckdb_cli-linux-amd64.gz \
| gunzip > /usr/local/bin/duckdb && chmod +x /usr/local/bin/duckdb
# Install pfc extension
duckdb -c "INSTALL pfc FROM community;"Telegraf → pfc-telegraf:8767 → .pfc files on /var/lib/pfc/
↓
pfc-gateway:8765
↓
pfc-grafana plugin
↓
Grafana Dashboard
| Project | Role |
|---|---|
| pfc-jsonl | Core compression binary |
| pfc-gateway | HTTP query + ingest API (required) |
| pfc-duckdb | DuckDB community extension |
| pfc-fluentbit | Fluent Bit → PFC |
| pfc-vector | Vector.dev → PFC |
| pfc-telegraf | Telegraf → PFC |
| pfc-otel-collector | OpenTelemetry → PFC |
| pfc-kafka-consumer | Kafka → PFC |
pfc-grafana is an independent open-source project and is not affiliated with, endorsed by, or associated with Grafana Labs or the Grafana project.
pfc-grafana (this repository) is released under the MIT License — see LICENSE.
The PFC-JSONL binary (pfc_jsonl) is proprietary software — free for personal and open-source use. Commercial use requires a license: info@impossibleforge.com