telemetry header handler - #129
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. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughThe PR adds opt-in response-header telemetry. It requests ChangesResponse Header Telemetry
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant RequestWrapper
participant ChargebeeAPI
participant TelemetryAdapter
participant RequestEndSpan
RequestWrapper->>ChargebeeAPI: send Prefer: chargebee-telemetry=include
ChargebeeAPI-->>RequestWrapper: return X-Chargebee-Telemetry
RequestWrapper->>TelemetryAdapter: pass response headers
TelemetryAdapter->>TelemetryAdapter: parse response telemetry
TelemetryAdapter->>RequestEndSpan: merge response attributes
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@src/telemetry/chargebeeTelemetryHeaderParser.ts`:
- Around line 188-234: Update splitOnDelimiter, indexOfParameterSeparator, and
indexOfEquals to recognize backslash-escaped quotes while scanning quoted
values, so escaped quotes do not change inQuotes state and subsequent delimiters
are detected correctly. Add an end-to-end parser test covering an escaped quote
followed by another list item.
🪄 Autofix
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: cdcc1b43-61e8-4d18-a788-4bf6d00f934d
📒 Files selected for processing (7)
src/RequestWrapper.tssrc/telemetry/TelemetryAdapter.tssrc/telemetry/chargebeeTelemetryHeaderParser.tssrc/telemetry/index.tssrc/telemetry/types.tstest/chargebeeTelemetryHeaderParser.test.tstest/telemetryAdapter.test.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@types/index.d.ts`:
- Around line 188-193: Declare the public constants
CHARGEBEE_TELEMETRY_PREFER_HEADER and CHARGEBEE_TELEMETRY_PREFER_VALUE in
types/index.d.ts with their matching literal string types, and add a type-level
import test confirming both are publicly importable from the package entry
point.
🪄 Autofix
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: a5d8b3e0-246f-4a30-84ea-e29f000e43db
📒 Files selected for processing (13)
README.mdsrc/RequestWrapper.tssrc/chargebee.cjs.tssrc/chargebee.esm.tssrc/telemetry/TelemetryAdapter.tssrc/telemetry/chargebeeTelemetryHeaderParser.tssrc/telemetry/index.tssrc/telemetry/types.tssrc/types.d.tstest/chargebeeTelemetryHeaderParser.test.tstest/requestWrapper.test.tstest/telemetryAdapter.test.tstypes/index.d.ts
🚧 Files skipped from review as they are similar to previous changes (5)
- src/RequestWrapper.ts
- src/telemetry/index.ts
- src/telemetry/chargebeeTelemetryHeaderParser.ts
- test/chargebeeTelemetryHeaderParser.test.ts
- src/telemetry/types.ts
TBA
Adds opt-in Chargebee telemetry header support. The adapter adds
Prefer: chargebee-telemetry=include, parsesX-Chargebee-Telemetryfrom successful and failed responses, and records typed request-end attributes. Adds configuration, types, exports, documentation, and tests.