Summary
Implement Cloud Monitoring (Metrics) — custom metric ingestion + read. Complements Cloud Logging for observability assertions in tests.
Protocol / transport
gRPC google.monitoring.v3.MetricService + REST.
Authoritative reference
- Proto:
local/google/googleapis/google/monitoring/v3/metric_service.proto (+ google/api/metric.proto, monitored_resource.proto in common protos)
- SDK:
local/google/google-cloud-java/java-monitoring
Scope (MVP)
CreateMetricDescriptor, GetMetricDescriptor, ListMetricDescriptors, DeleteMetricDescriptor
CreateTimeSeries, ListTimeSeries
ListMonitoredResourceDescriptors
- Store time series keyed by project + metric type + label set
Parity notes
TimeSeries points = interval + typed value; validate metricKind / valueType.
ListTimeSeries filter + (basic) aggregation/alignment subset.
Test plan
java-monitoring: create a custom metric descriptor, write a TimeSeries, ListTimeSeries back, assert points + labels.
Implementation guidance: Follow the google-parity workflow — read the authoritative proto/SDK under local/google/* before implementing, mirror the wire shape exactly, and validate with GCP SDK-based compatibility tests (compatibility-tests/sdk-test-java). See AGENTS.md → "Adding a New GCP Service". Keep storage namespaced by project ID via StorageFactory.
Upstream references (mirrored locally under local/google/*):
Summary
Implement Cloud Monitoring (Metrics) — custom metric ingestion + read. Complements Cloud Logging for observability assertions in tests.
Protocol / transport
gRPC
google.monitoring.v3.MetricService+ REST.Authoritative reference
local/google/googleapis/google/monitoring/v3/metric_service.proto(+google/api/metric.proto,monitored_resource.protoin common protos)local/google/google-cloud-java/java-monitoringScope (MVP)
CreateMetricDescriptor,GetMetricDescriptor,ListMetricDescriptors,DeleteMetricDescriptorCreateTimeSeries,ListTimeSeriesListMonitoredResourceDescriptorsParity notes
TimeSeriespoints = interval + typed value; validatemetricKind/valueType.ListTimeSeriesfilter + (basic) aggregation/alignment subset.Test plan
java-monitoring: create a custom metric descriptor, write aTimeSeries,ListTimeSeriesback, assert points + labels.Implementation guidance: Follow the
google-parityworkflow — read the authoritative proto/SDK underlocal/google/*before implementing, mirror the wire shape exactly, and validate with GCP SDK-based compatibility tests (compatibility-tests/sdk-test-java). SeeAGENTS.md→ "Adding a New GCP Service". Keep storage namespaced by project ID viaStorageFactory.Upstream references (mirrored locally under
local/google/*):