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

Adopt log shipping via DevX logs #789

Merged
merged 4 commits into from
Nov 13, 2023
Merged

Adopt log shipping via DevX logs #789

merged 4 commits into from
Nov 13, 2023

Conversation

akash1810
Copy link
Member

@akash1810 akash1810 commented Nov 9, 2023

What does this change?

Adopts https://github.com/guardian/devx-logs to ship application logs to Central ELK. This change allows us to remove an application dependency (https://github.com/guardian/kinesis-logback-appender), ultimately reducing the volume of code in the repository.

How to test

DevX Logs adds a ShippedBy marker to each log line. Therefore, to demonstrate this is working, we can deploy and view the logs1:

image

How can we measure success?

Fewer things to maintain in this repository.

Footnotes

  1. The screenshot is limited to "healthcheck" logs, as other application logs contain account IDs.

@akash1810 akash1810 marked this pull request as ready for review November 9, 2023 08:52
Comment on lines +18 to +20
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder" />
</appender>
Copy link
Member Author

Choose a reason for hiding this comment

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

Logs written to stdout are collected by the journal daemon, which in turn is forwarded to Central ELK by devx-logs.

case Some(stream) =>
val maybeInstanceId = Try(EC2MetadataUtils.getInstanceId).toOption
val loggingContext = Map(
"buildId" -> prism.BuildInfo.buildNumber
Copy link
Member Author

Choose a reason for hiding this comment

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

This change drops this log marker.

@akash1810 akash1810 requested a review from a team November 9, 2023 08:57
Since adopting GuCDK's application log shipping capability,
this dependency is no longer needed.
Logs written to stdout are picked up by the journal daemon.

FluentBit is configured to forward journal logs to Central ELK.
Copy link
Contributor

@JuliaBrigitte JuliaBrigitte left a comment

Choose a reason for hiding this comment

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

Deployed to code and (successfully) checked for shippedBy

@akash1810 akash1810 merged commit 92fb049 into main Nov 13, 2023
1 check passed
@akash1810 akash1810 deleted the aa/devx-logs branch November 13, 2023 14:22
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