PCBC-1038, PCBC-1039: Add tracing & metrics instrumentation for non-management operations#241
Conversation
883f7cd to
0531400
Compare
There was a problem hiding this comment.
Pull request overview
This pull request implements tracing and metrics instrumentation for non-management operations in the Couchbase PHP SDK, adding observability capabilities as described in the Extended Observability RFC.
Changes:
- Introduces observability infrastructure with
ObservabilityWrapperandObservabilityHandlerclasses to DRY instrumentation logic - Adds
parentSpanoption to all operation options classes for distributed tracing support - Implements
NoopTracer,NoopSpan,NoopMeter, andNoopValueRecorderas default no-op implementations - Instruments all non-management operations (KV, query, analytics, search, views) to create operation spans and record metrics
- Adds cluster name and UUID attributes fetched via the C++ Core API
- Provides comprehensive test coverage with test helpers (
TestTracer,TestSpan,TestMeter, etc.) and test cases for KV and HTTP operations
Reviewed changes
Copilot reviewed 116 out of 116 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| Couchbase/Observability/ObservabilityWrapper.php | Core wrapper class that records operations with tracing and metrics |
| Couchbase/Observability/ObservabilityHandler.php | Handler for managing span creation, tagging, and metric recording |
| Couchbase/Observability/ObservabilityConstants.php | Centralized constants for operation names, attributes, and metric names |
| Couchbase/Observability/Keyspace.php | Represents bucket/scope/collection keyspace for tagging |
| Couchbase/Observability/StatusCode.php | Enum for span status codes |
| Couchbase/NoopTracer.php, NoopSpan.php, NoopMeter.php, NoopValueRecorder.php | Default no-op implementations |
| Couchbase/RequestTracer.php, RequestSpan.php, Meter.php | Interface updates for observability |
| Couchbase/Cluster.php, Bucket.php, Scope.php, Collection.php, BinaryCollection.php | Integration of observability wrapper in core SDK classes |
| Couchbase/ClusterOptions.php | Addition of tracer and meter configuration options |
| Couchbase/*Options.php (multiple files) | Addition of parentSpan option to all operation options |
| tests/Helpers/Tracing/* | Test infrastructure for tracing |
| tests/Helpers/Metrics/* | Test infrastructure for metrics |
| tests/Observability*Test.php | Comprehensive test coverage for KV and HTTP operations |
| src/wrapper/connection_handle.* | C++ wrapper for cluster labels functionality |
| src/php_couchbase.cxx | PHP extension function for cluster labels |
| Couchbase/Utilities/Deprecations.php | Fixed error message for durability level validation |
| Couchbase/JwtAuthenticator.php | Fixed formatting issue |
Comments suppressed due to low confidence (1)
Couchbase/IncrementOptions.php:154
- The comment has improper indentation. It should be aligned with the code it documents at the same level as other method-level documentation.
/**
* @internal
*/
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
485c057 to
76204f0
Compare
|
I've pushed a change that renames |
|
@DemetrisChr this failure looks related |
Another test is creating the |
…agement operations
Changes
parentSpanoption to all operation options blocks.ObservabilityContext,ObservabilityHandler).NoopTracerandNoopMeterimplementations which are the defaults for now, until theThresholdLoggingMeterandLoggingMeterimplementations are added.