Skip to content

Commit

Permalink
Add more dashboards, links and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
okdas committed Apr 10, 2024
1 parent bc72d8d commit f3297a7
Show file tree
Hide file tree
Showing 11 changed files with 4,072 additions and 16 deletions.
11 changes: 10 additions & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ if localnet_config["observability"]["enabled"]:
)

# Grafana discovers dashboards to "import" via a label
local("kubectl label configmap protocol-dashboards grafana_dashboard=1 --overwrite")
local_resource("protocol-dashboards-label","kubectl label configmap protocol-dashboards grafana_dashboard=1 --overwrite", resource_deps=["protocol-dashboards"])

# Import keyring/keybase files into Kubernetes ConfigMap
configmap_create(
Expand Down Expand Up @@ -150,6 +150,8 @@ helm_resource(
"--values=./localnet/kubernetes/values-validator.yaml",
"--set=persistence.cleanupBeforeEachStart="
+ str(localnet_config["validator"]["cleanupBeforeEachStart"]),
"--set=serviceMonitor.enabled="
+ str(localnet_config["observability"]["enabled"]),
],
image_deps=["poktrolld"],
image_keys=[("image.repository", "image.tag")],
Expand Down Expand Up @@ -195,6 +197,7 @@ for x in range(localnet_config["appgateservers"]["count"]):
"--values=./localnet/kubernetes/values-common.yaml",
"--values=./localnet/kubernetes/values-appgateserver.yaml",
"--set=config.signing_key=app" + str(actor_number),
"--set=metrics.serviceMonitor.enabled="+ str(localnet_config["observability"]["enabled"]),
],
image_deps=["poktrolld"],
image_keys=[("image.repository", "image.tag")],
Expand All @@ -203,6 +206,7 @@ for x in range(localnet_config["appgateservers"]["count"]):
"appgateserver" + str(actor_number),
labels=["applications"],
resource_deps=["validator"],
links=[link('http://localhost:3003/d/appgateserver/protocol-appgate-server?orgId=1&refresh=5s&var-appgateserver=appgateserver' + str(actor_number), 'Grafana dashboard'),],
port_forwards=[
str(42068+actor_number)+":42069", # appgateserver1 - exposes 42069, appgateserver2 exposes 42070, etc.
str(40054+actor_number)+":40006", # DLV port. appgateserver1 - exposes 40055, appgateserver2 exposes 40056, etc.
Expand All @@ -222,6 +226,7 @@ for x in range(localnet_config["gateways"]["count"]):
"--values=./localnet/kubernetes/values-common.yaml",
"--values=./localnet/kubernetes/values-gateway.yaml",
"--set=config.signing_key=gateway" + str(actor_number),
"--set=metrics.serviceMonitor.enabled="+ str(localnet_config["observability"]["enabled"]),
],
image_deps=["poktrolld"],
image_keys=[("image.repository", "image.tag")],
Expand All @@ -230,6 +235,7 @@ for x in range(localnet_config["gateways"]["count"]):
"gateway" + str(actor_number),
labels=["gateways"],
resource_deps=["validator"],
links=[link('http://localhost:3003/d/appgateserver/protocol-appgate-server?orgId=1&refresh=5s&var-appgateserver=gateway' + str(actor_number), 'Grafana dashboard'),],
port_forwards=[
str(42078+actor_number)+":42069", # gateway1 - exposes 42079, gateway2 exposes 42080, etc.
str(40064+actor_number)+":40006", # DLV port. gateway1 - exposes 40065, gateway2 exposes 40066, etc.
Expand All @@ -242,6 +248,9 @@ k8s_resource(
"validator",
labels=["pocket_network"],
port_forwards=["36657", "36658", "40004"],
links=[
link('http://localhost:3003/d/cosmoscometbft/protocol-cometbft-dashboard?orgId=1&from=now-1h&to=now', 'Validator dashboard'),
]
)

k8s_resource("anvil", labels=["data_nodes"], port_forwards=["8547"])
6 changes: 6 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,17 @@ client:
validators:
- name: validator1
bonded: 900000000upokt
app:
telemetry:
enabled: true
prometheus-retention-time: "600" # seconds
config:
moniker: "validator1"
consensus:
timeout_commit: "2s"
timeout_propose: "2s"
instrumentation:
prometheus: true
client:
chain-id: poktroll

Expand Down
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.
28 changes: 27 additions & 1 deletion docusaurus/docs/internal_infrastructure/localnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ needed to send an end-to-end relay.
- [Report issues](#report-issues)
- [TL;DR](#tldr)
- [Developing with LocalNet](#developing-with-localnet)
- [localnet_config.yaml](#localnet_configyaml)
- [localnet\_config.yaml](#localnet_configyaml)
- [Scaling network actors](#scaling-network-actors)
- [Modify Kubernetes workloads](#modify-kubernetes-workloads)
- [Observability](#observability)
- [Access dashboards with graphs and logs](#access-dashboards-with-graphs-and-logs)
- [How to update and save dashboard](#how-to-update-and-save-dashboard)
- [Troubleshooting](#troubleshooting)
- [Clean Slate (Nuclear Option)](#clean-slate-nuclear-option)

Expand Down Expand Up @@ -110,6 +113,29 @@ You can always set it back to `false` with:
sed -i'' -e '/helm_chart_local_repo:/,+1 s/\(enabled: \)false/\1true/; /helm_chart_local_repo:/,+1 s/\(enabled: \)true/\1false/' localnet_config.yaml
```

## Observability

You can configure LocalNet to deploy third-party observability tools such as Prometheus and Grafana:

`localnet_config.yaml`:
```yaml
observability:
enabled: true
```

### Access dashboards with graphs and logs

Next to each service, there is a link that takes you to the related Grafana dashboard (RelayMiner, Validator, AppGate Server have separate dashboards).

![Example](./access_dashboard_on_service.png)

### How to update and save dashboard

Every time LocalNet is started, Grafana is deployed from scratch, including the provisioning of dashboards. Therefore, we maintain JSON files with dashboards in the `localnet/grafana-dashboards` directory. If you wish to change a dashboard, make the necessary modifications in the Grafana UI, click save button - which will then display the updated JSON output of the dashboard. Simply copy this output and update the corresponding file in the `localnet/grafana-dashboards` directory.

![Example](./grafana_save_dashboard.png)


## Troubleshooting

### Clean Slate (Nuclear Option)
Expand Down
Loading

0 comments on commit f3297a7

Please sign in to comment.