Skip to content

Otel integration#135

Merged
cb-alish merged 4 commits into
masterfrom
otel-integration
Jul 1, 2026
Merged

Otel integration#135
cb-alish merged 4 commits into
masterfrom
otel-integration

Conversation

@cb-karthikp

@cb-karthikp cb-karthikp commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

• Add optional OpenTelemetry telemetry via TelemetryAdapter on ChargebeeClient / Environment
• Emit one chargebee.{resource}.{operation} CLIENT span per API call (retries reuse the same span)
• Add Chargebee\Telemetry* types, helpers, and span attribute keys (OTel HTTP semconv + chargebee.*)
• Wire resource/operation metadata through action request builders
• Add telemetry unit tests (TelemetryExecutorTest, TelemetrySupportTest)

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 251c4049-0c99-4ba4-982e-1a8c65df4ec9

📥 Commits

Reviewing files that changed from the base of the PR and between ae25b03 and 5cbcc9c.

📒 Files selected for processing (5)
  • README.md
  • src/Telemetry/TelemetryExecutor.php
  • src/Telemetry/TelemetrySupport.php
  • tests/Telemetry/TelemetryExecutorTest.php
  • tests/Telemetry/TelemetrySupportTest.php
✅ Files skipped from review due to trivial changes (2)
  • README.md
  • src/Telemetry/TelemetrySupport.php

Walkthrough

Adds optional OpenTelemetry telemetry to the Chargebee PHP SDK (v4.23.0) via a new Chargebee\Telemetry namespace, payload telemetry metadata, request execution wrapping, and updated action builders, docs, and tests.

Changes

OpenTelemetry Integration

Layer / File(s) Summary
Telemetry interface and DTOs
src/Telemetry/TelemetryAdapter.php, src/Telemetry/RequestTelemetryContext.php, src/Telemetry/RequestTelemetryError.php, src/Telemetry/RequestTelemetryResult.php, src/Telemetry/TelemetryAttributeKeys.php
Defines the telemetry adapter interface, request context/result/error DTOs, and telemetry attribute key constants.
TelemetrySupport utilities and attributes
src/Telemetry/TelemetrySupport.php
Provides span naming, API version resolution, attribute builders, telemetry context/result builders, and error/status extraction helpers.
Payload and response telemetry fields
src/ValueObjects/Transporters/ChargebeePayload.php, src/ValueObjects/Transporters/ChargebeePayloadBuilder.php, src/ValueObjects/ResponseObject.php
Adds telemetry resource/operation fields to payload builders and payload objects, preserves them through header changes, and stores HTTP status on response objects.
TelemetryExecutor core execution
src/Telemetry/TelemetryExecutor.php
Wraps API execution with optional telemetry adapter hooks, injects request headers, records success/failure results, and logs adapter failures without interrupting request flow.
Environment and client wiring
src/Environment.php, src/ChargebeeClient.php, src/ValueObjects/APIRequester.php
Stores an optional telemetry adapter on Environment, wires the client option into it, and delegates request execution through TelemetryExecutor.
Action payload telemetry tags
src/Actions/*
Updates action request builders across the SDK to attach telemetry resource and operation metadata before each request is built and sent.
Tests, docs, and version bump
tests/Telemetry/TelemetryExecutorTest.php, tests/Telemetry/TelemetrySupportTest.php, README.md, CHANGELOG.md, VERSION, src/Version.php
Expands telemetry test coverage, adds OpenTelemetry usage documentation, and bumps the package version to 4.23.0.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes


Comment @coderabbitai help to get the list of available commands.

@snyk-io

snyk-io Bot commented Jun 30, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cb-karthikp cb-karthikp marked this pull request as ready for review July 1, 2026 04:56
@cb-karthikp cb-karthikp requested a review from cb-alish July 1, 2026 05:02
@cb-alish cb-alish merged commit ebfec77 into master Jul 1, 2026
2 of 3 checks passed
@cb-alish cb-alish deleted the otel-integration branch July 1, 2026 06:46
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.

2 participants