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

UID2-4645 remove loki #590

Merged
merged 2 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ SSP_KK_SECRET="vkmHl0pPRf2skBq0v9MTvy9AlilxPSDa"
SSP_APP_NAME="ssportal-dev"
SSP_WEB_BASE_URL="http://localhost:3000"
SSP_KK_API_CLIENT_ID="fe765b74-a8dc-4da3-ac1f-cd5a71573807"
SSP_LOKI_HOST="http://host.docker.internal:3100"
SSP_ADMIN_SERVICE_BASE_URL = "http://localhost:8089"
SSP_OKTA_AUTH_SERVER_URL = "https://uid2.okta.com/oauth2/aus1oqu660mF7W3hi1d8"
SSP_OKTA_CLIENT_ID = "0oa1p0c8howKUR1Yf1d8"
Expand Down
33 changes: 0 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,39 +119,6 @@ See https://github.com/IABTechLab/uid2-self-serve-portal/pull/98/files for an ex

Keycloak also provides [Upgrading Guides](https://www.keycloak.org/docs/latest/upgrading/index.html) for each version.

## Logging stack

#### Tech Stack

For logging, we use [Loki and Grafana](https://grafana.com/oss/loki/) to store and query logs.
We use the [winston-express](https://www.npmjs.com/package/winston-express) helper for [express](https://www.npmjs.com/package/express) in order to log to [winston](https://github.com/winstonjs/winston) from the browser. It helps format and label our log outputs for ingestion into Loki.

#### Development setup

For development purposes, we can can spawn docker images for Loki/Grafana/Promtail to test and validate our loggings.

To do this, an optional docker file is provided `docker-compose.log-stack.yml` in the root folder. This ensures that typical development workflows (that don't need logger stack) don't spawn these additional containers unnecessarily.

To instantiate the logging stack, use the following command:-

```
docker compose -f docker-compose.yml -f docker-compose.log-stack.yml up
```

This will spawn 3 additional containers for Promtail, Loki and Grafana.

Once running, log onto the Grafana UI from [http://localhost:3101](http://localhost:3101). Use the username `admin` and password `admin`.

Add the Loki datasource in Grafana with the following Loki data-source url: `http://host.docker.internal:3100`. Notes: When adding Loki, if the test query fails, try a query in the **Explore** tab as it may have been added and working anyway. This url should match the value of `SSP_LOKI_HOST` in your `.env` file.

The logs should now be available in the **Explore** tab to query - you may need to trigger some API requests in the UI to generate some logs. You can then debug requests by specifying the app name along with a traceId, for example:

```
{app="ssportal-dev"} |= `ae44989e-7654-4e7f-ae7c-8987a829a622`
```

Note: the name of the app should match the `SSP_APP_NAME` in your `.env` file.

## Email Templates

### Adding a New Email Template
Expand Down
47 changes: 0 additions & 47 deletions config/loki-config.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions config/promtail-config.yaml

This file was deleted.

35 changes: 0 additions & 35 deletions docker-compose.log-stack.yml

This file was deleted.

Loading