-
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
base: main
Are you sure you want to change the base?
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.27% 92.26% -0.01%
==========================================
Files 657 657
Lines 41111 41112 +1
==========================================
- Hits 37936 37934 -2
- Misses 2173 2175 +2
- Partials 1002 1003 +1 ☔ 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]>
…er testing Signed-off-by: Yaten <[email protected]>
|
I think there're some tests failing because of my latest commit, checking those 👀 |
|
The contrib-tests are failing for everyone, it's not related to your PR |
|
Ok, got this 👍 |
|
Yes, I think that's the best option. |
Signed-off-by: Yaten <[email protected]>
Signed-off-by: Yaten <[email protected]>
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().