Skip to content

Commit 2243e34

Browse files
author
Jon Mullen
authored
Merge pull request #125 from pinpt/shared-metrics-2
add missing bits to the metrics to consolidate them with istio
2 parents 0a6a6b4 + 31c2216 commit 2243e34

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

metrics/metrics.go

+15-13
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var (
1010
Name: "pinpoint_request_duration_milliseconds",
1111
Help: "latency of a given service - operation",
1212
Buckets: []float64{5, 10, 25, 50, 75, 100, 200, 500, 800, 1000, 3000, 5000},
13-
}, []string{"service", "operation"})
13+
}, []string{"service", "operation", "response_code"})
1414

1515
// RequestsTotal is the metric
1616
RequestsTotal = prometheus.NewCounterVec(prometheus.CounterOpts{
@@ -24,24 +24,26 @@ var (
2424
Help: "number of websocket connections for a request by service",
2525
}, []string{"service"})
2626

27-
// RequestBytesSum is the metric
28-
RequestBytesSum = prometheus.NewGaugeVec(prometheus.GaugeOpts{
29-
Name: "pinpoint_request_bytes_sum",
30-
Help: "sum of bytes for a request by service - operation",
31-
}, []string{"service", "operation"})
27+
// RequestBytes is the metric
28+
RequestBytes = prometheus.NewHistogramVec(prometheus.HistogramOpts{
29+
Name: "pinpoint_request_bytes",
30+
Help: "size of request bytes in a given service - operation",
31+
Buckets: []float64{.5, 1, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000, 30000, 60000, 300000, 600000, 1800000, 3600000},
32+
}, []string{"service", "operation", "response_code"})
3233

33-
// ResponseBytesSum is the metric
34-
ResponseBytesSum = prometheus.NewGaugeVec(prometheus.GaugeOpts{
35-
Name: "pinpoint_response_bytes_sum",
36-
Help: "sum of bytes for a response by service - operation",
37-
}, []string{"service", "operation"})
34+
// ResponseBytes is the metric
35+
ResponseBytes = prometheus.NewHistogramVec(prometheus.HistogramOpts{
36+
Name: "pinpoint_response_bytes",
37+
Help: "size of response bytes in a given service - operation",
38+
Buckets: []float64{.5, 1, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000, 30000, 60000, 300000, 600000, 1800000, 3600000},
39+
}, []string{"service", "operation", "response_code"})
3840
)
3941

4042
func init() {
4143
prometheus.MustRegister(RequestDurationMilliseconds)
4244
prometheus.MustRegister(RequestsTotal)
43-
prometheus.MustRegister(RequestBytesSum)
44-
prometheus.MustRegister(ResponseBytesSum)
45+
prometheus.MustRegister(RequestBytes)
46+
prometheus.MustRegister(ResponseBytes)
4547
prometheus.MustRegister(WebsocketConnections)
4648
prometheus.MustRegister(prometheus.NewBuildInfoCollector())
4749
}

0 commit comments

Comments
 (0)