Documentation ¶
Overview ¶
Package jsonapi implements the json api related metrics documented here: https://lab.jamit.de/pace/web/meta/wikis/concept/metrics#m2-microservice-any-pace-microservice
Index ¶
Constants ¶
const ( TypeRequest = "req" TypeResponse = "resp" )
Variables ¶
This section is empty.
Functions ¶
func AddPaceAPIHTTPRequestDurationSeconds ¶
AddPaceAPIHTTPRequestDurationSeconds adds an observed value for the pace_api_http_request_duration_seconds histogram metric
func AddPaceAPIHTTPSizeBytes ¶ added in v0.1.12
AddPaceAPIHTTPSizeBytes adds an observed value for the pace_api_http_size_bytes histogram metric.
func IncPaceAPIHTTPRequestTotal ¶
func IncPaceAPIHTTPRequestTotal(code, method, path, service, clientID string)
IncPaceAPIHTTPRequestTotal increments the pace_api_http_request_total counter metric
Types ¶
type Metric ¶
type Metric struct { http.ResponseWriter // contains filtered or unexported fields }
Metric is an http.ResponseWriter implementing metrics collector because the metrics depend on the http StatusCode.
func NewMetric ¶
NewMetric creates a new metric collector (per request) with given service and path (pattern! not the request path) and collects the pace_api_http_size_bytes histogram metric.
func (*Metric) WriteHeader ¶
WriteHeader captures the status code for metric submission and collects the pace_api_http_request_total counter and pace_api_http_request_duration_seconds histogram metric