Documentation
¶
Index ¶
- func Log() *zap.Logger
- func Logs() *zap.SugaredLogger
- func RegisterLogger(l *zap.Logger)
- func RegisterReporter(r Reporter)
- type NopReporter
- type PrometheusReporter
- func (p *PrometheusReporter) Counter(metric string, val float64)
- func (p *PrometheusReporter) Gauge(metric string, val float64)
- func (p *PrometheusReporter) Histogram(metric string, val float64)
- func (p *PrometheusReporter) Inc(metric string)
- func (p *PrometheusReporter) RegisterCounter(name string, c prometheus.Counter)
- func (p *PrometheusReporter) RegisterCounterVec(name string, c *prometheus.CounterVec)
- func (p *PrometheusReporter) RegisterGauge(name string, c prometheus.Gauge)
- func (p *PrometheusReporter) RegisterGaugeVec(name string, c prometheus.GaugeVec)
- func (p *PrometheusReporter) RegisterHistogram(name string, c prometheus.Histogram)
- func (p *PrometheusReporter) RegisterHistogramVec(name string, c *prometheus.HistogramVec)
- func (p *PrometheusReporter) TimeEnd(metric string)
- func (p *PrometheusReporter) TimeStart(metric string)
- type Reporter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterLogger ¶
RegisterLogger new logger as main logger for service RegisterLogger is NOT THREAD SAFE
func RegisterReporter ¶
func RegisterReporter(r Reporter)
RegisterReporter change current used reporter with provider default reporter is NopReporter that do nothing
Types ¶
type NopReporter ¶
type NopReporter struct { }
NopReporter is reporter that does nothing
func (NopReporter) Histogram ¶
func (n NopReporter) Histogram(_ string, _ float64)
Histogram does nothing
type PrometheusReporter ¶
type PrometheusReporter struct {
// contains filtered or unexported fields
}
PrometheusReporter is a reporter that allow you to "send" metrics to prometheus to allow use all of prometheus metric has format: metric_name;label:value,label1:value2
func NewPrometheusReporter ¶
func NewPrometheusReporter() *PrometheusReporter
NewPrometheusReporter create instance of reporter that allow you to report stats to prometheus
func (*PrometheusReporter) Counter ¶
func (p *PrometheusReporter) Counter(metric string, val float64)
Counter increment value of metric by val metric schema: metric_name;label:value,label1:value2
func (*PrometheusReporter) Gauge ¶
func (p *PrometheusReporter) Gauge(metric string, val float64)
Gauge increment value of metric by val metric schema: metric_name;label:value,label1:value2
func (*PrometheusReporter) Histogram ¶
func (p *PrometheusReporter) Histogram(metric string, val float64)
Histogram observer value of metric histogram metric schema: metric_name;label:value,label1:value2
func (*PrometheusReporter) Inc ¶
func (p *PrometheusReporter) Inc(metric string)
Inc increment value of metric metric schema: metric_name;label:value,label1:value2
func (*PrometheusReporter) RegisterCounter ¶
func (p *PrometheusReporter) RegisterCounter(name string, c prometheus.Counter)
RegisterCounter register counter in prometheus default registry and add to map counter
func (*PrometheusReporter) RegisterCounterVec ¶
func (p *PrometheusReporter) RegisterCounterVec(name string, c *prometheus.CounterVec)
RegisterCounterVec register counterVec in prometheus default registry and add to map counter
func (*PrometheusReporter) RegisterGauge ¶
func (p *PrometheusReporter) RegisterGauge(name string, c prometheus.Gauge)
RegisterGauge register gauge in prometheus default registry and add to map counter
func (*PrometheusReporter) RegisterGaugeVec ¶
func (p *PrometheusReporter) RegisterGaugeVec(name string, c prometheus.GaugeVec)
RegisterGaugeVec register gaugeVec in prometheus default registry and add to map counter
func (*PrometheusReporter) RegisterHistogram ¶
func (p *PrometheusReporter) RegisterHistogram(name string, c prometheus.Histogram)
RegisterHistogram register histogram in prometheus default registry and add to map counter
func (*PrometheusReporter) RegisterHistogramVec ¶
func (p *PrometheusReporter) RegisterHistogramVec(name string, c *prometheus.HistogramVec)
RegisterHistogramVec register histogramVec in prometheus default registry and add to map counter
func (*PrometheusReporter) TimeEnd ¶
func (p *PrometheusReporter) TimeEnd(metric string)
TimeEnd - end time measure for given metric
func (*PrometheusReporter) TimeStart ¶
func (p *PrometheusReporter) TimeStart(metric string)
TimeStart - stat time measure for given metric Result will be histogram of time metric schema: metric_name;label:value,label1:value2