public Task PostConsume <T>(ConsumeContext <T> context, TimeSpan duration, string consumerType) where T : class { var messageType = typeof(T).Name; PrometheusMetrics.ConsumeTimer(messageType).Observe(duration.TotalSeconds); PrometheusMetrics.MessageCounter(messageType).Inc(); if (context.SentTime != null) { PrometheusMetrics.CriticalTimer(messageType) .Observe((DateTime.UtcNow - context.SentTime.Value).TotalSeconds); } return(Task.CompletedTask); }
internal void CountMessage() => PrometheusMetrics.MessageCounter(_messageType).Inc();