Skip to content

Commit

Permalink
add missing bits to the metrics to consolidate them with istio
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Mullen committed Nov 6, 2020
1 parent 0a6a6b4 commit 31c2216
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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())
}

0 comments on commit 31c2216

Please sign in to comment.