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

feat: Add Loki to Dev Environment Stack #435

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

AlfredoG87
Copy link
Contributor

@AlfredoG87 AlfredoG87 commented Dec 30, 2024

Description:
This allows the Block-Node developer, using the included docker-compose based Dev Env Stack to access the logs on the included Grafana dashboard.

Also configures multiline log merging for promtail.

Related issue(s):

Fixes #432

Notes for reviewer:

BEFORE:
image

AFTER:

image

image

image

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@AlfredoG87 AlfredoG87 self-assigned this Dec 31, 2024
@AlfredoG87 AlfredoG87 added this to the 0.4.0 milestone Dec 31, 2024
@AlfredoG87 AlfredoG87 added the Block Node Issues/PR related to the Block Node. label Dec 31, 2024
@AlfredoG87 AlfredoG87 modified the milestones: 0.4.0, 0.3.0 Dec 31, 2024
@AlfredoG87 AlfredoG87 marked this pull request as ready for review December 31, 2024 19:39
@AlfredoG87 AlfredoG87 requested a review from a team as a code owner December 31, 2024 19:39
Copy link
Contributor

@ata-nas ata-nas left a comment

Choose a reason for hiding this comment

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

LGTM. One question: the pr title seems to imply that this will be present only for development. If that is so, how do we ensure that?

@AlfredoG87
Copy link
Contributor Author

LGTM. One question: the pr title seems to imply that this will be present only for development. If that is so, how do we ensure that?

The changes done here are to integrate loki to the docker-compose stack, that deploy stack is used only on dev. there is a separate PR to integrate Loki on Production deployments using the included helm chart.

…ing 2 handlers, coonsole and file. the file configuration keeps the logs local.

Then another container prom-tail also has access to the shared volume where the block-node writes the logs. consumes them using tail on the same file.

prom-tail pushes those logs to loki for transformation and storage.

loki is added to Grafana as a loki type Datasource.

Note: explore future iterations of logging using docker service, where promtail consumes the logs directly from stdout using the docker.sock service.
Signed-off-by: Alfredo Gutierrez <[email protected]>
…m docker sock service

Signed-off-by: Alfredo Gutierrez <[email protected]>
Signed-off-by: Alfredo Gutierrez <[email protected]>
Signed-off-by: Alfredo Gutierrez <[email protected]>
Signed-off-by: Alfredo Gutierrez <[email protected]>
Copy link

codecov bot commented Jan 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.78%. Comparing base (c303fa0) to head (7c6cf3c).

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #435   +/-   ##
=========================================
  Coverage     96.78%   96.78%           
  Complexity      409      409           
=========================================
  Files            82       82           
  Lines          1460     1460           
  Branches         90       90           
=========================================
  Hits           1413     1413           
  Misses           34       34           
  Partials         13       13           

Copy link
Contributor

@ata-nas ata-nas left a comment

Choose a reason for hiding this comment

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

LTGM

@ata-nas
Copy link
Contributor

ata-nas commented Jan 8, 2025

Should license headers be present in all files?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Block Node Issues/PR related to the Block Node.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Loki to the Dev Environment using Docker-Compose
2 participants