@startuml
title Before: Metrics lived inside the server binary

skinparam backgroundColor #FFFFFF
skinparam shadowing false
skinparam defaultTextAlignment center
skinparam defaultFontColor #000000
skinparam ArrowColor #333333
skinparam component {
  BackgroundColor #F7F9FC
  BorderColor #334155
  FontColor #000000
}
skinparam rectangle {
  BackgroundColor #EEF2FF
  BorderColor #3730A3
  FontColor #000000
}
skinparam note {
  BackgroundColor #FFFDEB
  BorderColor #A16207
  FontColor #000000
}

actor "Browser / Prometheus" as client
component "server binary\nsrc/bin/server.rs" as server
rectangle "YAML config\nobservability.metrics" as config
rectangle "Inline HttpMetrics\nRegistry + 2 collectors" as metrics
rectangle "Axum middleware\nrequest timing" as middleware
rectangle "GET /metrics\ntext exposition" as scrape

config --> server : enables metrics\npath + prefix
client --> server : HTTP request
server --> middleware : wraps routes
middleware --> metrics : observe(method, route,\nstatus, duration)
client --> scrape : GET /metrics
scrape --> metrics : encode registry

note right of metrics
The Prometheus registry was private
to server.rs and only tracked:
- http_requests_total
- http_request_duration_seconds
end note

note bottom of server
Adding a richer metrics page required
more server.rs code instead of a shared
observability surface.
end note
@enduml
