Skip to content

chore: Tracing Sanitize SegmentName to avoid unsupported characters #741

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

Merged

Conversation

hjgraca
Copy link
Contributor

@hjgraca hjgraca commented Jan 31, 2025

Please provide the issue number

Issue number: #740

Summary

Changes

  1. Sanitize SegmentName
  2. Show accepted chars in the SegmentName

This pull request introduces several changes to the AWS Lambda Powertools Tracing library, primarily focusing on sanitizing segment names and updating related tests. The most important changes include the addition of a helper method for sanitizing strings, modifications to the XRayRecorder and TracingAttribute classes to use this sanitization, and the addition of new test cases to ensure the changes work correctly.

Sanitization of Segment Names:

Documentation and Attribute Updates:

Test Enhancements:

User experience

Please share what the user experience looks like before and after this change

Checklist

Please leave checklist items unchecked if they do not apply to your change.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@auto-assign auto-assign bot requested review from amirkaws and sliedig January 31, 2025 16:01
@boring-cyborg boring-cyborg bot added area/tracing Core tracing utility tests labels Jan 31, 2025
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 31, 2025
@hjgraca hjgraca self-assigned this Jan 31, 2025
@hjgraca hjgraca changed the title chore: Sanitize SegmentName. Show accepted chars in the SegmentName. Add tests chore: Tracing Sanitize SegmentName to avoid unsupported characters Jan 31, 2025
@github-actions github-actions bot added the internal Maintenance changes label Jan 31, 2025
Copy link

codecov bot commented Jan 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.34%. Comparing base (5f17cc2) to head (2ac7b48).
Report is 23 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #741      +/-   ##
===========================================
+ Coverage    73.32%   73.34%   +0.01%     
===========================================
  Files          200      201       +1     
  Lines         8112     8118       +6     
  Branches       871      871              
===========================================
+ Hits          5948     5954       +6     
  Misses        1875     1875              
  Partials       289      289              
Flag Coverage Δ
unittests 73.34% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement! If testes are green - I saw the new test - it's good to merge.

@hjgraca
Copy link
Contributor Author

hjgraca commented Feb 2, 2025

CC @nCubed

@hjgraca hjgraca merged commit 4e154a9 into aws-powertools:develop Feb 3, 2025
9 checks passed
@hjgraca hjgraca deleted the fix(tracing)-invalid-sement-name branch February 3, 2025 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tracing Core tracing utility internal Maintenance changes size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants