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

Adds log constraints to docker containers not instantiated by the go client #1956

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

anixon604
Copy link
Contributor

Why this change is needed

Containers for gateway are instantiated manually via docker run which isn't applying the max-file and max-log logging options to the containers.

What changes were made as part of this PR

Added the logging options to the execution statements in the workflows.

PR checks pre-merging

Please indicate below by ticking the checkbox that you have read and performed the required
PR checks

  • PR checks reviewed and performed

@@ -130,10 +130,12 @@ jobs:
-v /proc/:/host/proc/:ro \
-v /opt/datadog-agent/run:/opt/datadog-agent/run:rw \
-v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
--log-opt max-file=3 --log-opt max-size=10m \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens when we reach the limit? do we truncate the file?

why is it set to only 10 MB?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's just a rotating log file - will delete the oldest - so the total logs available will be the last 3*10MB (30mb). It's just what seemed useful originally as a set-point based on how we were using. we can definitely swap the params to different values though... @zkokelj

Copy link
Contributor

@zkokelj zkokelj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added minor comments.
Other than that looks good to me

@@ -102,6 +102,7 @@ jobs:
-v /proc/:/host/proc/:ro \
-v /opt/datadog-agent/run:/opt/datadog-agent/run:rw \
-v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
--log-opt max-file=3 --log-opt max-size=10m \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's not needed here. We have local logs only for gateway and not for gateway databse.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but i think it's still okay to leave here. The reason is that the agent itself is emitting logs - although at a much lower rate. But if it was up a super long time, then it could potentially fill up the container fs...

2024-06-10 18:12:27 UTC | TRACE | INFO | (pkg/trace/info/stats.go:91 in LogAndResetStats) | No data received
2024-06-10 18:12:52 UTC | CORE | INFO | (pkg/serializer/serializer.go:454 in SendProcessesMetadata) | Sent processes metadata payload, size: 1415 bytes.
2024-06-10 18:13:27 UTC | TRACE | INFO | (pkg/trace/info/stats.go:91 in LogAndResetStats) | No data received
2024-06-10 18:14:22 UTC | PROCESS | INFO | (pkg/process/runner/runner.go:247 in logCheckDuration) | Finish container check #640 in 3.485494ms
2024-06-10 18:14:27 UTC | TRACE | INFO | (pkg/trace/info/stats.go:91 in LogAndResetStats) | No data received
2024-06-10 18:15:32 UTC | TRACE | INFO | (pkg/trace/info/stats.go:91 in LogAndResetStats) | No data received
2024-06-10 18:16:32 UTC | TRACE | INFO | (pkg/trace/info/stats.go:91 in LogAndResetStats) | No data received
2024-06-10 18:17:37 UTC | TRACE | INFO | (pkg/trace/info/stats.go:91 in LogAndResetStats) | No data received
2024-06-10 18:17:42 UTC | PROCESS | INFO | (pkg/process/runner/runner.go:247 in logCheckDuration) | Finish container check #660 in 3.250694ms
2024-06-10 18:17:52 UTC | CORE | INFO | (pkg/serializer/serializer.go:454 in SendProcessesMetadata) | Sent processes metadata payload, size: 1422 bytes.
2024-06-10 18:18:42 UTC | TRACE | INFO | (pkg/trace/info/stats.go:91 in LogAndResetStats) | No data received
2024-06-10 18:18:50 UTC | CORE | INFO | (pkg/serializer/serializer.go:429 in sendMetadata) | Sent metadata payload, size (raw/compressed): 1080/432 bytes.
2024-06-10 18:18:51 UTC | CORE | INFO | (pkg/serializer/serializer.go:429 in sendMetadata) | Sent metadata payload, size (raw/compressed): 34320/8352 bytes.
2024-06-10 18:18:51 UTC | CORE | INFO | (pkg/serializer/serializer.go:429 in sendMetadata) | Sent metadata payload, size (raw/compressed): 1978/492 bytes.
2024-06-10 18:18:52 UTC | CORE | INFO | (pkg/util/cloudproviders/cloudproviders.go:52 in DetectCloudProvider) | Cloud provider Azure detected
2024-06-10 18:18:52 UTC | CORE | INFO | (pkg/util/cloudproviders/cloudproviders.go:60 in DetectCloudProvider) | Detecting cloud provider account ID from Azure: "6e522d3f-f104-4fdf-bf88-76d2fe400cca"
2024-06-10 18:18:52 UTC | CORE | INFO | (pkg/serializer/serializer.go:429 in sendMetadata) | Sent metadata payload, size (raw/compressed): 1103/635 bytes.
2024-06-10 18:19:47 UTC | TRACE | INFO | (pkg/trace/info/stats.go:91 in LogAndResetStats) | No data received
2024-06-10 18:20:47 UTC | TRACE | INFO | (pkg/trace/info/stats.go:91 in LogAndResetStats) | No data received
2024-06-10 18:21:02 UTC | PROCESS | INFO | (pkg/process/runner/runner.go:247 in logCheckDuration) | Finish container check #680 in 3.526283ms
2024-06-10 18:21:52 UTC | TRACE | INFO | (pkg/trace/info/stats.go:91 in LogAndResetStats) | No data received

@anixon604
Copy link
Contributor Author

I think the tests were failing but it's unrelated.

@anixon604 anixon604 requested a review from zkokelj June 11, 2024 10:44
@anixon604 anixon604 merged commit c6e5a48 into main Jun 11, 2024
2 of 3 checks passed
@anixon604 anixon604 deleted the anthony/log-opts-to-gateways branch June 11, 2024 13:43
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.

2 participants