Skip to content
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

confighttp ErrorLog update #12172

Merged
merged 8 commits into from
Jan 23, 2025
Merged

confighttp ErrorLog update #12172

merged 8 commits into from
Jan 23, 2025

Conversation

sonalgaud12
Copy link
Contributor

Description

Added Zap as the default error logger in confighttp.ToServer() to ensure consistency in logging and to prevent errors from being printed using a different logger. This change configures the ErrorLog field of the http.Server to use a logger backed by Zap, which is initialized with the provided logger in TelemetrySettings. If the logger creation fails, the function now returns nil, err to prevent any undefined behavior from occurring due to an incomplete setup of the logger.

Link to tracking issue

Fixes #11820

Documentation

Updated the changelog with information regarding the new default error logger for confighttp. Added details to internal documentation to reflect the change and ensure proper usage of the new logging system in server configuration.

@sonalgaud12 sonalgaud12 requested a review from a team as a code owner January 23, 2025 10:48
@sonalgaud12 sonalgaud12 requested a review from mx-psi January 23, 2025 10:48
@sonalgaud12 sonalgaud12 requested a review from mx-psi January 23, 2025 11:16
@mx-psi
Copy link
Member

mx-psi commented Jan 23, 2025

Can you address the linting errors?

Copy link

codecov bot commented Jan 23, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 91.76%. Comparing base (50de4a2) to head (d480a31).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
config/confighttp/confighttp.go 50.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12172      +/-   ##
==========================================
- Coverage   91.77%   91.76%   -0.02%     
==========================================
  Files         463      463              
  Lines       24804    24809       +5     
==========================================
+ Hits        22764    22766       +2     
- Misses       1657     1659       +2     
- Partials      383      384       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sonalgaud12 sonalgaud12 requested a review from mx-psi January 23, 2025 11:33
@sonalgaud12
Copy link
Contributor Author

@mx-psi Done

@mx-psi mx-psi enabled auto-merge January 23, 2025 11:56
@mx-psi mx-psi added this pull request to the merge queue Jan 23, 2025
@sonalgaud12 sonalgaud12 changed the title Add changelog for confighttp ErrorLog update confighttp ErrorLog update Jan 23, 2025
Merged via the queue into open-telemetry:main with commit a51f292 Jan 23, 2025
2 checks passed
@sonalgaud12 sonalgaud12 deleted the Fix branch January 23, 2025 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

confighttp.ToServer should be setting ErrorLog
2 participants