Skip to content

Commit

Permalink
Update prometheus labels
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf committed Jul 16, 2018
1 parent 0f7ef88 commit 4c1e501
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 60 deletions.
6 changes: 3 additions & 3 deletions deploy/grafana/dashboards/nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@
],
"targets": [
{
"expr": "histogram_quantile(0.50, sum(rate(nginx_ingress_controller_request_duration_milliseconds_bucket{ingress!=\"\",controller_class=~\"$controller_class\",namespace=~\"$namespace\"}[1m])) by (le, ingress))",
"expr": "histogram_quantile(0.50, sum(rate(nginx_ingress_controller_request_duration_seconds_bucket{ingress!=\"\",controller_class=~\"$controller_class\",namespace=~\"$namespace\"}[1m])) by (le, ingress))",
"format": "table",
"hide": false,
"instant": true,
Expand All @@ -980,7 +980,7 @@
"refId": "C"
},
{
"expr": "histogram_quantile(0.90, sum(rate(nginx_ingress_controller_request_duration_milliseconds_bucket{ingress!=\"\",controller_class=~\"$controller_class\",namespace=~\"$namespace\"}[1m])) by (le, ingress))",
"expr": "histogram_quantile(0.90, sum(rate(nginx_ingress_controller_request_duration_seconds_bucket{ingress!=\"\",controller_class=~\"$controller_class\",namespace=~\"$namespace\"}[1m])) by (le, ingress))",
"format": "table",
"hide": false,
"instant": true,
Expand All @@ -989,7 +989,7 @@
"refId": "D"
},
{
"expr": "histogram_quantile(0.99, sum(rate(nginx_ingress_controller_request_duration_milliseconds_bucket{ingress!=\"\",controller_class=~\"$controller_class\",namespace=~\"$namespace\"}[1m])) by (le, ingress))",
"expr": "histogram_quantile(0.99, sum(rate(nginx_ingress_controller_request_duration_seconds_bucket{ingress!=\"\",controller_class=~\"$controller_class\",namespace=~\"$namespace\"}[1m])) by (le, ingress))",
"format": "table",
"hide": false,
"instant": true,
Expand Down
16 changes: 8 additions & 8 deletions internal/ingress/metric/collectors/socket.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func NewSocketCollector(pod, namespace, class string) (*SocketCollector, error)

responseTime: prometheus.NewHistogramVec(
prometheus.HistogramOpts{
Name: "response_duration_milliseconds",
Name: "response_duration_seconds",
Help: "The time spent on receiving the response from the upstream server",
Namespace: PrometheusNamespace,
ConstLabels: constLabels,
Expand All @@ -130,7 +130,7 @@ func NewSocketCollector(pod, namespace, class string) (*SocketCollector, error)

requestTime: prometheus.NewHistogramVec(
prometheus.HistogramOpts{
Name: "request_duration_milliseconds",
Name: "request_duration_seconds",
Help: "The request processing time in milliseconds",
Namespace: PrometheusNamespace,
ConstLabels: constLabels,
Expand Down Expand Up @@ -171,7 +171,7 @@ func NewSocketCollector(pod, namespace, class string) (*SocketCollector, error)

upstreamLatency: prometheus.NewSummaryVec(
prometheus.SummaryOpts{
Name: "ingress_upstream_latency_milliseconds",
Name: "ingress_upstream_latency_seconds",
Help: "Upstream service latency per Ingress",
Namespace: PrometheusNamespace,
ConstLabels: constLabels,
Expand All @@ -181,15 +181,15 @@ func NewSocketCollector(pod, namespace, class string) (*SocketCollector, error)
}

sc.metricMapping = map[string]interface{}{
prometheus.BuildFQName(PrometheusNamespace, "", "request_duration_milliseconds"): sc.requestTime,
prometheus.BuildFQName(PrometheusNamespace, "", "request_size"): sc.requestLength,
prometheus.BuildFQName(PrometheusNamespace, "", "request_duration_seconds"): sc.requestTime,
prometheus.BuildFQName(PrometheusNamespace, "", "request_size"): sc.requestLength,

prometheus.BuildFQName(PrometheusNamespace, "", "response_duration_milliseconds"): sc.responseTime,
prometheus.BuildFQName(PrometheusNamespace, "", "response_size"): sc.responseLength,
prometheus.BuildFQName(PrometheusNamespace, "", "response_duration_seconds"): sc.responseTime,
prometheus.BuildFQName(PrometheusNamespace, "", "response_size"): sc.responseLength,

prometheus.BuildFQName(PrometheusNamespace, "", "bytes_sent"): sc.bytesSent,

prometheus.BuildFQName(PrometheusNamespace, "", "ingress_upstream_latency_milliseconds"): sc.upstreamLatency,
prometheus.BuildFQName(PrometheusNamespace, "", "ingress_upstream_latency_seconds"): sc.upstreamLatency,
}

return sc, nil
Expand Down
Loading

0 comments on commit 4c1e501

Please sign in to comment.