Skip to content

PCBC-1038, PCBC-1039: Add tracing & metrics instrumentation for management operations#244

Merged
DemetrisChr merged 1 commit intocouchbase:mainfrom
DemetrisChr:tracing-metrics-mgmt
Mar 12, 2026
Merged

PCBC-1038, PCBC-1039: Add tracing & metrics instrumentation for management operations#244
DemetrisChr merged 1 commit intocouchbase:mainfrom
DemetrisChr:tracing-metrics-mgmt

Conversation

@DemetrisChr
Copy link
Copy Markdown
Contributor

Changes

  • Add tracing & metrics instrumentation for management operations

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds observability (tracing spans + metrics) around HTTP-based management operations across multiple manager classes, and introduces/extends test coverage to validate emitted spans/metrics for these operations.

Changes:

  • Wrap management operations in ObservabilityContext::recordOperation(...) to emit spans/metrics and attach service/bucket/scope/collection context.
  • Propagate ObservabilityContext into manager instances created from Cluster, Bucket, Collection, and Scope.
  • Add ObservabilityHttpMgmtOperationsTest and initialize several typed option properties to null to avoid uninitialized-property issues.

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/ObservabilityHttpMgmtOperationsTest.php New tests asserting spans + metrics for several HTTP management operations.
Couchbase/Scope.php Passes observability context into scope-level search index manager.
Couchbase/Cluster.php Passes observability context into cluster-level management managers.
Couchbase/Bucket.php Passes observability context into bucket-level collection manager.
Couchbase/Collection.php Passes observability context into collection-level query index manager.
Couchbase/Management/BucketManager.php Wraps bucket management operations with observability.
Couchbase/Management/CollectionManager.php Wraps collection/scope management operations with observability.
Couchbase/Management/UserManager.php Wraps user/group management operations with observability.
Couchbase/Management/QueryIndexManager.php Wraps query index management operations with observability; ensures watchIndexes creates nested spans for polling.
Couchbase/Management/CollectionQueryIndexManager.php Wraps collection-level query index management operations with observability.
Couchbase/Management/SearchIndexManager.php Wraps search index management operations with observability.
Couchbase/Management/ScopeSearchIndexManager.php Wraps scope-level search index management operations with observability.
Couchbase/Management/AnalyticsIndexManager.php Wraps analytics index management operations with observability.
Couchbase/Management/GetAllScopesOptions.php Initializes typed timeout property to null.
Couchbase/Management/CreateScopeOptions.php Initializes typed timeout property to null.
Couchbase/Management/DropScopeOptions.php Initializes typed timeout property to null.
Couchbase/Management/CreateCollectionOptions.php Initializes typed timeout property to null.
Couchbase/Management/DropCollectionOptions.php Initializes typed timeout property to null.
Couchbase/Management/UpdateCollectionOptions.php Initializes typed timeout property to null.
Couchbase/Management/GetAllSearchIndexesOptions.php Initializes typed timeout property to null.
Couchbase/Management/GetSearchIndexOptions.php Initializes typed timeout property to null.
Couchbase/Management/GetIndexedSearchIndexOptions.php Initializes typed timeout property to null.
Couchbase/Management/UpsertSearchIndexOptions.php Initializes typed timeout property to null.
Couchbase/Management/DropSearchIndexOptions.php Initializes typed timeout property to null.
Couchbase/Management/PauseIngestSearchIndexOptions.php Initializes typed timeout property to null.
Couchbase/Management/ResumeIngestSearchIndexOptions.php Initializes typed timeout property to null.
Couchbase/Management/AllowQueryingSearchIndexOptions.php Initializes typed timeout property to null.
Couchbase/Management/DisallowQueryingSearchIndexOptions.php Initializes typed timeout property to null.
Couchbase/Management/FreezePlanSearchIndexOptions.php Initializes typed timeout property to null.
Couchbase/Management/UnfreezePlanSearchIndexOptions.php Initializes typed timeout property to null.
Couchbase/Management/AnalyzeDocumentOptions.php Initializes typed timeout property to null.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Couchbase/Management/CollectionManager.php
Comment thread Couchbase/Management/BucketManager.php
Comment thread Couchbase/Management/AnalyticsIndexManager.php
Comment thread Couchbase/Management/CollectionQueryIndexManager.php
Comment thread Couchbase/Management/UserManager.php
Comment thread Couchbase/Management/CreateCollectionOptions.php
@DemetrisChr DemetrisChr force-pushed the tracing-metrics-mgmt branch from 509e872 to 2d4f892 Compare March 11, 2026 11:59
@DemetrisChr DemetrisChr requested a review from Matt-Woz March 11, 2026 11:59
Matt-Woz
Matt-Woz previously approved these changes Mar 11, 2026
Copy link
Copy Markdown
Contributor

@Matt-Woz Matt-Woz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a small question

Comment thread Couchbase/Management/ScopeSearchIndexManager.php
@DemetrisChr DemetrisChr merged commit 1f42ab3 into couchbase:main Mar 12, 2026
396 of 399 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants