Commit 5c9168d
feat(logging): improve calculate_records instrumentation and example guidance
Enhanced debug logging in calculate_records() to meet coding standards and
improved example documentation to guide users toward proper setup.
Logging Improvements (calculate_records):
- Added calc_count to #[instrument] fields for span context
- Added structured logging for calc_expression_count and rollback_on_failure
- Added debug logs when using optional parameters (session_id, gdb_version)
- Added response_length debug log after receiving response
- Added detailed error logging with response preview on deserialization failure
- Added edit_moment to completion info log
Standards Met:
✅ #[instrument] with appropriate skip and fields
✅ Structured context fields (layer_id, calc_count)
✅ Debug events at key points (request, response, optional params)
✅ Error logging before returning (with response preview for debugging)
✅ Info logging on completion with all result fields
Example Improvements:
- Changed FEATURE_SERVICE_URL from optional to required
- Added comprehensive setup instructions for creating own feature service
- Explained why public sample servers don't work (reject API key editing)
- Added troubleshooting section for common errors (498, 400)
- Added warning about data modification before execution
- Improved error message formatting with clear action steps
User Experience:
- Running without FEATURE_SERVICE_URL now shows helpful setup guide
- Debug mode (RUST_LOG=debug) provides detailed request/response tracing
- Clear explanation of authentication requirements
- Step-by-step ArcGIS Online setup instructions
Files Modified:
- src/services/feature/client/edit.rs - Enhanced calculate_records logging
- examples/enterprise/feature_service_field_calculations.rs - Improved docs and validation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 32f9565 commit 5c9168d
2 files changed
Lines changed: 71 additions & 13 deletions
Lines changed: 46 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
27 | 38 | | |
28 | 39 | | |
29 | 40 | | |
30 | | - | |
| 41 | + | |
31 | 42 | | |
32 | 43 | | |
33 | 44 | | |
34 | | - | |
| 45 | + | |
| 46 | + | |
35 | 47 | | |
36 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
37 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
38 | 61 | | |
39 | 62 | | |
40 | 63 | | |
| |||
68 | 91 | | |
69 | 92 | | |
70 | 93 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
77 | 109 | | |
78 | 110 | | |
79 | 111 | | |
| |||
85 | 117 | | |
86 | 118 | | |
87 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
88 | 124 | | |
89 | 125 | | |
90 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
536 | | - | |
| 536 | + | |
537 | 537 | | |
538 | 538 | | |
539 | 539 | | |
| |||
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
551 | | - | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
552 | 558 | | |
553 | 559 | | |
554 | 560 | | |
| |||
559 | 565 | | |
560 | 566 | | |
561 | 567 | | |
| 568 | + | |
562 | 569 | | |
563 | 570 | | |
564 | 571 | | |
| 572 | + | |
565 | 573 | | |
566 | 574 | | |
567 | 575 | | |
| |||
592 | 600 | | |
593 | 601 | | |
594 | 602 | | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
595 | 608 | | |
596 | | - | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
597 | 618 | | |
598 | 619 | | |
599 | 620 | | |
600 | 621 | | |
| 622 | + | |
601 | 623 | | |
602 | 624 | | |
603 | 625 | | |
| |||
0 commit comments