Documentation ¶
Index ¶
- Constants
- Variables
- func Init()
- func RecordResponse(inv *invocation.Invocation, statusCode int)
- type PrometheusExporter
- func (s *PrometheusExporter) Count(name string, labelNames []string, labels prometheus.Labels)
- func (s *PrometheusExporter) Gauge(name string, val float64, labelNames []string, labels prometheus.Labels)
- func (s *PrometheusExporter) Summary(name string, val float64, labelNames []string, labels prometheus.Labels)
- type PrometheusMesherSinker
Constants ¶
View Source
const ( TotalRequest = "requests_total" TotalSuccess = "successes_total" TotalFailures = "failures_total" RequestLatencySeconds = "request_latency_seconds" Error4XX = "status_4xx" Error5XX = "status_5xx" ServiceName = "servicename" AppID = "appid" Version = "version" )
Constants with attributes for metrics data
Variables ¶
View Source
var ( //LabelNames is a list with servicename, appID, version LabelNames = []string{ServiceName, AppID, Version} )
Functions ¶
func RecordResponse ¶
func RecordResponse(inv *invocation.Invocation, statusCode int)
RecordResponse record the response
Types ¶
type PrometheusExporter ¶
type PrometheusExporter struct {
// contains filtered or unexported fields
}
PrometheusExporter struct has attributes for prometheus data
func GetPrometheusExporter ¶
func GetPrometheusExporter() *PrometheusExporter
GetPrometheusExporter returns default prometheus exporter
func (*PrometheusExporter) Count ¶
func (s *PrometheusExporter) Count(name string, labelNames []string, labels prometheus.Labels)
Count function returns count
func (*PrometheusExporter) Gauge ¶
func (s *PrometheusExporter) Gauge(name string, val float64, labelNames []string, labels prometheus.Labels)
Gauge function
func (*PrometheusExporter) Summary ¶
func (s *PrometheusExporter) Summary(name string, val float64, labelNames []string, labels prometheus.Labels)
Summary function
type PrometheusMesherSinker ¶
type PrometheusMesherSinker struct {
PromRegistry prometheus.Registerer //Prometheus registry
}
PrometheusMesherSinker is the struct for prometheus configuration parameters
var ( //DefaultPrometheusExporter stores value of default prometheus exporter type DefaultPrometheusExporter = GetPrometheusExporter() //DefaultPrometheusSinker stores value of default prometheus exporter type DefaultPrometheusSinker *PrometheusMesherSinker )
Click to show internal directories.
Click to hide internal directories.