Skip to content

Expose outbox and access-decision metrics via a /metrics Prometheus endpoint #265

Description

@Lakes41

Difficulty: Intermediate
Type: DevOps

Background
The README documents specific Observability metrics (outbox_events_created_total, outbox_events_delivered_total, outbox_events_failed_total) but doesn't indicate they're exposed via a scrapeable endpoint.

Problem
Without a /metrics endpoint, these counters aren't consumable by standard monitoring stacks (Prometheus/Grafana), limiting operational visibility into outbox health and access-decision volume.

Expected outcome
A GET /metrics endpoint on the access-api exposes the existing outbox counters plus new counters for access decisions (access_decisions_total{decision="allowed"|"denied"}) in Prometheus text format.

Suggested implementation

  • Add prom-client to apps/access-api.
  • Register existing counters (wire them into the outbox worker where they're currently just described) and add new counters for access decisions in the policy engine call path.
  • Add a /metrics route (excluded from rate limiting and versioned auth, if applicable).
  • Document the endpoint and metrics list in README.md.

Acceptance criteria

  • /metrics returns valid Prometheus-format output
  • Existing outbox counters are actually incremented, not just described
  • New access-decision counters increment correctly per decision type
  • Endpoint documented in README

Likely affected files/directories

  • apps/access-api/src/workers/outboxWorker.ts
  • apps/access-api/src/ (new metrics route)
  • README.md

Metadata

Metadata

Assignees

Labels

GrantFox OSSGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesOfficial Campaign | FWC26Official FWC26 campaign issue — eligible for campaign scoring and rewardsdevopsInfrastructure, CI/CD pipelines, deployment automation, and toolingintermediateIntermediate difficulty tasks requiring solid experience and some context

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions