handwritten/spanner/src/metrics/README.md
The custom metric exporter, as defined in spanner-metrics-exporter.ts, is designed to work in conjunction with OpenTelemetry and the Spanner client. It converts data into its protobuf equivalent and sends it to Google Cloud Monitoring.
The exporter filters metrics based on the following conditions, utilizing values defined in constants.ts:
spanner-nodejs.attempt_latenciesattempt_countoperation_latenciesoperation_countgfe_latenciesgfe_connectivity_error_countafe_latenciesafe_connectivity_error_countThe exporter sends metrics to the Google Cloud Monitoring service endpoint, distinct from the regular client endpoint. This service endpoint operates under a different quota limit than the user endpoint and features an additional server-side filter that only permits a predefined set of metrics to pass through.
When introducing new service metrics, it is essential to ensure they are allowed through by the server-side filter as well.