metrics

package
v0.0.0-...-4d3f714 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

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 Init

func Init()

Init function initiates all config

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
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL