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

Log stream fixes #1484

Open
loneil opened this issue Jan 20, 2025 · 1 comment
Open

Log stream fixes #1484

loneil opened this issue Jan 20, 2025 · 1 comment
Labels

Comments

@loneil
Copy link
Contributor

loneil commented Jan 20, 2025

Loki logging can be optionally enabled, see details here
https://github.com/bcgov/traction/tree/main/scripts#optional-local-log-streaming-setup

Some things to sort out for local docker compose start up and Helm deployments.

1. Promtail container startup error, local

After running docker compose -f docker-compose.logs.yml -f docker-compose.yml up
scripts-promtail-1 fails to start with:

2025-01-20 15:40:13 level=error ts=2025-01-20T23:40:13.765806511Z caller=main.go:170 
msg="error creating promtail" error="failed to make journal target manager: creating journal reader: failed to open journal in directory \"/var/log/journal\":
no such file or directory"

2. Helm chart setup for infrastructure

Need to set up necessary Loki streaming infra and config in a way that it can deploy and update to our environments.
Ideally would be stood up for pull request environments as well but might not be worth it if complicated.

3. Parameterize log filter
In log-stream.ts it references:

const handleLokiWebSocket = (tenantId: string, ws: WebSocket) => {
  const loki = new WebSocket(
    `${LOKI_URL}/loki/api/v1/tail?query={container_name="scripts-traction-agent-1"} |= \`${tenantId}\``
  );
...

Think that hard coded container name is specific to local docker standup.

4. Error handling
If anything goes wrong starting the log stream there's no feedback to the frontend, or anything logged in the Node app.

Copy link

github-actions bot commented Mar 1, 2025

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant