Skip to content

docs(cryptify): document Prometheus /metrics endpoint and X-Cryptify-Source header #103

@dobby-coder

Description

@dobby-coder

Cryptify gained a Prometheus /metrics endpoint and a new X-Cryptify-Source channel-tagging header. Neither is documented in docs/repos/cryptify.md.

Source PRs

What needs to change in docs/repos/cryptify.md

1. New config option

Add a row to the configuration parameters table:

Parameter Description Example
metrics_scan_interval_secs Interval in seconds for the background task that samples data_dir size and file count for the storage gauges. Defaults to 60. 60

Verify the field and default against src/config.rs on the merge commit of cryptify#102.

2. New "Metrics" section

Document the GET /metrics endpoint (Prometheus text format, unauthenticated, intended for firewall- or reverse-proxy-restricted scraping). Cover the five metrics shipped in cryptify#102:

  • cryptify_uploads_total{channel} — counter, finalized uploads
  • cryptify_upload_bytes_total{channel} — counter, bytes uploaded
  • cryptify_storage_bytes — gauge, data_dir disk usage
  • cryptify_active_files — gauge, data_dir file count
  • cryptify_expired_files_total — counter, uploads purged before finalize

Note the six pre-seeded channels (website, staging-website, outlook, thunderbird, api, unknown) from cryptify#165 and why they exist (PromQL increase() baseline + dashboard visibility).

3. Channel detection / X-Cryptify-Source header

Document how the channel label is derived: explicit X-Cryptify-Source -> bearer/api-key -> Origin -> User-Agent -> unknown. Sanitized to [a-z0-9_-], max 32 chars. Mention that the official clients (website, Outlook add-in, Thunderbird add-in) now set the header explicitly so callers integrating their own client should do the same to be classified correctly.

4. API table

Add a GET /metrics row to the API surface table in this page (already present in docs/guide/architecture.md:194 and docs/repos/postguard.md:255, but not on this page).

Verification

  • npx vitepress build docs must succeed.
  • All five metric names and the header name must match the merge commit of cryptify#102 (src/metrics.rs, src/main.rs, api-description.yaml).

This agent will pick this up on the next worker spawn.

/dobby

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions