-
Notifications
You must be signed in to change notification settings - Fork 93
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
monitoring dashboard #876
monitoring dashboard #876
Changes from 7 commits
233482e
c010128
dd25f28
5ad289e
e6766ca
7c5f84a
674f043
5256525
3350508
3c3e0bf
0d41272
ff177bb
e4fe46a
9ff08f3
033efe9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
DB_CONNECTION = "host=indexer-db port=5432 user=algorand password=algorand dbname=indexer_db sslmode=disable" | ||
shiqizng marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ALGOD_NET = https://node-archival-testnet.internal.aws.algodev.network:443 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM alpine:latest | ||
|
||
RUN apk add --no-cache git make musl-dev go bash libtool autoconf automake build-base libsodium-dev boost-dev | ||
|
||
# Configure Go | ||
ENV GOROOT /usr/lib/go | ||
ENV GOPATH /go | ||
ENV PATH /go/bin:$PATH | ||
|
||
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin | ||
|
||
# Build and run indexer | ||
RUN mkdir /work | ||
WORKDIR /work | ||
ADD . ./ | ||
RUN make | ||
WORKDIR /work/cmd/algorand-indexer | ||
ENV CGO_ENABLED="1" | ||
RUN go build | ||
|
||
# The sleep is to wait until postgres starts | ||
CMD ["/bin/sh", "-c", "\ | ||
echo $ALGOD_NET && \ | ||
echo $CONNECTION_STRING &&\ | ||
sleep 5 && \ | ||
./algorand-indexer daemon \ | ||
--server \":${PORT}\" \ | ||
-P \"${CONNECTION_STRING}\" \ | ||
--metrics-mode VERBOSE \ | ||
--algod-net \"${ALGOD_NET}\" \ | ||
--algod-token YddOUGbAjHLr1uPZtZwHOvMDmXvR1Zvw1f3Roj2PT1ufenXbNyIxIz0IeznrLbDsF"] | ||
shiqizng marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
## Indexer Monitoring Dashboard | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to update these instructions to make it clear that they are for starting a demo. The top-level README should also get some additional instructions for installing the dashboard on an existing prometheus/grafana instance. To that end, I think you can leave out details about how the docker-compose file can be updated to connect to a different indexer. |
||
A monitoring dashboard displaying indexer performance metrics. | ||
|
||
### To start a monitoring dashboard | ||
Configurable env vars, `DB_CONNECTION` and `ALGOD_NET`. The default values are set in `.env`. | ||
|
||
if indexer is not already running, start all services in `docker-compose.yml` | ||
|
||
`docker-compose up -d` | ||
|
||
if indexer is already running, start monitoring services only. | ||
|
||
`docker-compose up -d prometheus grafana` | ||
|
||
prometheus target should be updated to listen to a correct indexer address (host:port), | ||
|
||
```json | ||
static_configs: | ||
- targets: ['indexer:8888'] | ||
``` | ||
|
||
By default, | ||
- indexer is running on http://localhost:8888 | ||
- grafana is running on http://localhost:3000; default login (admin/admin) | ||
|
||
### View metrics on grafana | ||
|
||
- In grafana configurations, add a PostgreSQL datasource. See example below. | ||
- Go to Import and upload dashboard.json | ||
- Run `create extension pg_stat_statements;` sql on db to enable query stats from Postgres | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was able to import on deployment outside of docker, but the postgres portion didn't seem to work. The query ran fine in pqsl but didn't show up in grafana. |
||
|
||
![](examples/postgresql_conn.png) | ||
![](examples/widgets.png) | ||
|
||
|
||
**Default widgets**: | ||
|
||
Importing | ||
- Block import time | ||
- Transactions per block by type | ||
- TPS | ||
- Round # | ||
|
||
Query | ||
|
||
- Request duration | ||
- Request duraton by url | ||
- Postgres Eval Time | ||
|
||
System | ||
|
||
- average CPU usage | ||
- average Heap Alloc | ||
- Postgres table info | ||
- Postgres queries info | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this metric be named
GetAlgodRawBlockTimeSeconds
instead? That might be easier to understand when building queries in grafana