diff --git a/exporter/collector/integrationtest/testcases.go b/exporter/collector/integrationtest/testcases.go index 1f533d8c4..593bab0ff 100644 --- a/exporter/collector/integrationtest/testcases.go +++ b/exporter/collector/integrationtest/testcases.go @@ -23,6 +23,11 @@ var ( OTLPInputFixturePath: "testdata/fixtures/basic_counter_metrics.json", ExpectFixturePath: "testdata/fixtures/basic_counter_metrics_expect.json", }, + { + Name: "Basic Prometheus metrics", + OTLPInputFixturePath: "testdata/fixtures/basic_prometheus_metrics.json", + ExpectFixturePath: "testdata/fixtures/basic_prometheus_metrics_expect.json", + }, { Name: "Modified prefix unknown domain", OTLPInputFixturePath: "testdata/fixtures/basic_counter_metrics.json", diff --git a/exporter/collector/integrationtest/testdata/fixtures/basic_prometheus_metrics.json b/exporter/collector/integrationtest/testdata/fixtures/basic_prometheus_metrics.json new file mode 100644 index 000000000..7832381d3 --- /dev/null +++ b/exporter/collector/integrationtest/testdata/fixtures/basic_prometheus_metrics.json @@ -0,0 +1,311 @@ +{ + "resourceMetrics":[ + { + "resource":{ + "attributes":[ + { + "key":"service.name", + "value":{ + "stringValue":"demo" + } + }, + { + "key":"service.instance.id", + "value":{ + "stringValue":"localhost:2222" + } + }, + { + "key":"net.host.port", + "value":{ + "stringValue":"2222" + } + }, + { + "key":"http.scheme", + "value":{ + "stringValue":"http" + } + } + ] + }, + "instrumentationLibraryMetrics":[ + { + "instrumentationLibrary":{}, + "metrics":[ + { + "name":"scrape_series_added", + "description":"The approximate number of new series in this scrape", + "gauge":{ + "dataPoints":[ + { + "timeUnixNano":"1649443516286000000", + "asDouble":22 + } + ] + } + }, + { + "name":"ex_com_one", + "gauge":{ + "dataPoints":[ + { + "attributes":[ + { + "key":"ex_com_lemons", + "value":{ + "stringValue":"13" + } + }, + { + "key":"telemetry_sdk_language", + "value":{ + "stringValue":"go" + } + }, + { + "key":"telemetry_sdk_name", + "value":{ + "stringValue":"opentelemetry" + } + }, + { + "key":"telemetry_sdk_version", + "value":{ + "stringValue":"1.6.2" + } + } + ], + "timeUnixNano":"1649443516286000000", + "asDouble":1 + }, + { + "attributes":[ + { + "key":"A", + "value":{ + "stringValue":"1" + } + }, + { + "key":"B", + "value":{ + "stringValue":"2" + } + }, + { + "key":"C", + "value":{ + "stringValue":"3" + } + }, + { + "key":"ex_com_lemons", + "value":{ + "stringValue":"10" + } + }, + { + "key":"telemetry_sdk_language", + "value":{ + "stringValue":"go" + } + }, + { + "key":"telemetry_sdk_name", + "value":{ + "stringValue":"opentelemetry" + } + }, + { + "key":"telemetry_sdk_version", + "value":{ + "stringValue":"1.6.2" + } + } + ], + "timeUnixNano":"1649443516286000000", + "asDouble":13 + } + ] + } + }, + { + "name":"ex_com_two", + "histogram":{ + "dataPoints":[ + { + "attributes":[ + { + "key":"ex_com_lemons", + "value":{ + "stringValue":"13" + } + }, + { + "key":"telemetry_sdk_language", + "value":{ + "stringValue":"go" + } + }, + { + "key":"telemetry_sdk_name", + "value":{ + "stringValue":"opentelemetry" + } + }, + { + "key":"telemetry_sdk_version", + "value":{ + "stringValue":"1.6.2" + } + } + ], + "startTimeUnixNano":"1649443516286000000", + "timeUnixNano":"1649443516286000000", + "count":"1", + "sum":2, + "bucketCounts":[ + "0", + "0", + "1", + "0", + "0", + "0", + "0" + ], + "explicitBounds":[ + 1, + 2, + 5, + 10, + 20, + 50 + ] + }, + { + "attributes":[ + { + "key":"A", + "value":{ + "stringValue":"1" + } + }, + { + "key":"B", + "value":{ + "stringValue":"2" + } + }, + { + "key":"C", + "value":{ + "stringValue":"3" + } + }, + { + "key":"ex_com_lemons", + "value":{ + "stringValue":"10" + } + }, + { + "key":"telemetry_sdk_language", + "value":{ + "stringValue":"go" + } + }, + { + "key":"telemetry_sdk_name", + "value":{ + "stringValue":"opentelemetry" + } + }, + { + "key":"telemetry_sdk_version", + "value":{ + "stringValue":"1.6.2" + } + } + ], + "startTimeUnixNano":"1649443516286000000", + "timeUnixNano":"1649443516286000000", + "count":"2", + "sum":14, + "bucketCounts":[ + "0", + "0", + "1", + "0", + "1", + "0", + "0" + ], + "explicitBounds":[ + 1, + 2, + 5, + 10, + 20, + 50 + ] + } + ], + "aggregationTemporality":"AGGREGATION_TEMPORALITY_CUMULATIVE" + } + }, + { + "name":"up", + "description":"The scraping was successful", + "gauge":{ + "dataPoints":[ + { + "timeUnixNano":"1649443516286000000", + "asDouble":1 + } + ] + } + }, + { + "name":"scrape_duration_seconds", + "description":"Duration of the scrape", + "unit":"seconds", + "gauge":{ + "dataPoints":[ + { + "timeUnixNano":"1649443516286000000", + "asDouble":0.00699415 + } + ] + } + }, + { + "name":"scrape_samples_scraped", + "description":"The number of samples the target exposed", + "gauge":{ + "dataPoints":[ + { + "timeUnixNano":"1649443516286000000", + "asDouble":22 + } + ] + } + }, + { + "name":"scrape_samples_post_metric_relabeling", + "description":"The number of samples remaining after metric relabeling was applied", + "gauge":{ + "dataPoints":[ + { + "timeUnixNano":"1649443516286000000", + "asDouble":22 + } + ] + } + } + ] + } + ] + } + ] + } \ No newline at end of file diff --git a/exporter/collector/integrationtest/testdata/fixtures/basic_prometheus_metrics_expect.json b/exporter/collector/integrationtest/testdata/fixtures/basic_prometheus_metrics_expect.json new file mode 100644 index 000000000..8ab591a09 --- /dev/null +++ b/exporter/collector/integrationtest/testdata/fixtures/basic_prometheus_metrics_expect.json @@ -0,0 +1,1137 @@ +{ + "createTimeSeriesRequests": [ + { + "timeSeries": [ + { + "metric": { + "type": "workload.googleapis.com/scrape_series_added", + "labels": { + "service_instance_id": "localhost:2222", + "service_name": "demo" + } + }, + "resource": { + "type": "generic_task", + "labels": { + "job": "demo", + "location": "global", + "namespace": "", + "task_id": "localhost:2222" + } + }, + "metricKind": "GAUGE", + "valueType": "DOUBLE", + "points": [ + { + "interval": { + "endTime": "1970-01-01T00:00:00Z" + }, + "value": { + "doubleValue": 22 + } + } + ] + }, + { + "metric": { + "type": "workload.googleapis.com/ex_com_one", + "labels": { + "ex_com_lemons": "13", + "service_instance_id": "localhost:2222", + "service_name": "demo", + "telemetry_sdk_language": "go", + "telemetry_sdk_name": "opentelemetry", + "telemetry_sdk_version": "1.6.2" + } + }, + "resource": { + "type": "generic_task", + "labels": { + "job": "demo", + "location": "global", + "namespace": "", + "task_id": "localhost:2222" + } + }, + "metricKind": "GAUGE", + "valueType": "DOUBLE", + "points": [ + { + "interval": { + "endTime": "1970-01-01T00:00:00Z" + }, + "value": { + "doubleValue": 1 + } + } + ] + }, + { + "metric": { + "type": "workload.googleapis.com/ex_com_one", + "labels": { + "A": "1", + "B": "2", + "C": "3", + "ex_com_lemons": "10", + "service_instance_id": "localhost:2222", + "service_name": "demo", + "telemetry_sdk_language": "go", + "telemetry_sdk_name": "opentelemetry", + "telemetry_sdk_version": "1.6.2" + } + }, + "resource": { + "type": "generic_task", + "labels": { + "job": "demo", + "location": "global", + "namespace": "", + "task_id": "localhost:2222" + } + }, + "metricKind": "GAUGE", + "valueType": "DOUBLE", + "points": [ + { + "interval": { + "endTime": "1970-01-01T00:00:00Z" + }, + "value": { + "doubleValue": 13 + } + } + ] + }, + { + "metric": { + "type": "workload.googleapis.com/ex_com_two", + "labels": { + "ex_com_lemons": "13", + "service_instance_id": "localhost:2222", + "service_name": "demo", + "telemetry_sdk_language": "go", + "telemetry_sdk_name": "opentelemetry", + "telemetry_sdk_version": "1.6.2" + } + }, + "resource": { + "type": "generic_task", + "labels": { + "job": "demo", + "location": "global", + "namespace": "", + "task_id": "localhost:2222" + } + }, + "metricKind": "CUMULATIVE", + "valueType": "DISTRIBUTION", + "points": [ + { + "interval": { + "endTime": "1970-01-01T00:00:00Z", + "startTime": "1970-01-01T00:00:00Z" + }, + "value": { + "distributionValue": { + "count": "1", + "mean": 2, + "bucketOptions": { + "explicitBuckets": { + "bounds": [ + 1, + 2, + 5, + 10, + 20, + 50 + ] + } + }, + "bucketCounts": [ + "0", + "0", + "1", + "0", + "0", + "0", + "0" + ] + } + } + } + ] + }, + { + "metric": { + "type": "workload.googleapis.com/ex_com_two", + "labels": { + "A": "1", + "B": "2", + "C": "3", + "ex_com_lemons": "10", + "service_instance_id": "localhost:2222", + "service_name": "demo", + "telemetry_sdk_language": "go", + "telemetry_sdk_name": "opentelemetry", + "telemetry_sdk_version": "1.6.2" + } + }, + "resource": { + "type": "generic_task", + "labels": { + "job": "demo", + "location": "global", + "namespace": "", + "task_id": "localhost:2222" + } + }, + "metricKind": "CUMULATIVE", + "valueType": "DISTRIBUTION", + "points": [ + { + "interval": { + "endTime": "1970-01-01T00:00:00Z", + "startTime": "1970-01-01T00:00:00Z" + }, + "value": { + "distributionValue": { + "count": "2", + "mean": 7, + "bucketOptions": { + "explicitBuckets": { + "bounds": [ + 1, + 2, + 5, + 10, + 20, + 50 + ] + } + }, + "bucketCounts": [ + "0", + "0", + "1", + "0", + "1", + "0", + "0" + ] + } + } + } + ] + }, + { + "metric": { + "type": "workload.googleapis.com/up", + "labels": { + "service_instance_id": "localhost:2222", + "service_name": "demo" + } + }, + "resource": { + "type": "generic_task", + "labels": { + "job": "demo", + "location": "global", + "namespace": "", + "task_id": "localhost:2222" + } + }, + "metricKind": "GAUGE", + "valueType": "DOUBLE", + "points": [ + { + "interval": { + "endTime": "1970-01-01T00:00:00Z" + }, + "value": { + "doubleValue": 1 + } + } + ] + }, + { + "metric": { + "type": "workload.googleapis.com/scrape_duration_seconds", + "labels": { + "service_instance_id": "localhost:2222", + "service_name": "demo" + } + }, + "resource": { + "type": "generic_task", + "labels": { + "job": "demo", + "location": "global", + "namespace": "", + "task_id": "localhost:2222" + } + }, + "metricKind": "GAUGE", + "valueType": "DOUBLE", + "points": [ + { + "interval": { + "endTime": "1970-01-01T00:00:00Z" + }, + "value": { + "doubleValue": 0.00699415 + } + } + ], + "unit": "seconds" + }, + { + "metric": { + "type": "workload.googleapis.com/scrape_samples_scraped", + "labels": { + "service_instance_id": "localhost:2222", + "service_name": "demo" + } + }, + "resource": { + "type": "generic_task", + "labels": { + "job": "demo", + "location": "global", + "namespace": "", + "task_id": "localhost:2222" + } + }, + "metricKind": "GAUGE", + "valueType": "DOUBLE", + "points": [ + { + "interval": { + "endTime": "1970-01-01T00:00:00Z" + }, + "value": { + "doubleValue": 22 + } + } + ] + }, + { + "metric": { + "type": "workload.googleapis.com/scrape_samples_post_metric_relabeling", + "labels": { + "service_instance_id": "localhost:2222", + "service_name": "demo" + } + }, + "resource": { + "type": "generic_task", + "labels": { + "job": "demo", + "location": "global", + "namespace": "", + "task_id": "localhost:2222" + } + }, + "metricKind": "GAUGE", + "valueType": "DOUBLE", + "points": [ + { + "interval": { + "endTime": "1970-01-01T00:00:00Z" + }, + "value": { + "doubleValue": 22 + } + } + ] + } + ] + } + ], + "createMetricDescriptorRequests": [ + { + "metricDescriptor": { + "type": "workload.googleapis.com/scrape_series_added", + "labels": [ + { + "key": "service_instance_id" + }, + { + "key": "service_name" + } + ], + "metricKind": "GAUGE", + "valueType": "DOUBLE", + "description": "The approximate number of new series in this scrape", + "displayName": "scrape_series_added" + } + }, + { + "metricDescriptor": { + "type": "workload.googleapis.com/ex_com_one", + "labels": [ + { + "key": "A" + }, + { + "key": "B" + }, + { + "key": "C" + }, + { + "key": "ex_com_lemons" + }, + { + "key": "service_instance_id" + }, + { + "key": "service_name" + }, + { + "key": "telemetry_sdk_language" + }, + { + "key": "telemetry_sdk_name" + }, + { + "key": "telemetry_sdk_version" + } + ], + "metricKind": "GAUGE", + "valueType": "DOUBLE", + "displayName": "ex_com_one" + } + }, + { + "metricDescriptor": { + "type": "workload.googleapis.com/ex_com_two", + "labels": [ + { + "key": "A" + }, + { + "key": "B" + }, + { + "key": "C" + }, + { + "key": "ex_com_lemons" + }, + { + "key": "service_instance_id" + }, + { + "key": "service_name" + }, + { + "key": "telemetry_sdk_language" + }, + { + "key": "telemetry_sdk_name" + }, + { + "key": "telemetry_sdk_version" + } + ], + "metricKind": "CUMULATIVE", + "valueType": "DISTRIBUTION", + "displayName": "ex_com_two" + } + }, + { + "metricDescriptor": { + "type": "workload.googleapis.com/up", + "labels": [ + { + "key": "service_instance_id" + }, + { + "key": "service_name" + } + ], + "metricKind": "GAUGE", + "valueType": "DOUBLE", + "description": "The scraping was successful", + "displayName": "up" + } + }, + { + "metricDescriptor": { + "type": "workload.googleapis.com/scrape_duration_seconds", + "labels": [ + { + "key": "service_instance_id" + }, + { + "key": "service_name" + } + ], + "metricKind": "GAUGE", + "valueType": "DOUBLE", + "unit": "seconds", + "description": "Duration of the scrape", + "displayName": "scrape_duration_seconds" + } + }, + { + "metricDescriptor": { + "type": "workload.googleapis.com/scrape_samples_scraped", + "labels": [ + { + "key": "service_instance_id" + }, + { + "key": "service_name" + } + ], + "metricKind": "GAUGE", + "valueType": "DOUBLE", + "description": "The number of samples the target exposed", + "displayName": "scrape_samples_scraped" + } + }, + { + "metricDescriptor": { + "type": "workload.googleapis.com/scrape_samples_post_metric_relabeling", + "labels": [ + { + "key": "service_instance_id" + }, + { + "key": "service_name" + } + ], + "metricKind": "GAUGE", + "valueType": "DOUBLE", + "description": "The number of samples remaining after metric relabeling was applied", + "displayName": "scrape_samples_post_metric_relabeling" + } + } + ], + "selfObservabilityMetrics": { + "createTimeSeriesRequests": [ + { + "timeSeries": [ + { + "metric": { + "type": "custom.googleapis.com/opencensus/googlecloudmonitoring/point_count", + "labels": { + "status": "OK" + } + }, + "resource": { + "type": "global" + }, + "points": [ + { + "interval": { + "endTime": "1970-01-01T00:00:00Z", + "startTime": "1970-01-01T00:00:00Z" + }, + "value": { + "int64Value": "9" + } + } + ] + }, + { + "metric": { + "type": "custom.googleapis.com/opencensus/grpc.io/client/completed_rpcs", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor", + "grpc_client_status": "OK" + } + }, + "resource": { + "type": "global" + }, + "points": [ + { + "interval": { + "endTime": "1970-01-01T00:00:00Z", + "startTime": "1970-01-01T00:00:00Z" + }, + "value": { + "int64Value": "7" + } + } + ] + }, + { + "metric": { + "type": "custom.googleapis.com/opencensus/grpc.io/client/completed_rpcs", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries", + "grpc_client_status": "OK" + } + }, + "resource": { + "type": "global" + }, + "points": [ + { + "interval": { + "endTime": "1970-01-01T00:00:00Z", + "startTime": "1970-01-01T00:00:00Z" + }, + "value": { + "int64Value": "1" + } + } + ] + }, + { + "metric": { + "type": "custom.googleapis.com/opencensus/grpc.io/client/received_bytes_per_rpc", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + "resource": { + "type": "global" + }, + "points": [ + { + "interval": { + "endTime": "1970-01-01T00:00:00Z", + "startTime": "1970-01-01T00:00:00Z" + }, + "value": { + "distributionValue": { + "bucketOptions": { + "explicitBuckets": { + "bounds": [ + 0, + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ] + } + }, + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + } + } + } + ] + }, + { + "metric": { + "type": "custom.googleapis.com/opencensus/grpc.io/client/received_bytes_per_rpc", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } + }, + "resource": { + "type": "global" + }, + "points": [ + { + "interval": { + "endTime": "1970-01-01T00:00:00Z", + "startTime": "1970-01-01T00:00:00Z" + }, + "value": { + "distributionValue": { + "bucketOptions": { + "explicitBuckets": { + "bounds": [ + 0, + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ] + } + }, + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + } + } + } + ] + }, + { + "metric": { + "type": "custom.googleapis.com/opencensus/grpc.io/client/roundtrip_latency", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + "resource": { + "type": "global" + }, + "points": [ + { + "interval": { + "endTime": "1970-01-01T00:00:00Z", + "startTime": "1970-01-01T00:00:00Z" + }, + "value": { + "distributionValue": { + "bucketOptions": { + "explicitBuckets": { + "bounds": [ + 0, + 0.01, + 0.05, + 0.1, + 0.3, + 0.6, + 0.8, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 10, + 13, + 16, + 20, + 25, + 30, + 40, + 50, + 65, + 80, + 100, + 130, + 160, + 200, + 250, + 300, + 400, + 500, + 650, + 800, + 1000, + 2000, + 5000, + 10000, + 20000, + 50000, + 100000 + ] + } + }, + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + } + } + } + ] + }, + { + "metric": { + "type": "custom.googleapis.com/opencensus/grpc.io/client/roundtrip_latency", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } + }, + "resource": { + "type": "global" + }, + "points": [ + { + "interval": { + "endTime": "1970-01-01T00:00:00Z", + "startTime": "1970-01-01T00:00:00Z" + }, + "value": { + "distributionValue": { + "bucketOptions": { + "explicitBuckets": { + "bounds": [ + 0, + 0.01, + 0.05, + 0.1, + 0.3, + 0.6, + 0.8, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 10, + 13, + 16, + 20, + 25, + 30, + 40, + 50, + 65, + 80, + 100, + 130, + 160, + 200, + 250, + 300, + 400, + 500, + 650, + 800, + 1000, + 2000, + 5000, + 10000, + 20000, + 50000, + 100000 + ] + } + }, + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + } + } + } + ] + }, + { + "metric": { + "type": "custom.googleapis.com/opencensus/grpc.io/client/sent_bytes_per_rpc", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + "resource": { + "type": "global" + }, + "points": [ + { + "interval": { + "endTime": "1970-01-01T00:00:00Z", + "startTime": "1970-01-01T00:00:00Z" + }, + "value": { + "distributionValue": { + "bucketOptions": { + "explicitBuckets": { + "bounds": [ + 0, + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ] + } + }, + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + } + } + } + ] + }, + { + "metric": { + "type": "custom.googleapis.com/opencensus/grpc.io/client/sent_bytes_per_rpc", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } + }, + "resource": { + "type": "global" + }, + "points": [ + { + "interval": { + "endTime": "1970-01-01T00:00:00Z", + "startTime": "1970-01-01T00:00:00Z" + }, + "value": { + "distributionValue": { + "bucketOptions": { + "explicitBuckets": { + "bounds": [ + 0, + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ] + } + }, + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + } + } + } + ] + } + ] + } + ], + "createMetricDescriptorRequests": [ + { + "metricDescriptor": { + "type": "custom.googleapis.com/opencensus/googlecloudmonitoring/point_count", + "labels": [ + { + "key": "status" + } + ], + "metricKind": "CUMULATIVE", + "valueType": "INT64", + "unit": "1", + "description": "Count of metric points written to Cloud Monitoring.", + "displayName": "OpenCensus/googlecloudmonitoring/point_count" + } + }, + { + "metricDescriptor": { + "type": "custom.googleapis.com/opencensus/grpc.io/client/completed_rpcs", + "labels": [ + { + "key": "grpc_client_method" + }, + { + "key": "grpc_client_status" + } + ], + "metricKind": "CUMULATIVE", + "valueType": "INT64", + "unit": "1", + "description": "Count of RPCs by method and status.", + "displayName": "OpenCensus/grpc.io/client/completed_rpcs" + } + }, + { + "metricDescriptor": { + "type": "custom.googleapis.com/opencensus/grpc.io/client/received_bytes_per_rpc", + "labels": [ + { + "key": "grpc_client_method" + } + ], + "metricKind": "CUMULATIVE", + "valueType": "DISTRIBUTION", + "unit": "By", + "description": "Distribution of bytes received per RPC, by method.", + "displayName": "OpenCensus/grpc.io/client/received_bytes_per_rpc" + } + }, + { + "metricDescriptor": { + "type": "custom.googleapis.com/opencensus/grpc.io/client/roundtrip_latency", + "labels": [ + { + "key": "grpc_client_method" + } + ], + "metricKind": "CUMULATIVE", + "valueType": "DISTRIBUTION", + "unit": "ms", + "description": "Distribution of round-trip latency, by method.", + "displayName": "OpenCensus/grpc.io/client/roundtrip_latency" + } + }, + { + "metricDescriptor": { + "type": "custom.googleapis.com/opencensus/grpc.io/client/sent_bytes_per_rpc", + "labels": [ + { + "key": "grpc_client_method" + } + ], + "metricKind": "CUMULATIVE", + "valueType": "DISTRIBUTION", + "unit": "By", + "description": "Distribution of bytes sent per RPC, by method.", + "displayName": "OpenCensus/grpc.io/client/sent_bytes_per_rpc" + } + } + ] + } +}