-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[extension/filestorage] replace path-unsafe characters in component names #20896
Changes from 4 commits
b916f7a
de5b2f2
6ce113a
de03082
ddc68cb
b4f921d
fe3edc2
5c1b93b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: breaking | ||
|
||
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) | ||
component: extension/filestorage | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: Replace path-unsafe characters in component names | ||
|
||
# One or more tracking issues related to the change | ||
issues: [3148] | ||
|
||
# (Optional) One or more lines of additional information to render under the primary note. | ||
# These lines will be padded with 2 spaces and then inserted directly into the document. | ||
# Use pipe (|) for multiline entries. | ||
subtext: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,3 +93,32 @@ processors: | |
exporters: | ||
nop: | ||
``` | ||
|
||
## Feature Gates | ||
|
||
See the [Collector feature gates](https://github.com/open-telemetry/opentelemetry-collector/blob/main/featuregate/README.md#collector-feature-gates) for an overview of feature gates in the collector. | ||
|
||
### `extension.filestorage.replaceUnsafeCharacters` | ||
|
||
When enabled, characters that are not safe in file paths are replaced in component name using the extension before creating the file name to store data by the extension. | ||
|
||
This may change the file path that the extension is writing component's data to. | ||
For example, for component `filelog/logs/json`, the data is stored: | ||
|
||
- in path `receiver_filelog_logs/json` with the feature flag disabled (note that this is file named `json` inside directory named `receiver_filelog_logs`). | ||
- in file `receiver_filelog_logs~json` with the feature flag enabled. | ||
|
||
The feature replaces all characters other than `A-Z`, `a-z`, `0-9`, dot `.`, hyphen `-`, underscore `_`, with a tilde `~`. | ||
This replacement is done to prevent surprising behavior or errors in the file storage extension. | ||
|
||
For more details, see the following issues: | ||
|
||
- [File storage extension - invalid file name characters must be encoded #3148](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/3148) | ||
- [[filestorage] receiver name sanitization #20731](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/20731) | ||
|
||
The schedule for this feature gate is: | ||
|
||
- Introduced in v0.81.0 (July 2023) as `alpha` - disabled by default. | ||
- Moved to `beta` in October 2023 - enabled by default. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I described the schedule for the feature gate in terms of dates, not release numbers, as this is pretty far in the future and I believe it's easier for everyone to focus on time frames as opposed to arbitrary release numbers. The schedule I selected is slow: three months before moving the gate to Let me know what you think! |
||
- Moved to `stable` in January 2024 - cannot be disabled. | ||
- Removed three releases after `stable`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be better to encode unsafe characters in terms of safe characters instead of replacing? Replacing creates the possibility of name clashes, e.g. components
filelog/logs/json
andfilelog/logs~json
both convert toreceiver_filelog_logs~json
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true, the issue of clashes crossed my mind. Especially with the replacement being quite "eager", replacing many different characters. I'll change the implementation to encode unsafe characters instead of replacing with
~
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@astencel-sumo may I ask if you get any chance to work on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@newly12 the vacation period is over and I'm going to get back to it.