feat: add observability and CLI enhancements
Audit logging: - audit_log table with event tracking - app/audit.py module with log_event(), query_audit_log() - GET /audit endpoint (admin only) - configurable retention and cleanup Prometheus metrics: - app/metrics.py with custom counters - paste create/access/delete, rate limit, PoW, dedup metrics - instrumentation in API routes CLI clipboard integration: - fpaste create -C/--clipboard (read from clipboard) - fpaste create --copy-url (copy result URL) - fpaste get -c/--copy (copy content) - cross-platform: xclip, xsel, pbcopy, wl-copy Shell completions: - completions/ directory with bash/zsh/fish scripts - fpaste completion --shell command
This commit is contained in:
@@ -190,6 +190,11 @@ def setup_metrics(app: Flask) -> None:
|
||||
metrics.info("flaskpaste_info", "FlaskPaste application info", version=VERSION)
|
||||
|
||||
app.extensions["metrics"] = metrics
|
||||
|
||||
# Setup custom metrics
|
||||
from app.metrics import setup_custom_metrics
|
||||
|
||||
setup_custom_metrics(app)
|
||||
except ImportError:
|
||||
app.logger.warning("prometheus_flask_exporter not available, metrics disabled")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user