stats

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: Apache-2.0 Imports: 3 Imported by: 1

README

stats

Prometheus statistic helper lib for Go

HTTP Server API Statistics

name type labels
http_server_requests_in_flight guage instance, job
http_server_requests_total counter instance, job, code, method, uri
http_server_request_duration_seconds histogram instance, job, method, uri
Labels
instance

Added automatically by kube and is the instance that is statting.

job

This is the name of the scrape job in the prometheus config and should be set the same as the name of the service. Querying for job should provide all the stat of that type for the service. This is added automatically.

code

The http status code of the response. This is used for alerting on specific code counts. The instrumentation code must add this label.

method

This is the http method used for the request. The instrumentation code must add this label.

uri

This is the actual api used and is added by instrumentation code

http_server_requests_in_flight

This stat shows the current number of requests in flight for a given job/service.

http_server_requests_total

This stat is used to show the total number of requests.

http_server_request_duration_seconds

This stat is used to provide a histogram of request latency. Note that the buckets need to be tuned if more precision is required from the histogram. This metric, more than the other http_server* metrics need to be researched and understood by anyone using it.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RoundTripper

func RoundTripper() http.RoundTripper

RoundTripper provides a transport for an http client that outputs prometheus stats.

func WrapHTTPHandler

func WrapHTTPHandler(name string, h http.Handler) http.Handler

WrapHTTPHandler wraps an http handler with the default http statistics implementation.

Types

This section is empty.

Jump to

Keyboard shortcuts

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