feat: enhance federation-sdk with metrics tracking and new utility functions

Approval required
DH
9mo ago
+434-52

Summary by CodeRabbit

  • New Features

    • Prometheus metrics support added to the federation SDK for events, messages, rooms, and processing durations.
    • New metrics helpers to normalize origins, bucket counts, and simplify event-type labels for lower-cardinality telemetry.
    • Metrics publicly exposed and initializable for custom registries.
  • Improvements

    • Integrated tracing and timing around federation event handling and transactions.
    • Optional per-handler error hook to observe/handle handler exceptions without changing behavior.