feat: Loki Log Streaming
Rebased and resolved package conflicts
@amanji there's a pull request here that refactors some startup to a manage script. Any thoughts on if we merge that if that would cause any issues (or should have change to include) the docker compose startup instructions in this PR?
https://github.com/bcgov/traction/pull/1388/files
Let's give it a try. I doubt there will be a huge impact
@loneil we'd need to add this to the manage script:
https://github.com/bcgov/traction/blob/86fb4304e9c14f893551f8afb8e3abad7308e005/scripts/README.md?plain=1#L132
| Deployment | Resource | Location |
|---|---|---|
| Traction | ||
| Tenant UI | https://pr-1385-traction-tenant-ui-dev.apps.silver.devops.gov.bc.ca | |
| Innkeeper UI | https://pr-1385-traction-tenant-ui-dev.apps.silver.devops.gov.bc.ca/innkeeper | |
| Aca-Py | ||
| Admin Swagger | https://pr-1385-traction-acapy-admin-dev.apps.silver.devops.gov.bc.ca/api/doc | |
| Tenant Proxy Swagger | https://pr-1385-traction-tenant-proxy-dev.apps.silver.devops.gov.bc.ca/api/doc |
Deployment URLs ready for review.
FYI trying on the deployed PR and hitting start on the logs doesn't seem to show output or an error
See an aggregateError in the tenant UI backend logs:
FYI trying on the deployed PR and hitting start on the logs doesn't seem to show output or an error
See an aggregateError in the tenant UI backend logs:
We need to build in three more services for the logging. I'm assuming the deployed services dont account for those yet
FYI trying on the deployed PR and hitting start on the logs doesn't seem to show output or an error See an aggregateError in the tenant UI backend logs:
We need to build in three more services for the logging. I'm assuming the deployed services dont account for those yet
@i5okie do you have any suggestiono n how to set things up for the supporting services? i.e.: we list them as pre-requisites or do we include (optional) depenedncies in the Helm chart?
FYI trying on the deployed PR and hitting start on the logs doesn't seem to show output or an error See an aggregateError in the tenant UI backend logs:
We need to build in three more services for the logging. I'm assuming the deployed services dont account for those yet
@i5okie do you have any suggestiono n how to set things up for the supporting services? i.e.: we list them as pre-requisites or do we include (optional) depenedncies in the Helm chart?
In my opinion, I think Traction should work without throwing exceptions or failing when it runs without Loki backend being configured. As such, I think Loki should be an optional component setup separately by the user. I'd imagine, if loki endpoint is not provided/log-streaming is disabled, the feature should be turned off in someway. Or at least say logs unavailable in a friendly (not app crashing) manner on the page.
As for the promtail, it should be included as an optional sidecar.
We could put together documentation, with example configs on how to set Traction up with Loki.
I can help with the latter two.
FYI trying on the deployed PR and hitting start on the logs doesn't seem to show output or an error See an aggregateError in the tenant UI backend logs:
We need to build in three more services for the logging. I'm assuming the deployed services dont account for those yet
@i5okie do you have any suggestiono n how to set things up for the supporting services? i.e.: we list them as pre-requisites or do we include (optional) depenedncies in the Helm chart?
In my opinion, I think Traction should work without throwing exceptions or failing when it runs without Loki backend being configured. As such, I think Loki should be an optional component setup separately by the user. I'd imagine, if loki endpoint is not provided/log-streaming is disabled, the feature should be turned off in someway. Or at least say logs unavailable in a friendly (not app crashing) manner on the page.
As for the
promtail, it should be included as an optional sidecar. We could put together documentation, with example configs on how to set Traction up with Loki. I can help with the latter two.
I'll update the PR to hide the log feature when the FRONTEND_LOG_STREAM_URL is not set.
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.
I'll update the PR to hide the log feature when the
FRONTEND_LOG_STREAM_URLis not set.
@amanji it does not look like changes have been pushed since this - can you confirm? Would you be able to push the above tweak so we can move forward with reviewing/merging the pr?
@esune @i5okie @loneil Please take a look at this again. The frontend has been updated to filter out the Log component/routes from display if the logStreamUrl is not configured.
Getting a fail on one of the loki fields during Helm deployment
Error: template: traction/templates/ui/deployment.yaml:9:24: executing "traction/templates/ui/deployment.yaml" at <include (print $.Template.BasePath "/ui/configmap.yaml") .>: error calling include: template: traction/templates/ui/configmap.yaml:33:29: executing "traction/templates/ui/configmap.yaml" at <include "loki.fullname" .>: error calling include: template: no template "loki.fullname" associated with template "gotpl"
Getting a local docker error as well for me on fresh setuo
Error response from daemon: error looking up logging plugin loki: plugin "loki" not found
Built fresh (docker compose build) and then any of
docker compose -f docker-compose.logs.yml -f docker-compose.yml up
docker compose up
./manage start
If I install the loki plugin
docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions
it starts up
I guess we could add the plugin install to the manage script? That makes starting up need the manage script, and installs a plugin on people's systems even if they're not using the logging feature.
Want to support people starting up without needing logging setup so I'm not sure if there's a way to make that plugin more optional?
Thank you for taking this over @loneil
