Skip to content

Commit

Permalink
[YUNIKORN-2745] Log analysis adopting loki
Browse files Browse the repository at this point in the history
  • Loading branch information
mean-world committed Jul 15, 2024
1 parent 04087d8 commit ea88383
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions docs/user_guide/loki.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,19 @@ helm upgrade --install promtail grafana/promtail -f promtail.yaml
![promtail](../assets/promtail.png)

## Grafana settings to connect to Loki
1. Access the Grafana Web UI
### 1. Access the Grafana Web UI
```
kubectl port-forward -n meta service/grafana 3000:3000
```
After running port forwarding, you can access Grafana's web interface by [localhost:3000](http://localhost:3000) in your browser.

2. Set URL

set URL field `http://loki-gateway`
### 2. Set URL and HTTP headers
In grafana, adding a loki data source with url and http headers allows grafana to fetch logs.

#### set URL field `http://loki-gateway`
![setting_1](../assets/grafana_loki_setting_1.png)

3. Set HTTP headers

set HTTP headers field `X-Scope-OrgId` and set value field `user`

#### In order to fetch logs from promtail which tenantID is user, set HTTP headers field X-Scope-OrgId with user.
![setting_2](../assets/grafana_loki_setting_2.png)

## Loki log result
Expand All @@ -169,4 +166,4 @@ After running port forwarding, you can access Grafana's web interface by [localh
2. bar chart
![bar_chart](../assets/loki_log_1.png)
3. INFO log
![bar_chart](../assets/loki_log_2.png)
![logs trace](../assets/loki_log_2.png)

0 comments on commit ea88383

Please sign in to comment.