-
Notifications
You must be signed in to change notification settings - Fork 90
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
Merged
Merged
monitoring dashboard #876
Changes from 14 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
233482e
update metrics
shiqizng c010128
add monitoring setup files
shiqizng dd25f28
remove a commented line
shiqizng 5ad289e
add a new line
shiqizng e6766ca
Merge branch 'develop' of https://github.com/algorand/indexer into sh…
shiqizng 7c5f84a
go-algorand update
shiqizng 674f043
Merge branch 'develop' of https://github.com/algorand/indexer into sh…
shiqizng 5256525
parametrize algod token
shiqizng 3350508
Merge branch 'develop' of https://github.com/algorand/indexer into sh…
shiqizng 3c3e0bf
revert rebase, metrics renaming
shiqizng 0d41272
update go-algorand
shiqizng ff177bb
update go-algorand
shiqizng e4fe46a
review changes
shiqizng 9ff08f3
updated monitoring readme
shiqizng 033efe9
set grafana version
shiqizng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
ARG GO_VERSION=1.17.5 | ||
FROM golang:$GO_VERSION | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
RUN apt-get update && apt-get install -y apt-utils curl git git-core bsdmainutils python3 | ||
|
||
|
||
# Build go-algorand | ||
RUN mkdir /work | ||
WORKDIR /work | ||
ADD . ./ | ||
WORKDIR /work/third_party/go-algorand | ||
RUN ./scripts/configure_dev.sh | ||
RUN make | ||
|
||
# Build indexer | ||
WORKDIR /work | ||
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 ${ALGOD_TOKEN}"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
## Indexer Monitoring Dashboard | ||
A monitoring dashboard displaying indexer performance metrics. | ||
|
||
### To start a monitoring dashboard | ||
### Prerequisite | ||
- Algorand indexer is running with metrics-mode set to ON or VERBOSE | ||
|
||
Data sources for Grafana are set in `grafana_prometheus_datasource.yml`. Check that configurations for | ||
Prometheus source and PostgresSQL source are correct or Grafana will not have the metrics. | ||
|
||
Also, Prometheus target should be updated to listen to a correct indexer address (host:port). The default target assumes | ||
the indexer is running on prometheus container's host at port 8888. Check `<prometheus-url>/targets` to see whether Prometheus | ||
connects to the target successfully. | ||
|
||
```json | ||
static_configs: | ||
- targets: ['host.docker.internal:8888'] | ||
``` | ||
|
||
Run, | ||
|
||
`docker-compose up -d prometheus grafana` | ||
|
||
- Check metrics are written to <indexer-url>/metrics | ||
- Grafana is running on http://localhost:3000; default login (admin/admin) | ||
|
||
|
||
|
||
### View metrics on grafana | ||
|
||
- Go to Import and upload dashboard.json | ||
- Run `create extension pg_stat_statements;` sql on db to enable query stats from Postgres. | ||
- If getting error such as `elation "pg_stat_statements" does not exist`, check `pg_stat_statements` is | ||
loaded to shared_preload_libraries in postgresql.conf or added in db start up command `-c shared_preload_libraries=pg_stat_statements`. | ||
|
||
![](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 | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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.