opentelemetry-collector icon indicating copy to clipboard operation
opentelemetry-collector copied to clipboard

[telemetry] Add log rotation support (#7352)

Open h0cheung opened this issue 1 year ago • 30 comments

Description: Add log rotation support. The logs of otelcol itself will be rotated by lumberjack.

Link to tracking Issue: #7352

Testing: Creating logger with or without rotation, logging with rotation and logging with an old big file are added in unit tests.

I did some simple testing on Linux, macOS, and Windows.

h0cheung avatar Mar 24 '23 11:03 h0cheung

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: h0cheung / name: Howard Cheung (649fe5ec4f00625efd792cdf31439104f5f7c05f)

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar Apr 08 '23 03:04 github-actions[bot]

This PR was marked stale due to lack of activity. It will be closed in 14 days.

remove stale

h0cheung avatar Apr 08 '23 14:04 h0cheung

Codecov Report

Attention: Patch coverage is 87.32394% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 91.63%. Comparing base (671dcbc) to head (649fe5e).

Files Patch % Lines
service/telemetry/telemetry.go 80.00% 6 Missing and 3 partials :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7425      +/-   ##
==========================================
- Coverage   91.65%   91.63%   -0.02%     
==========================================
  Files         356      357       +1     
  Lines       16843    16914      +71     
==========================================
+ Hits        15437    15499      +62     
- Misses       1063     1069       +6     
- Partials      343      346       +3     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Apr 13 '23 14:04 codecov[bot]

I made some updates to pass windows-unittest

h0cheung avatar Apr 17 '23 07:04 h0cheung

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar May 09 '23 03:05 github-actions[bot]

This PR was marked stale due to lack of activity. It will be closed in 14 days.

remove stale

h0cheung avatar May 22 '23 14:05 h0cheung

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar Jun 06 '23 03:06 github-actions[bot]

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar Aug 04 '23 03:08 github-actions[bot]

This PR was marked stale due to lack of activity. It will be closed in 14 days.

remove stale

h0cheung avatar Aug 08 '23 13:08 h0cheung

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar Aug 24 '23 03:08 github-actions[bot]

This PR was marked stale due to lack of activity. It will be closed in 14 days.

remove stale

h0cheung avatar Sep 01 '23 08:09 h0cheung

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar Sep 16 '23 03:09 github-actions[bot]

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar Oct 14 '23 03:10 github-actions[bot]

remove stale

h0cheung avatar Oct 27 '23 04:10 h0cheung

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar Nov 11 '23 03:11 github-actions[bot]

Closed as inactive. Feel free to reopen if this PR is still being worked on.

github-actions[bot] avatar Nov 26 '23 03:11 github-actions[bot]

Did the log rotation ever make it into the code?

kago-dk avatar Apr 10 '24 22:04 kago-dk

Did the log rotation ever make it into the code?

It did not, but it should in some form. Looks like #7425 still tracks it. cc: @BinaryFissionGames.

djaglowski avatar Apr 15 '24 18:04 djaglowski

Hi @djaglowski I think log rotation is a necessary feature. Is there a plan to merge this PR? Or does this PR need to be perfected?

li-zeyuan avatar Apr 22 '24 02:04 li-zeyuan

I agree @li-zeyuan.

@open-telemetry/collector-maintainers, any concerns in principle with adding log rotation?

From what I can tell this timed out after feedback was implemented, but not re-reivewed. @h0cheung are you willing to reopen this? @atoulme will you revisit your comments to confirm if they were addressed?

djaglowski avatar Apr 22 '24 15:04 djaglowski

I agree @li-zeyuan.

@open-telemetry/collector-maintainers, any concerns in principle with adding log rotation?

From what I can tell this timed out after feedback was implemented, but not re-reivewed. @h0cheung are you willing to reopen this? @atoulme will you revisit your comments to confirm if they were addressed?

Yes. I'd like to continue the work if we can reopen this.

h0cheung avatar Apr 23 '24 09:04 h0cheung

I agree @li-zeyuan. @open-telemetry/collector-maintainers, any concerns in principle with adding log rotation? From what I can tell this timed out after feedback was implemented, but not re-reivewed. @h0cheung are you willing to reopen this? @atoulme will you revisit your comments to confirm if they were addressed?

Yes. I'd like to continue the work if we can reopen this.

@h0cheung Hi brother, can you add repository permission to me? Coding together.

li-zeyuan avatar Apr 25 '24 03:04 li-zeyuan

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar May 11 '24 03:05 github-actions[bot]

I agree @li-zeyuan. @open-telemetry/collector-maintainers, any concerns in principle with adding log rotation? From what I can tell this timed out after feedback was implemented, but not re-reivewed. @h0cheung are you willing to reopen this? @atoulme will you revisit your comments to confirm if they were addressed?

Yes. I'd like to continue the work if we can reopen this.

@h0cheung Hi brother, can you add repository permission to me? Coding together.

Yes

h0cheung avatar May 14 '24 11:05 h0cheung