-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[exporter/debug] add ability to set output_paths #14164
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
d1b8a24
fbabe6d
374c202
1e9b18b
d8feeba
5a3232b
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,29 @@ | ||
| # Use this changelog template to create an entry for release notes. | ||
|
|
||
| # One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
| change_type: enhancement | ||
|
|
||
| # The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) | ||
| component: exporter/debug | ||
|
|
||
| # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
| note: Add `output_paths` configuration option to control output destination when `use_internal_logger` is false | ||
|
|
||
| # One or more tracking issues or pull requests related to the change | ||
| issues: [10472] | ||
|
|
||
| # (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: | | ||
| When `use_internal_logger` is set to `false`, the debug exporter now supports configuring the output destination via the `output_paths` option. | ||
| This allows users to send debug exporter output to `stdout`, `stderr`, or a file path. | ||
| The default value is `["stdout"]` to maintain backward compatibility. | ||
|
|
||
| # Optional: The change log or logs in which this entry should be included. | ||
| # e.g. '[user]' or '[user, api]' | ||
| # Include 'user' if the change is relevant to end users. | ||
| # Include 'api' if there is a change to a library API. | ||
| # Default: '[user]' | ||
| change_logs: [] | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -124,6 +124,16 @@ func createTestCases() []testCase { | |
| return cfg | ||
| }(), | ||
| }, | ||
| { | ||
|
Member
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. Please add a test case for when user sets What should happen then? Shouldn't such config be invalid?
Author
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. basically the same thing:
Member
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. Please add a test case for when user sets What should happen then? Shouldn't such config be invalid?
Author
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. good catch, ill validate it and throw an error if out_paths is null and set_intenral_logger is false |
||
| name: "custom output paths", | ||
| config: func() *Config { | ||
| cfg := createDefaultConfig().(*Config) | ||
| cfg.QueueConfig.QueueSize = 10 | ||
| cfg.UseInternalLogger = false | ||
| cfg.OutputPaths = []string{"stderr"} | ||
| return cfg | ||
| }(), | ||
| }, | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| use_internal_logger: false | ||
| output_paths: | ||
| - stderr | ||
|
|
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.
Let's not mention "URLs", it may be confusing to users. I propose to officially support only bare file paths, regardless of what is internally supported by Zap.
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.
ok, ill also add validation for the paths as well to validate that its not one of the following:
file:///path/to/file (contains ://)
http://example.com (contains ://)
file:path/to/file (matches scheme: pattern)