Skip to content

Removing Entity Name invalid characters #8

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

Closed
wants to merge 1 commit into from
Closed

Removing Entity Name invalid characters #8

wants to merge 1 commit into from

Conversation

levesquejf
Copy link
Contributor

If you create subsegments with invalid Name characters, this causes issues in the X-Ray traces. This Pull Request remove the invalid characters and adds a warning in the log. The valid character list has been found on http://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html.

Copy link
Contributor

@haotianw465 haotianw465 left a comment

Choose a reason for hiding this comment

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

The changes are simple two lines but we still require new PR to have unit tests covered. Also could you merge your two commits into one? Once it's approved we can merge this one commit to master. It's easier to track change and doing release.

@@ -12,21 +13,26 @@


log = logging.getLogger(__name__)
_valid_name_characters = string.ascii_letters + string.digits + '_.:/%&#=+\-@'
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be useful to add the doc link here as a comment for future reference.

self.start_time = time.time()
self.parent_id = None

if self.name != name:
log.warning("Removing Name invalid characters.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Use segment/subsegment name instead of name could be clearer when user see such log entries.

@levesquejf levesquejf closed this Dec 4, 2017
@levesquejf levesquejf reopened this Dec 4, 2017
@levesquejf levesquejf closed this Dec 4, 2017
@levesquejf levesquejf deleted the entity-name-validation branch December 4, 2017 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants