Skip to content
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

Remove invalid characters in log stream and log group names. #104

Merged
merged 12 commits into from
Oct 13, 2020
Merged

Remove invalid characters in log stream and log group names. #104

merged 12 commits into from
Oct 13, 2020

Conversation

davidnewhall
Copy link
Contributor

@davidnewhall davidnewhall commented Oct 3, 2020

Issue #, if available: #103

Description of changes:

  • Adds sanitize functions for both of logs stream names and log group names.
  • Truncates group or stream names over the maximum of 512 characters.
  • Adds test for both of these ^^^
  • Moves the fasttemplate.Template creation and error into the startup routine instead of the log line routine.
    • This allows invalid templates defined in the config file to throw errors sooner.
    • Speeds up the log processing pipeline a tiny bit.
  • The existing template parsing procedures were modified to take different inputs:
    • The new sanitize functions as a direct interface.
    • The template input string was modified to become a fasttemplate.Template input.
  • Adds t.Parallel() to two existing tests to speed them up.

To go along with this, I'm working on another PR for #99.

EDIT: I think I've worked my way through all my concerns and made this as fast as possible. It's now ready for review. Recommend a merge squash when we get there.

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

@davidnewhall davidnewhall requested a review from a team as a code owner October 3, 2020 11:10
Copy link
Contributor

@PettitWesley PettitWesley left a comment

Choose a reason for hiding this comment

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

@davidnewhall Thanks!

@PettitWesley
Copy link
Contributor

@davidnewhall Thanks!

@PettitWesley PettitWesley merged commit e9d76ee into aws:mainline Oct 13, 2020
@davidnewhall davidnewhall deleted the dn2_sanitize branch November 10, 2020 01:23
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