src/crates/netdata-log-viewer/README.md
A Netdata external plugin for querying and visualizing systemd journal entries with histogram analysis and faceted search.
This plugin provides a systemd-journal function that Netdata can call to query journal entries, compute histograms, and return faceted data for visualization in the Netdata dashboard.
┌─────────────┐
│ Netdata │
│ Agent │
└──────┬──────┘
│ stdin/stdout
│ (plugin protocol)
↓
┌──────────────────────────┐
│ otel-signal-viewer-plugin │
│ │
│ ┌───────────────┐ │
│ │ Journal │ │
│ │ Handler │ │
│ └───────────────┘ │
│ ↓ │
│ ┌───────────────┐ │
│ │ Shared State │ │
│ │ (AppState) │ │
│ └───────────────┘ │
│ ↓ │
│ ┌───────────────┐ │
│ │ histogram- │ │
│ │ service │ │
│ └───────────────┘ │
│ ↓ │
│ ┌───────────────┐ │
│ │ journal │ │
│ │ (indexing) │ │
│ └───────────────┘ │
└──────────────────────────┘
↓
┌─────────┐
│ Jaeger │ (tracing)
└─────────┘
# NOTE: Port 4318 avoids conflict with Netdata's otel-plugin on 4317
docker run -d --name jaeger \
-p 16686:16686 \
-p 4318:4317 \
jaegertracing/all-in-one:latest
cargo build --bin otel-signal-viewer-plugin --release
The plugin is designed to be spawned by Netdata:
# Netdata spawns the plugin automatically when configured
# Configure in /etc/netdata/netdata.conf:
[plugins]
otel-signal-viewer-plugin = yes
For development/testing:
# Set log level
export RUST_LOG="debug"
# Run Netdata in foreground
sudo netdata -D
# View traces
open http://localhost:16686
See QUICKSTART.md for the fast development loop.
See DEVELOPMENT.md for comprehensive documentation.
cargo build --bin otel-signal-viewer-pluginsudo systemctl restart netdatasudo journalctl -u netdata -f✅ Simple - Single binary, single mode (production-only) ✅ Fast iteration - Rebuild only the plugin, not all of Netdata ✅ Observable - Rich tracing and logging via Jaeger + stderr ✅ Production parity - Develop with exact production setup ✅ No mock infrastructure - No TCP bridges or test harnesses needed
netdata-log-viewer/
├── histogram-service/ # Core business logic (library)
├── otel-signal-viewer-plugin/ # Netdata plugin (binary)
├── types/ # Shared request/response types
├── watcher-plugin/ # DEPRECATED - no longer needed
├── lv/ # DEPRECATED - no longer needed
├── DEVELOPMENT.md # Detailed development guide
├── QUICKSTART.md # Fast reference guide
└── README.md # This file
The plugin is configured at compile time with sensible defaults:
/var/log/journal/mnt/ramfs/foyer-storageTo customize, edit create_shared_state() in otel-signal-viewer-plugin/src/main.rs.
View request traces at http://localhost:16686:
Control log verbosity with RUST_LOG:
# Debug everything
export RUST_LOG="debug"
# Selective logging
export RUST_LOG="otel_signal_viewer=trace,histogram_service=debug,journal=info"
The plugin reports its own metrics:
otel_signal_viewer.journal_calls - Successful/failed/cancelled function callsThe plugin exposes the systemd-journal function:
Request:
{
"after": 1699000000,
"before": 1699100000,
"selections": {
"PRIORITY": ["3", "4"],
"_HOSTNAME": ["server1"]
}
}
Response:
{
"status": 200,
"facets": [...],
"histogram": [...],
"available_histograms": [...],
"columns": {...},
"data": [...]
}
rt - Netdata plugin runtimehistogram-service - Histogram computationjournal - Journal file indexingtracing - Structured loggingopentelemetry - Distributed tracingopentelemetry-otlp - OTLP exporter for Jaegertokio - Async runtime# Check logs
sudo tail -f /var/log/netdata/error.log
# Run manually
sudo -u netdata /path/to/otel-signal-viewer-plugin
# Verify Jaeger is running
docker ps | grep jaeger
# Check connectivity
nc -zv localhost 4317
Check Jaeger traces for:
[Your license here]
[Contributing guidelines here]