diff --git a/metrics/metrics.go b/metrics/metrics.go index 3506496..d1ff8f6 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -10,7 +10,7 @@ var ( Name: "pinpoint_request_duration_milliseconds", Help: "latency of a given service - operation", Buckets: []float64{5, 10, 25, 50, 75, 100, 200, 500, 800, 1000, 3000, 5000}, - }, []string{"service", "operation"}) + }, []string{"service", "operation", "response_code"}) // RequestsTotal is the metric RequestsTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ @@ -24,24 +24,26 @@ var ( Help: "number of websocket connections for a request by service", }, []string{"service"}) - // RequestBytesSum is the metric - RequestBytesSum = prometheus.NewGaugeVec(prometheus.GaugeOpts{ - Name: "pinpoint_request_bytes_sum", - Help: "sum of bytes for a request by service - operation", - }, []string{"service", "operation"}) + // RequestBytes is the metric + RequestBytes = prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "pinpoint_request_bytes", + Help: "size of request bytes in a given service - operation", + Buckets: []float64{.5, 1, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000, 30000, 60000, 300000, 600000, 1800000, 3600000}, + }, []string{"service", "operation", "response_code"}) - // ResponseBytesSum is the metric - ResponseBytesSum = prometheus.NewGaugeVec(prometheus.GaugeOpts{ - Name: "pinpoint_response_bytes_sum", - Help: "sum of bytes for a response by service - operation", - }, []string{"service", "operation"}) + // ResponseBytes is the metric + ResponseBytes = prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "pinpoint_response_bytes", + Help: "size of response bytes in a given service - operation", + Buckets: []float64{.5, 1, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000, 30000, 60000, 300000, 600000, 1800000, 3600000}, + }, []string{"service", "operation", "response_code"}) ) func init() { prometheus.MustRegister(RequestDurationMilliseconds) prometheus.MustRegister(RequestsTotal) - prometheus.MustRegister(RequestBytesSum) - prometheus.MustRegister(ResponseBytesSum) + prometheus.MustRegister(RequestBytes) + prometheus.MustRegister(ResponseBytes) prometheus.MustRegister(WebsocketConnections) prometheus.MustRegister(prometheus.NewBuildInfoCollector()) }