Skip to content

feat(server): opt-in process metrics (PAPERCUT_METRICS) - #48

Merged
ArianAr merged 1 commit into
mainfrom
feat/26-opt-in-metrics
Jul 15, 2026
Merged

feat(server): opt-in process metrics (PAPERCUT_METRICS)#48
ArianAr merged 1 commit into
mainfrom
feat/26-opt-in-metrics

Conversation

@ArianAr

@ArianAr ArianAr commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

Implements roadmap v1.1.4 / issue #26: optional structured app metrics.

  • PAPERCUT_METRICS=1 (also true / yes / on) enables collection and GET /api/metrics
  • Off by default — endpoint returns 404 when disabled
  • Counters only: pastes_created, unlocks_ok, rate_limited
  • No paste bodies, client IPs, or rate-limit keys
  • Per-process (same model as in-memory rate limits)

Test plan

  • Unit tests for metrics registry / env parsing
  • Integration: metrics 404 when off; counters + scrape when on
  • pnpm --filter @papercut/server test typecheck lint

Closes #26

Add in-memory counters (pastes_created, unlocks_ok, rate_limited) and
GET /api/metrics when PAPERCUT_METRICS is enabled. Off by default;
never records paste bodies, IPs, or rate-limit keys.

Closes #26
@ArianAr ArianAr added enhancement New feature or request area:server Next.js server / API security Security-related issue or fix (non-advisory tracking) labels Jul 15, 2026
@ArianAr
ArianAr merged commit 66382f7 into main Jul 15, 2026
9 of 10 checks passed
@ArianAr
ArianAr deleted the feat/26-opt-in-metrics branch July 15, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:server Next.js server / API enhancement New feature or request security Security-related issue or fix (non-advisory tracking)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optional opt-in metrics (no content/IP logging)

1 participant