fix(outputs.parquet): Sanitize measurement names before using as file name - #19552
Open
81reap wants to merge 4 commits into
Open
fix(outputs.parquet): Sanitize measurement names before using as file name#1955281reap wants to merge 4 commits into
81reap wants to merge 4 commits into
Conversation
81reap
marked this pull request as ready for review
August 26, 2026 04:54
Member
|
@81reap I wonder if we shouldn't simply reject the metric instead of trying to be clever. What do you think? |
2 tasks
… name Since measurement names are used as file names, an invalid file name like `../../../../tmp/evil` wrote its file to `/tmp` instead. A name that was too long or had a `NUL` byte made `os.Create` fail into a retry storm blocking telegraf from writing metrics until the bad metric aged out of the buffer. Now measurement names are sanitized if they are used as a file name. Renamed measurements are logged to console simmilar to how `outputs.bigquery` handles table names.
81reap
force-pushed
the
parquet-01-filename-safety
branch
from
August 26, 2026 18:43
1f45938 to
baccc53
Compare
Member
|
To be honest I would let the OS decide on what a valid filename is. This strongly depends on the OS and it's really hard to get it right through a black-list. What do you think? A test would be good anyway. Furthermore, you should use |
Contributor
|
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since measurement names are used as file names, an invalid file name like
../../../../tmp/evilwrote its file to/tmpinstead. A name that was too long or had aNULbyte madeos.Createfail into a retry storm blocking telegraf from writing metrics until the bad metric aged out of the buffer.Now measurement names are sanitized if they are used as a file name. Renamed measurements are logged to console simmilar to how
outputs.bigqueryhandles table names.Checklist
Related issues
resolves #19563