77using OpenShock . Common . Redis . PubSub ;
88using OpenShock . Common . Services . RedisPubSub ;
99using OpenShock . LiveControlGateway . Controllers ;
10+ using OpenShock . LiveControlGateway . Options ;
1011using Redis . OM . Contracts ;
1112using StackExchange . Redis ;
1213
@@ -37,13 +38,15 @@ public sealed class HubLifetimeManager
3738 /// <param name="redisConnectionProvider"></param>
3839 /// <param name="redisPubService"></param>
3940 /// <param name="loggerFactory"></param>
41+ /// <param name="lcgOptions"></param>
4042 /// <param name="meter"></param>
4143 public HubLifetimeManager (
4244 IDbContextFactory < OpenShockContext > dbContextFactory ,
4345 IConnectionMultiplexer connectionMultiplexer ,
4446 IRedisConnectionProvider redisConnectionProvider ,
4547 IRedisPubService redisPubService ,
4648 ILoggerFactory loggerFactory ,
49+ LcgOptions lcgOptions ,
4750 [ FromKeyedServices ( "OpenShock.Gateway.Meter" ) ] Meter meter
4851 )
4952 {
@@ -56,11 +59,13 @@ public HubLifetimeManager(
5659 _logger = _loggerFactory . CreateLogger < HubLifetimeManager > ( ) ;
5760
5861
62+ var gatewayFqdn = new KeyValuePair < string , object ? > ( "gateway_fqdn" , lcgOptions . Fqdn ) ;
63+
5964 meter . CreateObservableUpDownCounter ( "openshock_hub_connections" , ( ) =>
6065 {
6166 return new [ ]
6267 {
63- new Measurement < int > ( _lifetimes . Count )
68+ new Measurement < int > ( _lifetimes . Count , gatewayFqdn )
6469 } ;
6570 } , "connections" , "Current number of connected hubs" ) ;
6671 }
0 commit comments