traction icon indicating copy to clipboard operation
traction copied to clipboard

feat: Loki Log Streaming

Open amanji opened this issue 1 year ago • 1 comments

amanji avatar Oct 09 '24 15:10 amanji

Rebased and resolved package conflicts

loneil avatar Oct 10 '24 23:10 loneil

@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

loneil avatar Oct 15 '24 17:10 loneil

Let's give it a try. I doubt there will be a huge impact

amanji avatar Oct 15 '24 18:10 amanji

@loneil we'd need to add this to the manage script:

https://github.com/bcgov/traction/blob/86fb4304e9c14f893551f8afb8e3abad7308e005/scripts/README.md?plain=1#L132

amanji avatar Oct 15 '24 20:10 amanji

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.

github-actions[bot] avatar Oct 16 '24 14:10 github-actions[bot]

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: image

loneil avatar Oct 16 '24 15:10 loneil

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: image

We need to build in three more services for the logging. I'm assuming the deployed services dont account for those yet

amanji avatar Oct 16 '24 16:10 amanji

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: image

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?

esune avatar Oct 18 '24 23:10 esune

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: image

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.

i5okie avatar Oct 18 '24 23:10 i5okie

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: image

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.

amanji avatar Oct 22 '24 14:10 amanji

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.

github-actions[bot] avatar Dec 07 '24 02:12 github-actions[bot]

I'll update the PR to hide the log feature when the FRONTEND_LOG_STREAM_URL is 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 avatar Dec 12 '24 19:12 esune

@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.

amanji avatar Jan 10 '25 16:01 amanji

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"

loneil avatar Jan 10 '25 18:01 loneil

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?

loneil avatar Jan 10 '25 19:01 loneil

Thank you for taking this over @loneil

amanji avatar Jan 17 '25 21:01 amanji