Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,25 @@ ember status

Ember polls the Caddy admin API and Prometheus metrics endpoint at a regular interval (default: 1s), computes deltas and derived metrics (RPS, percentiles, error rates), and renders them through one of several output modes: an interactive [Bubble Tea](https://github.com/charmbracelet/bubbletea) TUI (default), streaming JSONL, a headless daemon with Prometheus export, or a one-shot `status` command.

## Plugins (experimental)

Ember supports a plugin system that lets third-party developers add custom tabs for visualizing metrics from additional Caddy modules (e.g., rate limiters, WAF modules, custom middleware). Plugins are compiled into the binary using Go's blank import pattern, the same approach used by Caddy itself.

Building a custom Ember binary with plugins is simple:

```go
import (
"github.com/alexandre-daubois/ember"
_ "github.com/myorg/ember-myplugin"
)

func main() { ember.Run() }
```

Plugins can provide multiple tabs, subscribe to core metrics, conditionally hide their tabs, and reuse Ember's Prometheus parser via the `pkg/metrics` package.

See the [Plugin Development Guide](docs/plugins.md) for details on building and integrating plugins.

## Documentation

Full documentation is available in the [docs/](docs/index.md) directory:
Expand All @@ -119,6 +138,7 @@ Full documentation is available in the [docs/](docs/index.md) directory:
- [Prometheus Export](docs/prometheus-export.md): Metrics, health checks, daemon mode
- [Docker](docs/docker.md): Container usage
- [Agent Skills](docs/skills.md): Skills for AI coding agents
- [Plugins](docs/plugins.md): Building custom plugins for Ember (experimental)
- [Troubleshooting](docs/troubleshooting.md): Common issues and solutions

## Contributing
Expand Down
5 changes: 3 additions & 2 deletions cmd/ember/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import (
"fmt"
"os"

"github.com/alexandre-daubois/ember/internal/app"
"github.com/alexandre-daubois/ember"
)

var version = "1.0.0-dev"

func main() {
if err := app.Run(os.Args[1:], version); err != nil {
ember.Version = version
if err := ember.Run(); err != nil {
fmt.Fprintf(os.Stderr, "error: %v\n", err)
os.Exit(1)
}
Expand Down
1,665 changes: 1,665 additions & 0 deletions coverage.txt

Large diffs are not rendered by default.

70 changes: 70 additions & 0 deletions demo-traffic.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/usr/bin/env bash
#
# Generates traffic against the local Caddy/FrankenPHP setup
# for demo purposes (Ember TUI recording).
#
# Usage: ./demo-traffic.sh [duration_seconds] [concurrency]
# Default: 60 seconds, 8 concurrent workers
#
# Requires: curl

set -euo pipefail

DURATION=${1:-60}
CONCURRENCY=${2:-8}

MAIN="https://localhost"
APP="https://app.localhost:8443"
API="https://api.localhost:9443"

ROUTES=(
"$MAIN/"
"$MAIN/"
"$MAIN/"
"$MAIN/blog/"
"$MAIN/blog/"
"$MAIN/blog/page/1"
"$MAIN/blog/rss.xml"
"$MAIN/blog/search?q=lorem"
"$MAIN/login"

"$APP/"
"$APP/"
"$APP/blog/"
"$APP/blog/page/1"
"$APP/blog/search?q=test"

"$API/"
"$API/blog/"
"$API/blog/rss.xml"

"$MAIN/leak/"
"$APP/leak/leaker"

"$MAIN/nonexistent"
"$API/this-does-not-exist"
)

ROUTE_COUNT=${#ROUTES[@]}

worker() {
local end=$((SECONDS + DURATION))
while [ $SECONDS -lt $end ]; do
curl -sk -o /dev/null "${ROUTES[$((RANDOM % ROUTE_COUNT))]}" 2>/dev/null || true
sleep "0.0$((RANDOM % 5 + 1))"
done
}

echo "Sending traffic for ${DURATION}s with ${CONCURRENCY} concurrent workers..."
echo "Press Ctrl+C to stop early."

pids=()
for ((i = 0; i < CONCURRENCY; i++)); do
worker &
pids+=($!)
done

trap 'kill "${pids[@]}" 2>/dev/null; exit 0' INT TERM

wait "${pids[@]}" 2>/dev/null
echo "Done."
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Ember is a real-time monitoring tool for [Caddy](https://caddyserver.com/) and [
- [CLI Reference](cli-reference.md): Flags, subcommands, keybindings, and shell completions
- [JSON Output](json-output.md): Streaming JSONL mode for scripting
- [Prometheus Export](prometheus-export.md): Metrics endpoint, health checks, and daemon mode
- [Plugins](plugins.md): Building custom plugins for Ember
- [Docker](docker.md): Running Ember in a container
- [AI Agent Skills](skills.md): Skills for AI coding agents (Claude Code, Cursor, Copilot, etc.)
- [Troubleshooting](troubleshooting.md): Common issues and how to resolve them
Expand Down
Loading
Loading