Download the PHP package couchbase/couchbase-opentelemetry without Composer
On this page you can find all versions of the php package couchbase/couchbase-opentelemetry. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download couchbase/couchbase-opentelemetry
More information about couchbase/couchbase-opentelemetry
Files in couchbase/couchbase-opentelemetry
Package couchbase-opentelemetry
Short Description OpenTelemetry integration for the Couchbase PHP Client
License Apache-2.0
Homepage https://www.couchbase.com
Informations about the package couchbase-opentelemetry
Couchbase PHP Client OpenTelemetry Integration
This package provides OpenTelemetry implementations of the
Couchbase PHP SDK's observability interfaces (RequestTracer, RequestSpan, Meter,
and ValueRecorder), enabling distributed tracing and metrics export via the OpenTelemetry
ecosystem.
Requirements
- PHP 8.2+
couchbase/couchbase^4.5open-telemetry/api^1.0
Installation
Usage
Tracing
Metrics
Tracing and Metrics together
Classes
| Class | Couchbase Interface | Description |
|---|---|---|
OpenTelemetryRequestTracer |
RequestTracer |
Creates OTel CLIENT spans for each SDK operation |
OpenTelemetryRequestSpan |
RequestSpan |
Wraps an OTel SpanInterface; maps Couchbase status codes |
OpenTelemetryMeter |
Meter |
Creates and caches OTel histograms for SDK metrics |
OpenTelemetryValueRecorder |
ValueRecorder |
Records values against an OTel histogram, converting units |
Unit Conversion
The Couchbase SDK reports operation durations internally in microseconds.
OpenTelemetryValueRecorder automatically converts values to seconds when the
metric's unit tag is "s" (as used for db.client.operation.duration), matching the
OpenTelemetry semantic conventions for duration metrics.
Instrumentation Scope
Both the tracer and meter register under the instrumentation scope name
com.couchbase.client/php.
Development
Running Tests
This library includes integration tests that verify the OpenTelemetry instrumentation works correctly with the Couchbase PHP SDK.
Prerequisites
-
Install dependencies:
-
Couchbase Server: Tests require a running Couchbase Server instance. You can use:
- Local installation
- Docker:
docker run -d --name couchbase -p 8091-8096:8091-8096 -p 11210-11211:11210-11211 couchbase:latest - Couchbase Cloud
-
Environment Configuration (optional):
Note: For multi-node clusters, the connection string can include multiple hosts (e.g.,
couchbase://host1,host2,host3). The tests will use the first host for administrative API calls.
Running Tests
Code Quality
This project uses automated code quality tools to maintain consistent code style and catch syntax errors. These same checks run in CI, so running them locally helps ensure your contributions pass all quality gates.
Available Commands
Code Style Configuration
The project uses PHP CS Fixer to maintain consistent code formatting. The tool will automatically format your code according to project standards.
Recommended workflow:
- Write your code
- Run
composer qualityto check for issues - Run
composer cs-fixto automatically fix style issues - Commit your changes
The composer quality command runs the same checks as our CI pipeline, so passing it locally means your PR should pass the automated quality checks.
Test Structure
- Integration Tests (
tests/Integration/): Test the full OpenTelemetry integration with real Couchbase operations - Unit Tests (
tests/excluding Integration): Currently empty, future unit tests will go here
The integration tests verify:
- Distributed tracing functionality with proper span creation and context propagation
- Metrics collection and export
- OpenTelemetry semantic conventions compliance
- Error handling and span status mapping
Continuous Integration
Tests run automatically on GitHub Actions for:
- PHP 8.2, 8.3, 8.4
- Multiple Couchbase Server versions
- Linux environment
See .github/workflows/tests.yml for the complete CI configuration.
License
Apache 2.0 — see LICENSE.
Copyright 2026-Present Couchbase, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0All versions of couchbase-opentelemetry with dependencies
couchbase/couchbase Version ^4.5
open-telemetry/api Version ^1.0
open-telemetry/exporter-otlp Version ^1.4