Skip to content

Commit

Permalink
add forwarder metrics retrieval (#4464)
Browse files Browse the repository at this point in the history
* add metrics retrieval for forwarder

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix traces retrieval

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>
  • Loading branch information
NikitaSkrynnik authored Jan 28, 2022
1 parent 340f381 commit 8ed2870
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions examples/observability/jaeger-and-prometheus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ Ping from NSE to NSC:
kubectl exec ${NSE} -n ${NAMESPACE} -- ping -c 4 172.16.1.101
```

Select manager:
Select forwarder:
```bash
NSMGR=$(kubectl get pods -l app=nsmgr -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
NSMGR=${NSMGR:0:11}
NODES=($(kubectl get nodes -o go-template='{{range .items}}{{ if not .spec.taints }}{{index .metadata.labels "kubernetes.io/hostname"}} {{end}}{{end}}'))
FORWARDER=$(kubectl get pods -l app=forwarder-vpp --field-selector spec.nodeName==${NODES[0]} -n nsm-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
```

Expose ports to access Jaeger and Prometheus UI:
Expand All @@ -156,16 +156,21 @@ kubectl port-forward service/prometheus -n observability 9090:9090&

Retrieve traces from Jaeger:
```bash
result=$(curl -X GET localhost:16686/api/traces?service=${NSMGR}&lookback=5m&limit=1)
result=$(curl -X GET localhost:16686/api/traces?service=${FORWARDER}&lookback=5m&limit=1)
echo ${result}
echo ${result} | grep -q "nsmgr"
echo ${result} | grep -q "forwarder"
```

Replace '-' with '_' in forwarder pod name (Forwarder metric names contain only "_")
```bash
FORWARDER=${FORWARDER//-/_}
```

Retrieve metrics from Prometheus:
```bash
result=$(curl -X GET localhost:9090/api/v1/query?query=up)
result=$(curl -X GET localhost:9090/api/v1/query?query="${FORWARDER}_server_tx_bytes_sum")
echo ${result}
echo ${result} | grep -q "up"
echo ${result} | grep -q "forwarder"
```

## Cleanup
Expand Down

0 comments on commit 8ed2870

Please sign in to comment.