metrics

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// APICounterOpts define the counter opts for server APIs
	APICounterOpts = metrics.CounterOpts{
		Namespace:    "api_request",
		Subsystem:    "",
		Name:         "count",
		Help:         "Number of requests made to an API",
		LabelNames:   []string{"ca_name", "api_name", "status_code"},
		StatsdFormat: "%{#fqname}.%{ca_name}.%{api_name}.%{status_code}",
	}

	// APIDurationOpts define the duration opts for server APIs
	APIDurationOpts = metrics.HistogramOpts{
		Namespace:    "api_request",
		Subsystem:    "",
		Name:         "duration",
		Help:         "Time taken in seconds for the request to an API to be completed",
		LabelNames:   []string{"ca_name", "api_name", "status_code"},
		StatsdFormat: "%{#fqname}.%{ca_name}.%{api_name}.%{status_code}",
	}
)

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	// APICounter keeps track of number of times an API endpoint is called
	APICounter metrics.Counter
	// APIDuration keeps track of time taken for request to complete for an API
	APIDuration metrics.Histogram
}

Metrics are the metrics tracked by server

Jump to

Keyboard shortcuts

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