Skip to content

Commit

Permalink
Merge pull request kmesh-net#77 from skwwwwww/kmesh-performance-monit…
Browse files Browse the repository at this point in the history
…oring

Add Use Grafana to visualize kmesh perofrmance monitoring
  • Loading branch information
kmesh-bot authored Oct 31, 2024
2 parents 34dbfc9 + c095a1c commit ed08164
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions content/en/docs/userguide/performance_monitoring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
draft: false
linktitle: Use Grafana to visualize kmesh perofrmance monitoring
menu:
docs:
parent: user guide
weight: 19
title: Use Grafana to visualize kmesh perofrmance monitoring
toc: true
type: docs

---

### Preparation

1. Make default namespace managed by Kmesh

2. Set relevant args

Modify bpf/kmesh/probes/performance_probe.h by changing #define PERF_MONITOR 0 to #define PERF_MONITOR 1.
Change --enable-perfmonitor=false to --enable-perfmonitor=true in deploy/yaml/kmesh.yaml.

3. Deploy bookinfo as sample application and sleep as curl client

4. Install namespace granularity waypoint for default namespace

*The above steps could refer to [Install Waypoint | Kmesh](https://kmesh.net/en/docs/userguide/install_waypoint/#preparation)*

5. Deploy prometheus and garafana:

```bash
[root@ ~]# kubectl apply -f https://raw.githubusercontent.com/kmesh-net/kmesh/main/samples/addons/prometheus.yaml
[root@ ~]# kubectl apply -f https://raw.githubusercontent.com/kmesh-net/kmesh/main/samples/addons/grafana.yaml
```
### Generate some continuous traffic between applications in the mesh

```bash
[root@ ~]# kubectl exec deploy/sleep -- sh -c "while true; do curl -s http://productpage:9080/productpage | grep reviews-v.-; sleep 1; done"
```
### Use grafana to visualize kmesh performance monitoring

1. Use the port-forward command to forward traffic to grafana:

```bash
[root@ ~]# kubectl port-forward --address 0.0.0.0 svc/grafana 3000:3000 -n kmesh-system
Forwarding from 0.0.0.0:3000 -> 3000
```

2. View the dashboard from browser

Visit `Dashboards>Kmesh>Kmesh performance monitoring`:

<div align="center">
<img src="/docs/userguide/kmesh_deamon_monitoring.jpg" width="1400" />
<img src="/docs/userguide/kmesh_map_and_operation_monitoring.jpg" width="1400" />
</div>

### Cleanup

1. Remove prometheus and grafana:

```bash
[root@ ~]# kubectl delete -f https://raw.githubusercontent.com/kmesh-net/kmesh/main/samples/addons/prometheus.yaml
[root@ ~]# kubectl delete -f https://raw.githubusercontent.com/kmesh-net/kmesh/main/samples/addons/grafana.yaml
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ed08164

Please sign in to comment.