Skip to content

Fix: logs pipelines: ensure special characters in pipeline identifiers don't result in bad collector config names #6259

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

raj-k-singh
Copy link
Contributor

@raj-k-singh raj-k-singh commented Oct 24, 2024

Summary

ensures special characters in pipeline identifiers don't result in bad collector config names

Fixes #6253


Important

Normalize pipeline identifiers to ensure valid collector config names despite special characters.

  • Behavior:
    • Normalize pipeline identifiers in CollectorConfProcessorName in pipelineBuilder.go by replacing non-alphanumeric characters with -.
    • Ensures collector config names are valid even with special characters in pipeline identifiers.
  • Testing:
    • Add TestPipeCharInAliasDoesntBreakCollectorConfig in collector_config_test.go to verify special characters in pipeline aliases do not break collector config generation.

This description was created by Ellipsis for 05df623. It will automatically update as commits are pushed.

@raj-k-singh raj-k-singh marked this pull request as draft October 24, 2024 09:49
@github-actions github-actions bot added the bug Something isn't working label Oct 24, 2024
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 6f78c27 in 11 seconds

More details
  • Looked at 98 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. pkg/query-service/app/logparsingpipeline/pipelineBuilder.go:23
  • Draft comment:
    The regex pattern used here effectively replaces all non-alphanumeric characters and hyphens with a hyphen, ensuring valid collector config names. This addresses the issue of invalid characters in pipeline aliases.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The PR introduces a regex to replace invalid characters in pipeline aliases with a hyphen. This ensures that the generated collector config names are valid. The test added verifies this behavior by checking that a pipeline alias with a pipe character does not break the collector config. The implementation seems correct and addresses the issue described in the PR.
2. pkg/query-service/app/logparsingpipeline/pipelineBuilder.go:23
  • Draft comment:
    The regex [^a-zA-Z0-9-] ensures that only valid characters are used in collector config names, resolving the issue with special characters in pipeline aliases.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The code uses a regex to replace invalid characters in pipeline aliases, which resolves the issue of invalid characters in collector config names.

Workflow ID: wflow_2uTYWW44HbayWfR3


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Base automatically changed from chore/upgrade-signoz-otel-collector-dependency-to-v0.111.2 to develop October 28, 2024 05:15
@raj-k-singh raj-k-singh force-pushed the fix/logs-pipelines-pipe-char-in-alias-breaks-config branch from 6f78c27 to 05df623 Compare October 28, 2024 05:17
@raj-k-singh raj-k-singh marked this pull request as ready for review October 28, 2024 05:18
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 05df623 in 9 seconds

More details
  • Looked at 98 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. pkg/query-service/app/logparsingpipeline/pipelineBuilder.go:23
  • Draft comment:
    The regex pattern used in badCharsForCollectorConfName correctly replaces non-alphanumeric characters with -, ensuring valid collector config names.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The regex pattern used in badCharsForCollectorConfName is correct for replacing non-alphanumeric characters with -. This ensures that the pipeline identifiers are normalized as intended.
2. pkg/query-service/app/logparsingpipeline/pipelineBuilder.go:25
  • Draft comment:
    The function CollectorConfProcessorName correctly normalizes the alias by replacing non-alphanumeric characters with -. This resolves the issue of invalid collector config names due to special characters.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The function CollectorConfProcessorName correctly normalizes the alias by replacing non-alphanumeric characters with -. This resolves the issue of invalid collector config names due to special characters.

Workflow ID: wflow_qDD8nJtMnBPkK3KK


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@raj-k-singh raj-k-singh merged commit 94e0423 into develop Oct 28, 2024
14 checks passed
@raj-k-singh raj-k-singh deleted the fix/logs-pipelines-pipe-char-in-alias-breaks-config branch October 28, 2024 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants