summaryrefslogtreecommitdiff
path: root/f3s
AgeCommit message (Collapse)Author
2025-12-30Add historic data ingestion support to prometheus-pusherPaul Buetow
This commit extends prometheus-pusher to support ingesting historic data with custom timestamps via Prometheus Remote Write API. ## Key Changes 1. New Historic Data Module (historic.go) - GenerateHistoricMetrics: Creates metrics for specific past timestamps - PushHistoricData: Sends single datapoint via Remote Write API - BackfillHistoricData: Backfills range of historic data - Uses Protobuf + Snappy encoding per Prometheus spec 2. Enhanced Main Binary (main.go, realtime.go) - Refactored to support multiple modes - Mode 1: realtime - Push to Pushgateway (original behavior) - Mode 2: historic - Push single historic datapoint - Mode 3: backfill - Backfill range of historic data - Command-line flags for configuration 3. Prometheus Configuration (persistence-values.yaml) - Added web.enable-remote-write-receiver flag - Enables Prometheus to accept timestamped samples via Remote Write API - Required for historic data ingestion 4. Documentation (HISTORIC.md) - Complete guide for historic data ingestion - Explains limitations and best practices - Examples for all three modes - Troubleshooting guide ## Technical Details **Problem**: Pushgateway doesn't support custom timestamps - Prometheus always uses "now" when scraping. This prevents backfilling historic data. **Solution**: Use Prometheus Remote Write API which accepts timestamped samples. Requires enabling --web.enable-remote-write-receiver flag. **Data Format**: Protobuf (prompb.WriteRequest) with Snappy compression **Use Cases**: - Backfill missing data (e.g., during outage) - Import historic data from other systems - Testing with specific timestamps - Data migration scenarios ## Usage Examples ```bash # Realtime mode (original behavior) ./prometheus-pusher-historic -mode=realtime -continuous # Push data from 24 hours ago ./prometheus-pusher-historic -mode=historic -hours-ago=24 # Backfill last 48 hours with 1-hour intervals ./prometheus-pusher-historic -mode=backfill -start-hours=48 -end-hours=0 -interval=1 ``` ## Dependencies Added - github.com/prometheus/prometheus (for prompb package) - github.com/golang/snappy (for compression) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30Add Prometheus Pushgateway and data ingestion toolPaul Buetow
This commit adds a complete Prometheus data ingestion solution: 1. Pushgateway Helm Chart (f3s/pushgateway/) - Standalone helm chart for Prometheus Pushgateway - Deployed to monitoring namespace - Receives pushed metrics via HTTP POST on port 9091 2. Prometheus Pusher (f3s/prometheus-pusher/) - Standalone Go binary (12MB) for pushing metrics to Pushgateway - Demonstrates all Prometheus metric types: * Counter (app_requests_total) * Gauge (app_active_connections, app_temperature_celsius) * Histogram (app_request_duration_seconds) * Labeled Counter (app_jobs_processed_total) - Pushes metrics every 15 seconds - Includes comprehensive documentation and examples 3. Prometheus Configuration - Updated additional-scrape-configs.yaml to scrape Pushgateway - Uses honor_labels to preserve pushed metric labels Architecture: Go Binary → Pushgateway → Prometheus → Grafana The pusher binary generates realistic example metrics and pushes them to Pushgateway in Prometheus text format. Prometheus then scrapes the Pushgateway and makes the metrics available for querying and alerting. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30Fix ArgoCD to preserve password on helm upgradePaul Buetow
Remove fixed password from values.yaml so helm upgrade doesn't reset the admin password when users change it via UI. Changes: - Remove argocdServerAdminPassword from values.yaml - Leave password generation to ArgoCD default behavior - Update Justfile install message to show get-password command Behavior now: - helm install: Generates random password in argocd-initial-admin-secret - helm upgrade: Preserves existing password (does NOT reset) - helm uninstall: Deletes secret along with all resources - User password changes via UI are preserved Verified: - Password hash unchanged after helm upgrade ✅ - Secret deleted on helm uninstall ✅ - Login works before and after upgrade ✅ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30Fix ArgoCD secret management - delete with helm uninstallPaul Buetow
Change admin password handling so it's properly managed by Helm and gets deleted when running helm uninstall, while using a fixed password instead of random generation. Changes: - Set fixed argocdServerAdminPassword in values.yaml - Remove configs.secret.createSecret: false (use Helm default: true) - Remove argocd-secret.yaml (Helm creates it now) - Update Justfile to not apply manual secret - Password: "argocd-admin-default" (bcrypt hash in values.yaml) Behavior: - helm install: Creates secret with fixed password - helm upgrade: Updates secret to fixed password (resets any UI changes) - helm uninstall: Deletes secret along with all resources - Secret has Helm annotations (managed by Helm) This is standard Helm behavior - the password in values.yaml is the source of truth. User can change via UI, but helm operations will reset it to the configured value. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30Configure ArgoCD to preserve admin password across redeploymentsPaul Buetow
Ensure admin password persists through helm uninstall/install cycles by managing argocd-secret outside of Helm's control. Changes: - Set configs.secret.createSecret: false in values.yaml - Create argocd-secret.yaml with default admin password - Update Justfile to apply secret before helm install - Secret is now managed by kubectl, not Helm - Default password: "argocd-admin-default" (change after first login) Benefits: - Admin password survives helm uninstall/install - Password changes via UI/CLI are preserved - No random password regeneration on redeployments - Secret has no Helm annotations (not managed by Helm) The argocd-secret will persist across redeployments unless explicitly deleted. PVC and admin password are now both persistent. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30Configure persistent cache for ArgoCD repo-serverPaul Buetow
Enable PVC mount for ArgoCD repo-server to cache Git repositories and generated manifests, improving performance for subsequent deployments. Changes: - Mount argocd-repo-server-pvc at /home/argocd/repo-cache - Set XDG_CACHE_HOME environment variable to use persistent cache - Avoid conflict with default /tmp mount used by ArgoCD This ensures Git repo clones and Helm charts are cached persistently across pod restarts, reducing network traffic and speeding up syncs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30Add ArgoCD deployment to cicd namespacePaul Buetow
Deploy ArgoCD v3.2.3 for GitOps continuous delivery in the k3s cluster. Configuration: - New cicd namespace for CI/CD tooling - Non-HA single instance deployment (following cluster patterns) - Traefik ingress at argocd.f3s.buetow.org - Prometheus ServiceMonitor integration for metrics - 10Gi persistent volume for repo-server cache - Insecure mode with TLS termination at proxy Components deployed: - argocd-server (Web UI and API) - argocd-repo-server (Repository management) - argocd-application-controller (Application sync) - argocd-redis (State cache) - argocd-applicationset-controller (Multi-app management) Also adds argocd.f3s.buetow.org to frontends Rexfile for relayd proxy configuration. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-28Clean up Tempo datasource ConfigMap formattingPaul Buetow
Remove unnecessary quotes and comments from the Tempo datasource ConfigMap. This file is now deprecated in favor of the unified grafana-datasources-all.yaml approach, but keeping it cleaned up for historical reference. Changes: - Remove quotes from string values (datasourceUid, spanStartTimeShift, etc.) - Remove inline comments - Format tags array properly - Standardize YAML formatting Note: This ConfigMap is no longer used. Datasources are now provisioned via direct ConfigMap mounting using grafana-datasources-all.yaml. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-28Fix distributed tracing by excluding health checks from instrumentationPaul Buetow
Problem: - Only health check traces appeared in Tempo - API endpoint traces (/api/process) were not visible - Alloy OTLP receivers were not listening (needed restart) Root Causes: 1. Health check endpoints were creating massive trace volume from Kubernetes probes 2. Batch processor (100 spans) was filling with health checks before API traces could export 3. Alloy DaemonSet needed restart to activate OTLP receivers after configuration update Solution: 1. Restarted Alloy to activate OTLP gRPC (4317) and HTTP (4318) receivers 2. Excluded /health endpoint from Flask auto-instrumentation in all three services: - frontend: FlaskInstrumentor().instrument_app(app, excluded_urls="/health") - middleware: FlaskInstrumentor().instrument_app(app, excluded_urls="/health") - backend: FlaskInstrumentor().instrument_app(app, excluded_urls="/health") Result: ✅ Distributed traces now visible in Tempo with full span chains ✅ Single /api/process request creates 8 spans across 3 services: - Frontend: GET /api/process, frontend-process, POST (200ms) - Middleware: POST /api/transform, middleware-transform, GET (180ms) - Backend: GET /api/data, backend-get-data (100ms) ✅ Complete request flow traced: frontend → middleware → backend ✅ Node graph will now show service dependencies ✅ Traces-to-logs and traces-to-metrics correlation enabled 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-28Fix Grafana datasource provisioning by switching to direct ConfigMap mountingPaul Buetow
After extensive debugging (documented in problem.md), resolved the issue where Tempo and Loki datasources would not appear in Grafana despite correct configuration. Root Cause: - Sidecar-based provisioning with label discovery was not triggering the provisioner module - Multi-step indirection (sidecar → watch → write → reload) had silent failures Solution (following x-rag pattern): - Disabled sidecar datasource provisioning - Created unified grafana-datasources-all.yaml with all datasources - Mount ConfigMap directly to /etc/grafana/provisioning/datasources/ - Grafana now reads datasources on startup via built-in provisioning Changes: - NEW: grafana-datasources-all.yaml - Unified datasource configuration (Prometheus, Alertmanager, Loki, Tempo) - MODIFIED: persistence-values.yaml - Disabled sidecar, added extraVolumes/extraVolumeMounts - MODIFIED: Justfile - Updated to use unified ConfigMap, removed patch script - MODIFIED: README.md - Documented new provisioning approach - NEW: problem.md - Complete debugging journey with 16 attempts documented - DEPRECATED: loki-datasource.yaml, tempo-datasource.yaml, patch-datasources.sh (kept for history) Result: ✅ All datasources now successfully provision on Grafana startup ✅ Tempo datasource (uid=tempo) appears in Grafana with traces-to-logs correlation ✅ Loki datasource (uid=loki) appears in Grafana ✅ Simple, maintainable approach without sidecar complexity 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-28Add Grafana Tempo distributed tracing with demo applicationPaul Buetow
- Deploy Grafana Tempo in monolithic mode for distributed tracing - Configure Tempo with OTLP receivers (gRPC:4317, HTTP:4318) - Set up 10Gi filesystem storage with 7-day retention - Integrate Tempo datasource in Grafana with traces-to-logs and traces-to-metrics correlation - Update Grafana Alloy to collect and forward traces - Add OTLP receiver configuration to alloy-values.yaml - Configure batch processor for efficient trace forwarding to Tempo - Patch Alloy service to expose OTLP ports 4317/4318 - Create demo tracing application (frontend, middleware, backend) - Implement three-tier Python Flask application with OpenTelemetry instrumentation - Auto-instrument with OpenTelemetry for Flask and requests libraries - Push Docker images to private registry (registry.lan.buetow.org:30001) - Deploy via Helm chart with Traefik ingress at tracing-demo.f3s.buetow.org - Update Grafana configuration in prometheus/persistence-values.yaml - Add Tempo to additionalDataSources for automatic provisioning Files added: - tempo/values.yaml: Tempo Helm chart configuration - tempo/persistent-volumes.yaml: Storage configuration (10Gi PV/PVC) - tempo/datasource-configmap.yaml: Grafana datasource with correlations - tempo/Justfile: Installation automation - tempo/README.md: Documentation - tracing-demo/docker/frontend/: Python Flask frontend with OTel - tracing-demo/docker/middleware/: Python Flask middleware with OTel - tracing-demo/docker/backend/: Python Flask backend with OTel - tracing-demo/helm-chart/: Kubernetes deployments, services, ingress - tracing-demo/docker-image-Justfile: Docker build/push automation - tracing-demo/Justfile: Helm deployment automation - tracing-demo/README.md: Documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-28Add comprehensive ZFS monitoring for FreeBSD serversPaul Buetow
Implemented complete ZFS monitoring solution including ARC cache statistics, pool health/capacity metrics, dataset usage, and I/O throughput monitoring. Changes: - Add ZFS recording rules (9 calculated metrics for ARC hit rates, memory usage, etc.) - Add comprehensive Grafana dashboard with 19 panels across 5 rows: * Pool Overview: capacity, health, size, free space, usage trends * I/O Throughput: read/write operations and bytes per second * Dataset Statistics: table showing all datasets with usage details * ARC Cache Statistics: hit rates, size, memory usage * ARC Breakdown: data vs metadata, MRU vs MFU with pie charts - Update Justfile to deploy ZFS recording rules - Add textfile collector script on FreeBSD servers (f0, f1, f2) for pool/dataset metrics Metrics collected: - Pool: size, allocated, free, capacity %, health status - I/O: read/write operations and throughput (via zpool iostat) - Dataset: used, available, referenced space per filesystem - ARC: hit rate, size, memory usage, data/metadata breakdown Fixes: - Pool health panel properly displays ONLINE/DEGRADED/FAULTED status - All stat panels have correct options configuration 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-26add webdavPaul Buetow
2025-12-26movePaul Buetow
2025-12-26fixPaul Buetow
2025-12-26joPaul Buetow
2025-12-26fixPaul Buetow
2025-12-26delete filrerisePaul Buetow
2025-12-25observability: enable etcd metrics scrapingPaul Buetow
- Enable etcd metrics on port 2381 - Add blog post draft documenting the changes
2025-12-25revert: undo all observability changes from todayPaul Buetow
Reverts hostname relabeling and etcd metrics changes
2025-12-25observability: node-exporter hostnames + etcd metricsPaul Buetow
- Add relabel_configs to show hostnames for node-exporter targets - Enable etcd metrics scraping on port 2381 - Update blog post draft
2025-12-25observability: display hostnames instead of IPs, enable etcd metricsPaul Buetow
- Add relabel_configs to additional-scrape-configs.yaml for FreeBSD/OpenBSD hosts - Add node name relabeling for node-exporter on k3s nodes - Enable etcd metrics scraping with hostname relabeling - Add DRAFT blog post documenting the changes Amp-Thread-ID: https://ampcode.com/threads/T-019b571c-4afc-7789-becf-bc8a3c4e1e1f Co-authored-by: Amp <amp@ampcode.com>
2025-12-25use hosts not IPsPaul Buetow
2025-12-07add openbsd routing rulesPaul Buetow
2025-12-06add openbsd node exportersPaul Buetow
2025-12-06add morePaul Buetow
2025-12-06more on thisPaul Buetow
2025-12-05Fix Loki to use NFS persistent volumePaul Buetow
2025-12-05Add Grafana Loki with Alloy for log collectionPaul Buetow
2025-12-05Fix Loki URL in READMEPaul Buetow
2025-12-05Add Grafana Loki deploymentPaul Buetow
2025-12-05Add keybr.com typing tutor deploymentPaul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-ccf9cd44-5adf-4633-9f3d-d822f733af4d Co-authored-by: Amp <amp@ampcode.com>
2025-11-22add filebrowserPaul Buetow
2025-11-21works nowPaul Buetow
2025-11-21initial filerisePaul Buetow
2025-10-27change to directoryPaul Buetow
2025-10-24fixPaul Buetow
2025-10-24add persistent volumes to prometheus/grafanaPaul Buetow
2025-10-22add prometheusPaul Buetow
2025-10-18added koreader-sync-serverPaul Buetow
2025-08-13noPaul Buetow
2025-08-12add trusted originPaul Buetow
2025-08-12add linkdingPaul Buetow
2025-08-12adding linkdingPaul Buetow
2025-08-11undo debugPaul Buetow
2025-08-11debugPaul Buetow
2025-08-11fixPaul Buetow
2025-08-11fixPaul Buetow
2025-08-11fixPaul Buetow
2025-08-11initially adding radicalePaul Buetow