CXXCBC-756: Move metric instrumentation points to Public API #872
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Operation-level spans are now in the Public API. The corresponding metrics should be moved at the same level, so our implementation is consistent with the RFC and to ensure we are measuring the entire duration of the high-level operation.
Changes
observability_recorderthat wraps the meter and tracer and creates the necessary spans & metrics for a given operation.db.client.operation.durationas per RFC and the Otel semantic conventionsdb.system.nameattribute to metricsoutcometoerror.type. If an error code is not one of the known Couchbase error categories, the value forerror.typeis now_OTHER.couchbase.retriesspan attribute, even if it's 0, as per RFC