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

Remove duplicate logging #785

Merged
merged 2 commits into from
Jun 27, 2023
Merged

Remove duplicate logging #785

merged 2 commits into from
Jun 27, 2023

Conversation

matafc
Copy link
Contributor

@matafc matafc commented Jun 21, 2023

We have noticed duplicate logging to datadog for containers in ECS. Container logs are currently sent 2 ways.

  1. The container instance datadog agent directly ingests the logs from docker on the ECS instance.
  2. The ECS tasks are configured to send the logs to syslog on the instance. Rsyslog then sends the logs to datadog.

Non-rsylog logs
Rsyslog logs

Historically, it seems we sent to rsyslog so that datadog and logentries would both be able to process the logs. We are no longer using logentries, and the datadog direct ingested logs have a lot more metadata than the rsyslog forwarded one.

In this PR we:

  • Configure the docker containers to log with the json-file driver, and limit the size of each log file to 1MB.
  • We did not want to use the aws-logs driver, as we will be charged to store them in Cloudwatch, and we don't plan to use them there.
  • We could not configure it with the none driver, as that stopped all logging, even from the datadog agent ingesting directly.
  • Disable the functionality of the logentries plugin

Datadog configuration rollout

After this PR is merged, we do not need to update the datadog plugins districts to update the log functionality. The tasks will use the new configuration when they are deployed, as we are only changing how the plugins alter the task definition.

Logentries removal rollout

Logentries is already deactivated, but we still have the plugin installed on applications. This PR will remove the logentries configuration when an app is deployed. But we will still want to remove the plugin from all the districts using bcn plugin delete. Once it is removed from all districts, we can make a new PR to remove the code completely.

Note:

Due to the rsyslog parsing, using the service: tag facet was different for each container. But the datadog direct ingest maps service to the short image name, which containers share. For queries that need to filter on the specific container, we recommend using the container_name facet now. Here is an example of what to use in the future.

@matafc matafc marked this pull request as ready for review June 22, 2023 03:11
Copy link
Contributor

@essa essa left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Great investigation!
Thank you

@matafc matafc merged commit 8260568 into master Jun 27, 2023
6 checks passed
@matafc matafc deleted the remove-dupe-logs branch June 27, 2023 01:59
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