Skip to content

feat: add public metrics endpoint #290

@tim-hm

Description

@tim-hm

Problem

To improve observability and understand the overall health and activity of the network, ⁠nildb nodes need to expose key metrics publicly.

Proposed Solution

  • Create a public, unauthenticated endpoint at ⁠/metrics.
  • Expose metrics in a standard format compatible with monitoring tools like Prometheus.
  • Initial metrics should include:
    • Usage Metrics: ⁠nildb_total_stored_bytes, ⁠nildb_total_secrets_stored, ⁠nildb_total_records_stored
    • Activity Metrics: ⁠nildb_http_requests_total (aggregated all codes and methods), ⁠nildb_active_builders_total

Acceptance Criteria

  • A GET request to ⁠/metrics on a node returns a plain text response with the specified metrics.
  • The metrics are correctly formatted for Prometheus scraping.

  • The endpoint is documented via openapi.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions