| 1 | package daemon |
| 2 | |
| 3 | import ( |
| 4 | "github.com/FelineStateMachine/tinyrelay/internal/relay" |
| 5 | "github.com/FelineStateMachine/tinyrelay/internal/telemetry" |
| 6 | ) |
| 7 | |
| 8 | // InstrumentRelayConfig attaches process-level connection and subscription |
| 9 | // gauges to a relay router. Labels remain tenant-free so one process can host |
| 10 | // many tenants without creating unbounded metric cardinality. |
| 11 | func InstrumentRelayConfig(cfg relay.Config, t *telemetry.Telemetry) relay.Config { |
| 12 | if t == nil { |
| 13 | return cfg |
| 14 | } |
| 15 | cfg.OnConnection = t.Connection |
| 16 | cfg.OnSubscription = t.Subscription |
| 17 | return cfg |
| 18 | } |