Documentation ¶
Index ¶
- Variables
- func ReportExceededRateLimiting(reporters []Reporter)
- func ReportMessageProcessDelayFromCtx(ctx context.Context, reporters []Reporter, typ string)
- func ReportNumberOfConnectedClients(reporters []Reporter, number int64)
- func ReportSysMetrics(reporters []Reporter, period time.Duration)
- func ReportTimingFromCtx(ctx context.Context, reporters []Reporter, typ string, err error)
- type Client
- type PrometheusReporter
- func (p *PrometheusReporter) ReportCount(metric string, labels map[string]string, count float64) error
- func (p *PrometheusReporter) ReportGauge(metric string, labels map[string]string, value float64) error
- func (p *PrometheusReporter) ReportHistogram(metric string, labels map[string]string, value float64) error
- func (p *PrometheusReporter) ReportSummary(metric string, labels map[string]string, value float64) error
- type Reporter
- type StatsdReporter
- func (s *StatsdReporter) ReportCount(metric string, tagsMap map[string]string, count float64) error
- func (s *StatsdReporter) ReportGauge(metric string, tagsMap map[string]string, value float64) error
- func (s *StatsdReporter) ReportHistogram(metric string, tagsMap map[string]string, value float64) error
- func (s *StatsdReporter) ReportSummary(metric string, tagsMap map[string]string, value float64) error
Constants ¶
This section is empty.
Variables ¶
var ( // ResponseTime reports the response time of handlers and rpc ResponseTime = "response_time_ns" // ConnectedClients represents the number of current connected clients in frontend servers ConnectedClients = "connected_clients" // CountServers counts the number of servers of different types CountServers = "count_servers" // ChannelCapacity represents the capacity of a channel (available slots) ChannelCapacity = "channel_capacity" // DroppedMessages reports the number of dropped messages in rpc server (messages that will not be handled) DroppedMessages = "dropped_messages" // ProcessDelay reports the message processing delay to handle the messages at the handler service ProcessDelay = "handler_delay_ns" // Goroutines reports the number of goroutines Goroutines = "goroutines" // HeapSize reports the size of heap HeapSize = "heapsize" // HeapObjects reports the number of allocated heap objects HeapObjects = "heapobjects" // WorkerJobsTotal reports the number of executed jobs WorkerJobsTotal = "worker_jobs_total" // WorkerJobsRetry reports the number of retried jobs WorkerJobsRetry = "worker_jobs_retry_total" // WorkerQueueSize reports the queue size on worker WorkerQueueSize = "worker_queue_size" // ExceededRateLimiting reports the number of requests made in a connection // after the rate limit was exceeded ExceededRateLimiting = "exceeded_rate_limiting" )
Functions ¶
func ReportExceededRateLimiting ¶
func ReportExceededRateLimiting(reporters []Reporter)
ReportExceededRateLimiting reports the number of requests made after exceeded rate limiting in a connection
func ReportMessageProcessDelayFromCtx ¶
ReportMessageProcessDelayFromCtx reports the delay to process the messages
func ReportNumberOfConnectedClients ¶
ReportNumberOfConnectedClients reports the number of connected clients
func ReportSysMetrics ¶
ReportSysMetrics reports sys metrics
Types ¶
type Client ¶
type Client interface { Count(name string, value int64, tags []string, rate float64) error Gauge(name string, value float64, tags []string, rate float64) error TimeInMilliseconds(name string, value float64, tags []string, rate float64) error }
Client is the interface to required dogstatsd functions
type PrometheusReporter ¶
type PrometheusReporter struct {
// contains filtered or unexported fields
}
PrometheusReporter reports metrics to prometheus
func GetPrometheusReporter ¶
func GetPrometheusReporter( serverType string, config config.PrometheusConfig, metricsSpecs models.CustomMetricsSpec, ) (*PrometheusReporter, error)
GetPrometheusReporter gets the prometheus reporter singleton
func (*PrometheusReporter) ReportCount ¶
func (p *PrometheusReporter) ReportCount(metric string, labels map[string]string, count float64) error
ReportCount reports a summary metric
func (*PrometheusReporter) ReportGauge ¶
func (p *PrometheusReporter) ReportGauge(metric string, labels map[string]string, value float64) error
ReportGauge reports a gauge metric
func (*PrometheusReporter) ReportHistogram ¶
func (p *PrometheusReporter) ReportHistogram(metric string, labels map[string]string, value float64) error
ReportHistogram reports a histogram metric
func (*PrometheusReporter) ReportSummary ¶
func (p *PrometheusReporter) ReportSummary(metric string, labels map[string]string, value float64) error
ReportSummary reports a summary metric
type Reporter ¶
type Reporter interface { ReportCount(metric string, tags map[string]string, count float64) error ReportSummary(metric string, tags map[string]string, value float64) error ReportHistogram(metric string, tags map[string]string, value float64) error ReportGauge(metric string, tags map[string]string, value float64) error }
Reporter interface
type StatsdReporter ¶
type StatsdReporter struct {
// contains filtered or unexported fields
}
StatsdReporter sends application metrics to statsd
func NewStatsdReporter ¶
func NewStatsdReporter( config config.StatsdConfig, serverType string, clientOrNil ...Client, ) (*StatsdReporter, error)
NewStatsdReporter returns an instance of statsd reportar and an error if something fails
func (*StatsdReporter) ReportCount ¶
ReportCount sends count reports to statsd
func (*StatsdReporter) ReportGauge ¶
ReportGauge sents the gauge value and reports to statsd
func (*StatsdReporter) ReportHistogram ¶
func (s *StatsdReporter) ReportHistogram(metric string, tagsMap map[string]string, value float64) error
ReportHistogram observes the histogram value and reports to statsd
func (*StatsdReporter) ReportSummary ¶
func (s *StatsdReporter) ReportSummary(metric string, tagsMap map[string]string, value float64) error
ReportSummary observes the summary value and reports to statsd