Use GKE-specific metrics in the proxy

Associate the custom metrics with the correct monitored resource type. The labels of the monitored resource are either obtained from environment variables for the container, configured in the GKE deployment file, or queried from GCE metadate server. Using the correct monitored resource can help performance and reduced out-of-order metric writes.

Also changed the metrics display name to be more descriptive.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189184411
This commit is contained in:
jianglai 2018-03-15 07:47:33 -07:00
parent 105d62380d
commit 33ec789a44
6 changed files with 330 additions and 16 deletions

View file

@ -72,7 +72,7 @@ public class BackendMetrics {
.newEventMetric(
"/proxy/backend/request_bytes",
"Size of the backend requests sent.",
"Bytes",
"Request Bytes",
LABELS,
DEFAULT_SIZE_FITTER);
@ -81,7 +81,7 @@ public class BackendMetrics {
.newEventMetric(
"/proxy/backend/response_bytes",
"Size of the backend responses received.",
"Bytes",
"Response Bytes",
LABELS,
DEFAULT_SIZE_FITTER);
@ -90,7 +90,7 @@ public class BackendMetrics {
.newEventMetric(
"/proxy/backend/latency_ms",
"Round-trip time between a request sent and its corresponding response received.",
"Milliseconds",
"Latency Milliseconds",
LABELS,
DEFAULT_LATENCY_FITTER);