-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Serialize complex properties as JSON in Application Insights custom dimensions #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ions Co-authored-by: hangy <[email protected]>
Co-authored-by: hangy <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #76 +/- ##
==========================================
+ Coverage 60.80% 65.05% +4.24%
==========================================
Files 3 3
Lines 273 289 +16
Branches 49 52 +3
==========================================
+ Hits 166 188 +22
+ Misses 86 80 -6
Partials 21 21 ☔ View full report in Codecov by Sentry. |
Co-authored-by: hangy <[email protected]>
hangy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…r for JSON serialization Co-authored-by: hangy <[email protected]>
Fixed in commit d5eb2ba. The build error was caused by a merge conflict where the new |
|
@copilot There's now a merge conflict. Fix it by updating the lockfile |
Merge conflict resolved in commit ff040f5. Updated the lockfile by accepting dev branch changes and regenerating with |
# [1.2.0-beta.7](v1.2.0-beta.6...v1.2.0-beta.7) (2026-01-01) ### Bug Fixes * Property collision handling: ensure event properties take precedence over context properties ([#75](#75)) ([211f262](211f262)) ### Features * Serialize complex properties as JSON in Application Insights custom dimensions ([#76](#76)) ([4894621](4894621))
|
🎉 This PR is included in version 1.2.0-beta.7 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Plan: Support Complex Properties as Custom Dimensions ✅
The issue is that complex properties (objects, nested structures) are not being serialized properly in Application Insights custom dimensions. Currently,
StringDictionaryConverter.SafeValueConverter()only callsConvert.ToString()which results in type names instead of actual property values.Tasks:
SafeValueConvertermethodSafeValueConverterto serialize complex objects to JSONChanges Made:
StringDictionaryConverter.SafeValueConverter()to intelligently handle different value types:Convert.ToString()with InvariantCultureSystem.Text.Json.JsonSerializerTryAddPropertyToPropertyBagmethod to useStringDictionaryConverterinstead ofConvert.ToString()to ensure complex properties are serialized as JSONTraceHasComplexPropertiesSerializedAsJson: Validates complex objects with nested properties and arrays are properly serialized to JSONTraceHandlesVariousPropertyTypes: Tests edge cases including strings, primitives, arrays, dictionaries, and null valuesSecurity:
Impact:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.