a-ariff / a-ariff/rust-selfhost-server

Add Prometheus metrics integration

Open
#2 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue help wanted
Dominant language
Rust
Stars
2
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Integrate Prometheus metrics with request counts, response times, error rates, and system metrics. Add /metrics endpoint and Grafana dashboard examples.

Acceptance Criteria

  • Add Prometheus metrics library to Cargo.toml dependencies
  • Implement metrics collection for:
    • HTTP request count by method and status code
    • Request duration/response times (histogram)
    • Active connection count
    • Error rates by endpoint
    • System metrics (CPU, memory usage)
  • Create /metrics endpoint that exposes metrics in Prometheus format
  • Add middleware to automatically collect HTTP metrics
  • Include example Grafana dashboard configuration
  • Document metrics collection and monitoring setup
  • Add Docker Compose configuration for local Prometheus/Grafana stack
  • Ensure metrics collection has minimal performance impact

Technical Notes

  • Use prometheus crate for metrics collection
  • Consider using metrics crate as abstraction layer
  • Implement proper error handling for metrics collection
  • Add configuration options to enable/disable specific metric types
  • Follow Prometheus naming conventions for metrics

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting Cargo.toml and the server's HTTP entry points to understand the existing Rust request handling. Then determine where middleware and the /metrics endpoint belong, and review the Prometheus and Grafana configuration requirements. Done means the requested metrics, endpoint, dashboard example, documentation, Docker Compose stack, and configuration options are implemented with tests or verification for the acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker-compose, grafana, prometheus, rust
Domain
api, backend, devops, documentation, observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.