-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add option to disable redundant 132B in log lines #14050
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
Conversation
Signed-off-by: Yaten <[email protected]>
Signed-off-by: Yaten <[email protected]>
|
There're some failing tests, working on the fix. By the time, I've converted this to draft 👍 |
|
@jade-guiton-dd , wanted to ask here, that currently, {
name: "auto-populated fields only",
buildInfo: component.BuildInfo{
Command: "mycommand",
Version: "1.0.0",
},
resourceConfig: map[string]*string{},
wantFields: map[string]string{
string(semconv.ServiceNameKey): "mycommand",
string(semconv.ServiceVersionKey): "1.0.0",
string(semconv.ServiceInstanceIDKey): "",
},
cfg: &Config{
Logs: LogsConfig{
Level: zapcore.InfoLevel,
Encoding: "json",
ResourceAsZapFields: true,
},
Resource: map[string]*string{},
},
},Then, it'll work fine, but, it's not working if I don't add this field - |
|
The default configuration for the telemetry factory is in |
Signed-off-by: Yaten <[email protected]>
|
@jade-guiton-dd , I've added the required field in the In short, the as far as I've observed here is that, this - |
|
I didn't fully understand your comment, but let me try to explain. The way defaults are normally handled in the Collector is as follows: 1. the In tests however, we need to perform this logic manually. If you pass in a config struct to a component, and a field is not specified, that field will default to its zero value, as is normal in Go; the value of that field in This means that the existing test cases in As for |
Signed-off-by: Yaten <[email protected]>
|
Got this, thanks for explaining @jade-guiton-dd :) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #14050 +/- ##
==========================================
- Coverage 92.16% 92.13% -0.03%
==========================================
Files 668 668
Lines 41516 41517 +1
==========================================
- Hits 38263 38252 -11
- Misses 2217 2225 +8
- Partials 1036 1040 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Yaten <[email protected]>
…ourceAttributes Signed-off-by: Yaten <[email protected]>
|
Yes, I think that's the best option. |
Signed-off-by: Yaten <[email protected]>
Signed-off-by: Yaten <[email protected]>
jade-guiton-dd
left a comment
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.
Looks pretty good to me. Before I approve though: @bogdandrutu, can you confirm whether this is what you had in mind in #13869?
|
I'll address the suggested changes by the end of week👍 Got busy with some work. |
CodSpeed Performance ReportMerging #14050 will degrade performances by 77.03%Comparing
|
| Benchmark | BASE |
HEAD |
Change | |
|---|---|---|---|---|
| ❌ | zstdNoConcurrency |
36.3 µs | 74.8 µs | -51.51% |
| ❌ | zstdWithConcurrency |
6.9 µs | 30 µs | -77.03% |
Signed-off-by: Yaten <[email protected]>
jade-guiton-dd
left a comment
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.
Looks good. Suggested a few documentation changes to make it extra clear what this applies to.
Co-authored-by: Jade Guiton <[email protected]>
Co-authored-by: Jade Guiton <[email protected]>
|
@jade-guiton-dd , there're some tests failing after I pulled some changes in this PR, can we still merge this? |
|
No worries, these failures are unrelated to your PR and have since been fixed. I've re-run the tests. |
52007de
Description
This PR adds an option to disable the resource attribute in logs.
Link to tracking issue
Fixes #13869
Testing
Added unit tests in -
TestCreateLogger().