https://github.com/lex00/wetwire-observability-go
Prometheus, Alertmanager, and Grafana configuration synthesis using Go struct literals
https://github.com/lex00/wetwire-observability-go
Last synced: 5 months ago
JSON representation
Prometheus, Alertmanager, and Grafana configuration synthesis using Go struct literals
- Host: GitHub
- URL: https://github.com/lex00/wetwire-observability-go
- Owner: lex00
- License: mit
- Created: 2026-01-13T06:45:11.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-01-13T07:15:49.000Z (5 months ago)
- Last Synced: 2026-01-13T10:23:39.075Z (5 months ago)
- Language: Go
- Size: 38.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 31
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# wetwire-observability (Go)
[](https://github.com/lex00/wetwire-observability-go/actions/workflows/ci.yml)
[](https://codecov.io/gh/lex00/wetwire-observability-go)
[](https://pkg.go.dev/github.com/lex00/wetwire-observability-go)
[](https://goreportcard.com/report/github.com/lex00/wetwire-observability-go)
[](https://opensource.org/licenses/MIT)
[](https://github.com/lex00/wetwire-observability-go/releases)
Prometheus, Alertmanager, and Grafana configuration synthesis using Go struct literals.
## Installation
```bash
go install github.com/lex00/wetwire-observability-go/cmd/wetwire-obs@latest
```
## Quick Example
```go
package monitoring
import (
"time"
"github.com/lex00/wetwire-observability-go/prometheus"
"github.com/lex00/wetwire-observability-go/alertmanager"
"github.com/lex00/wetwire-observability-go/rules"
"github.com/lex00/wetwire-observability-go/grafana"
"github.com/lex00/wetwire-observability-go/promql"
)
// Shared PromQL expression used in both alert and dashboard
var ErrorRateExpr = promql.GT(
promql.Div(
promql.Sum(promql.Rate(promql.Vector("http_requests_total",
promql.Match("status", "5..")), "$__rate_interval"), "service"),
promql.Sum(promql.Rate(promql.Vector("http_requests_total"),
"$__rate_interval"), "service"),
),
promql.Scalar(0.05),
)
// Alert using shared expression
var HighErrorRate = rules.AlertingRule{
Alert: "HighErrorRate",
Expr: ErrorRateExpr,
For: 5 * time.Minute,
Severity: rules.Critical,
}
// Dashboard panel using same expression
var ErrorRatePanel = grafana.StatPanel{
Title: "Error Rate",
Targets: []any{grafana.PrometheusTarget{RefID: "A", Expr: ErrorRateExpr}},
}
```
```bash
# Generate standalone configs
wetwire-obs build . --mode=standalone
# Output: prometheus.yml, alertmanager.yml, rules/*.yml, dashboards/*.json
# Generate Prometheus Operator CRDs
wetwire-obs build . --mode=operator
# Output: manifests/*.yaml (ServiceMonitor, PrometheusRule, etc.)
```
## Features
- **Unified observability stack** - Prometheus, Alertmanager, and Grafana in one package
- **Shared PromQL types** - Same expression builders for alerts and dashboards
- **Dual output mode** - Standalone configs or Prometheus Operator CRDs
- **Row-based layout** - Auto-positioned Grafana panels
- **Type-safe references** - Direct variable references, IDE autocomplete
- **Lint enforcement** - WOB rules ensure consistent patterns
## AI-Assisted Design
Create observability configuration interactively with AI:
```bash
# Interactive design session
wetwire-obs design "Add monitoring for my API service"
# Automated testing with personas
wetwire-obs test --persona beginner "Create error rate dashboard"
```
Requires `ANTHROPIC_API_KEY`. See [CLI Reference](docs/CLI.md#design) for details.
## Documentation
- [Quick Start](docs/QUICK_START.md) - Full tutorial
- [CLI Reference](docs/CLI.md) - All commands
- [Lint Rules](docs/LINT_RULES.md) - WOB rule reference
- [FAQ](docs/FAQ.md) - Common questions
## Development
```bash
git clone https://github.com/lex00/wetwire-observability-go.git
cd wetwire-observability-go
go mod download
go test ./...
```
## License
MIT - See [LICENSE](LICENSE) for details.