Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (22)
Summary by CodeRabbit
WalkthroughAdds OpenTelemetry-based telemetry to the segmentation example (new telemetry module and middleware, plus service configs), appends a query parameter to a sample HTTP request, and bumps many package versions/devDependency ranges. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant Gateway
participant Service
participant TelemetryMiddleware as Telemetry\nMiddleware
participant OTDriver as OpenTelemetry\nDriver
Client->>Gateway: HTTP GET /rpc/reporting/getData?aaa=x
Gateway->>Service: RPC call reporting/getData (headers, args)
Service->>TelemetryMiddleware: invoke middleware (route mapping)
TelemetryMiddleware->>OTDriver: record span / attributes (aaa, headers)
TelemetryMiddleware-->>Service: continue request
Service-->>Gateway: RPC response
Gateway-->>Client: HTTP response
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@examples/segmentation/src/telemetry/telemetry.ts`:
- Around line 7-9: The telemetry mapping for the key 'reporting/getData'
references an argument name 'aaa' that does not exist because the handler
function getData() (in reporting/getData.ts) declares no parameters; fix by
either removing the arguments array or making it an empty array for
'reporting/getData', or alternatively add the corresponding parameter name to
the getData function to match 'aaa'—update the mapping or the getData signature
so both sides use the same parameter names.
In `@examples/segmentation/src/telemetry/telemetryMiddleware.ts`:
- Around line 2-6: The example imports TelemetryMiddleware from
'@jitar-plugins/telemetry' (see telemetryMiddleware.ts) but that package is not
declared in the examples/segmentation package.json; add
"@jitar-plugins/telemetry" to the dependencies section of
examples/segmentation/package.json with an appropriate version (match workspace
version or a compatible semver) so the example can install and resolve
TelemetryMiddleware at runtime.
In `@package.json`:
- Around line 27-38: The package.json dependency ranges were changed but
package-lock.json wasn’t updated; run a fresh install to regenerate and pin
resolved versions: run npm install (or npm ci && npm install) in the repo root
to produce an updated package-lock.json that reflects the caret ranges in
package.json, verify the lockfile changes, and commit the new package-lock.json
so CI and local installs use deterministic, pinned versions.
🪄 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: ASSERTIVE
Plan: Pro
Run ID: 8b0c3191-dd7d-4313-af33-d961a24051e3
⛔ Files ignored due to path filters (3)
documentation/package-lock.jsonis excluded by!**/package-lock.jsonpackage-lock.jsonis excluded by!**/package-lock.jsonwebsite/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (8)
examples/segmentation/requests.httpexamples/segmentation/services/data.jsonexamples/segmentation/services/gateway.jsonexamples/segmentation/services/process.jsonexamples/segmentation/src/telemetry/telemetry.tsexamples/segmentation/src/telemetry/telemetryMiddleware.tspackage.jsonwebsite/package.json
| import { TelemetryMiddleware } from '@jitar-plugins/telemetry'; | ||
|
|
||
| import telemetry from './telemetry'; | ||
|
|
||
| export default new TelemetryMiddleware(telemetry); |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Locate segmentation/example package manifests and check telemetry deps
fd -i 'package.json' examples | xargs -r rg -n -C2 '"@jitar-plugins/telemetry"|"@theshelf/telemetry"|"@theshelf/telemetry-driver-otel"'Repository: MaskingTechnology/jitar
Length of output: 51
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Check if examples/segmentation directory exists and list its structure
echo "=== Checking examples/segmentation directory ==="
if [ -d "examples/segmentation" ]; then
ls -la examples/segmentation/
echo ""
# Check for package.json
if [ -f "examples/segmentation/package.json" ]; then
echo "=== Content of examples/segmentation/package.json ==="
cat -n examples/segmentation/package.json
else
echo "No package.json found in examples/segmentation/"
fi
else
echo "examples/segmentation directory does not exist"
fi
echo ""
echo "=== All package.json files in examples ==="
find examples -name "package.json" -type f 2>/dev/null | head -20Repository: MaskingTechnology/jitar
Length of output: 1961
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Check the actual imports in the file being reviewed
echo "=== Checking telemetryMiddleware.ts imports ==="
if [ -f "examples/segmentation/src/telemetry/telemetryMiddleware.ts" ]; then
cat -n examples/segmentation/src/telemetry/telemetryMiddleware.ts
else
echo "File not found at examples/segmentation/src/telemetry/telemetryMiddleware.ts"
# Search for it
echo ""
echo "=== Searching for telemetryMiddleware.ts ==="
find examples -name "telemetryMiddleware.ts" -type f 2>/dev/null
fiRepository: MaskingTechnology/jitar
Length of output: 311
Add missing @jitar-plugins/telemetry dependency to examples/segmentation/package.json.
The file imports @jitar-plugins/telemetry but this dependency is not declared in the example's package manifest. Since examples are not included in the workspace setup and npm hoisting does not apply to them, the package must be explicitly declared in examples/segmentation/package.json dependencies.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@examples/segmentation/src/telemetry/telemetryMiddleware.ts` around lines 2 -
6, The example imports TelemetryMiddleware from '@jitar-plugins/telemetry' (see
telemetryMiddleware.ts) but that package is not declared in the
examples/segmentation package.json; add "@jitar-plugins/telemetry" to the
dependencies section of examples/segmentation/package.json with an appropriate
version (match workspace version or a compatible semver) so the example can
install and resolve TelemetryMiddleware at runtime.
|



Fixes #763
Changes proposed in this pull request:
@MaskingTechnology/jitar