static void ConfigureMetrics(string serviceName, Action <PrometheusMetricsOptions> configure) { var options = PrometheusMetricsOptions.Default; configure?.Invoke(options); PrometheusMetrics.TryConfigure(GetServiceName(serviceName), options); }
public static void ConnectMetrics(this IBusControl busControl, string serviceName = "") { PrometheusMetrics.TryConfigure( string.IsNullOrWhiteSpace(serviceName) ? Path.GetFileNameWithoutExtension(Process.GetCurrentProcess().MainModule.FileName) : serviceName); busControl.ConnectReceiveObserver(new PrometheusMetricsObservers(serviceName)); }
public static void UsePrometheusMetrics <T>(this IPipeConfigurator <T> configurator, string serviceName = null) where T : class, ConsumeContext { PrometheusMetrics.TryConfigure( string.IsNullOrWhiteSpace(serviceName) ? Path.GetFileNameWithoutExtension(Process.GetCurrentProcess().MainModule.FileName) : serviceName); configurator.AddPipeSpecification(new PrometheusSpecification <T>()); }
public PrometheusMetricsObservers(string serviceName) { PrometheusMetrics.TryConfigure(serviceName); }