Otel integration#127
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (8)
💤 Files with no reviewable changes (1)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (4)
WalkthroughThis PR adds optional OpenTelemetry-style telemetry to Chargebee API calls. It introduces telemetry contracts, helper/executor modules, client/request wiring, per-operation resource metadata across model methods, and documentation/tests. The SDK version is bumped to 3.25.0. ChangesTelemetry Instrumentation
Estimated code review effort: 4 (Complex) | ~60 minutes Suggested labels: enhancement, telemetry, documentation Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
chargebee/models/omnichannel_subscription/operations.py (1)
126-149: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winInconsistent operation-name casing.
operation="omnichannel_transactionsForOmnichannelSubscription"mixes snake_case with camelCase, unlike every other operation string in this PR (all pure camelCase, e.g.retrieve,list,move). This will produce an oddly-cased span/operation name in telemetry dashboards vs. its siblings.🏷️ Suggested fix
- resource="omnichannelSubscription", - operation="omnichannel_transactionsForOmnichannelSubscription", + resource="omnichannelSubscription", + operation="omnichannelTransactionsForOmnichannelSubscription",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@chargebee/models/omnichannel_subscription/operations.py` around lines 126 - 149, The operation name passed from omnichannel_transactions_for_omnichannel_subscription is inconsistently cased and mixes snake_case with camelCase. Update the operation argument in the request.send call for this method so it matches the other operation strings in the codebase and uses a single pure camelCase name, keeping it consistent with sibling operations like retrieve and list.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@chargebee/models/alert_status/operations.py`:
- Around line 38-39: The operation names in the AlertStatus operations
definitions are inconsistent with the rest of the PR and should be renamed to
clean camelCase. Update the `operation` values in the `AlertStatus` operations
module, including the entries for `alert_statusesForSubscription` and
`alert_statusesForAlert`, so they follow the same naming style as other
operation symbols like `createTransfers` and `addCouponCodes`. Keep the
`resource` unchanged and only normalize the operation identifiers used for
telemetry/span naming.
---
Nitpick comments:
In `@chargebee/models/omnichannel_subscription/operations.py`:
- Around line 126-149: The operation name passed from
omnichannel_transactions_for_omnichannel_subscription is inconsistently cased
and mixes snake_case with camelCase. Update the operation argument in the
request.send call for this method so it matches the other operation strings in
the codebase and uses a single pure camelCase name, keeping it consistent with
sibling operations like retrieve and list.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: 3e3e7564-296f-4d79-b39f-f6cd7f95c1de
📒 Files selected for processing (81)
CHANGELOG.mdREADME.mdVERSIONchargebee/__init__.pychargebee/environment.pychargebee/main.pychargebee/models/addon/operations.pychargebee/models/address/operations.pychargebee/models/alert/operations.pychargebee/models/alert_status/operations.pychargebee/models/attached_item/operations.pychargebee/models/business_entity/operations.pychargebee/models/card/operations.pychargebee/models/comment/operations.pychargebee/models/configuration/operations.pychargebee/models/coupon/operations.pychargebee/models/coupon_code/operations.pychargebee/models/coupon_set/operations.pychargebee/models/credit_note/operations.pychargebee/models/currency/operations.pychargebee/models/customer/operations.pychargebee/models/customer_entitlement/operations.pychargebee/models/differential_price/operations.pychargebee/models/entitlement/operations.pychargebee/models/entitlement_override/operations.pychargebee/models/estimate/operations.pychargebee/models/event/operations.pychargebee/models/export/operations.pychargebee/models/feature/operations.pychargebee/models/gift/operations.pychargebee/models/hosted_page/operations.pychargebee/models/in_app_subscription/operations.pychargebee/models/invoice/operations.pychargebee/models/invoice_estimate/operations.pychargebee/models/item/operations.pychargebee/models/item_entitlement/operations.pychargebee/models/item_family/operations.pychargebee/models/item_price/operations.pychargebee/models/offer_event/operations.pychargebee/models/offer_fulfillment/operations.pychargebee/models/omnichannel_one_time_order/operations.pychargebee/models/omnichannel_subscription/operations.pychargebee/models/omnichannel_subscription_item/operations.pychargebee/models/order/operations.pychargebee/models/payment_intent/operations.pychargebee/models/payment_schedule_scheme/operations.pychargebee/models/payment_source/operations.pychargebee/models/payment_voucher/operations.pychargebee/models/personalized_offer/operations.pychargebee/models/plan/operations.pychargebee/models/portal_session/operations.pychargebee/models/price_variant/operations.pychargebee/models/pricing_page_session/operations.pychargebee/models/promotional_credit/operations.pychargebee/models/purchase/operations.pychargebee/models/quote/operations.pychargebee/models/ramp/operations.pychargebee/models/recorded_purchase/operations.pychargebee/models/resource_migration/operations.pychargebee/models/rule/operations.pychargebee/models/site_migration_detail/operations.pychargebee/models/subscription/operations.pychargebee/models/subscription_entitlement/operations.pychargebee/models/time_machine/operations.pychargebee/models/transaction/operations.pychargebee/models/unbilled_charge/operations.pychargebee/models/usage/operations.pychargebee/models/usage_charge/operations.pychargebee/models/usage_event/operations.pychargebee/models/usage_file/operations.pychargebee/models/usage_summary/operations.pychargebee/models/virtual_bank_account/operations.pychargebee/models/webhook_endpoint/operations.pychargebee/request.pychargebee/telemetry/__init__.pychargebee/telemetry/telemetry_executor.pychargebee/telemetry/telemetry_support.pychargebee/telemetry/types.pychargebee/version.pytests/test_telemetry.pytests/test_telemetry_support.py
TBA
Added optional OpenTelemetry-compatible telemetry for Chargebee API calls. Introduced telemetry types/executor support, adapter configuration via
Chargebee(..., telemetry_adapter=...)andupdate_telemetry_adapter(), and per-requestresource/operationmetadata to name spans and capture headers/errors. Updated README, CHANGELOG, tests, and bumped version to 3.25.0.