Provides an interface for metrics recording. The implementer is expected to use an observability
framework, e.g. OpenTelemetry. There should be only one instance of MetricsRecorder per client,
all the methods in this class are expected to be called from multiple threads, hence the
implementation must be thread safe.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThe latest version available for the \u003ccode\u003eMetricsRecorder\u003c/code\u003e class is 2.63.1, as part of the \u003ccode\u003e/java/docs/reference/gax/\u003c/code\u003e package.\u003c/p\u003e\n"],["\u003cp\u003eThis page documents the \u003ccode\u003eMetricsRecorder\u003c/code\u003e interface, which is designed for recording metrics within a client using an observability framework like OpenTelemetry, ensuring that only one instance of \u003ccode\u003eMetricsRecorder\u003c/code\u003e per client exists, with all methods being thread-safe.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eMetricsRecorder\u003c/code\u003e interface includes methods to record the count and latency of RPC attempts (\u003ccode\u003erecordAttemptCount\u003c/code\u003e and \u003ccode\u003erecordAttemptLatency\u003c/code\u003e) and operations (\u003ccode\u003erecordOperationCount\u003c/code\u003e and \u003ccode\u003erecordOperationLatency\u003c/code\u003e), each requiring a count or latency value and a map of string attributes.\u003c/p\u003e\n"],["\u003cp\u003eThe versions of MetricsRecorder listed on the page are in pre-GA, and changes to pre-GA libraries might not be compatible with other pre-GA versions.\u003c/p\u003e\n"]]],[],null,[]]