Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LatencyReport ¶
LatencyReport defines the time taken for a report to 3scale Endpoint should be set as "Authorize" or "Report" for backend requests Target must be one of "Backend" or "System" for a report to be processed
func NewLatencyReport ¶
func NewLatencyReport(endpoint string, duration time.Duration, url string, target Target) LatencyReport
NewLatencyReport creates a LatencyReport
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter holds configuration for the Prometheus metrics implementation
func NewMetricsReporter ¶
NewMetricsReporter creates a new Reporter
func (*Reporter) IncrementCacheHits ¶
func (r *Reporter) IncrementCacheHits()
IncrementCacheHits increments proxy configurations that have been read from the cache
func (*Reporter) ObserveLatency ¶
func (r *Reporter) ObserveLatency(serviceID string, l LatencyReport) error
ObserveLatency reports a metric to a latency histogram. Logs and returns an error in cases where the metric has not been reported.
func (*Reporter) ReportMetrics ¶
func (r *Reporter) ReportMetrics(serviceID string, l LatencyReport, s StatusReport)
ReportMetrics reports a LatencyReport and StatusReport to Prometheus. It ignores errors from creating metrics so if the error needs to be handled outside of being logged, the metrics should be reported directly.
func (*Reporter) ReportStatus ¶
func (r *Reporter) ReportStatus(serviceID string, s StatusReport) error
ReportStatus reports a hit to 3scale backend and reports status code of the result Logs and returns an error in cases where the metric has not been reported.
type StatusReport ¶
StatusReport defines a HTTP status code report from 3scale Endpoint should be set as "Authorize" or "Report" for backend requests Currently only "Backend" Target supported
func NewStatusReport ¶
func NewStatusReport(endpoint string, code int, url string, target Target) StatusReport
NewStatusReport creates a StatusReport
type Target ¶
type Target string
Target is a legitimate target to report 3scale metrics from
const Backend Target = "Backend"
Backend target should be used when reporting latency or status codes from 3scale backend
const System Target = "System"
System target should be used when reporting latency or status codes from 3scale system