Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/domwoe/canister-monitoring
Example of monitoring a canister with Prometheus
https://github.com/domwoe/canister-monitoring
dfinity internet-computer monitoring motoko prometheus
Last synced: 5 days ago
JSON representation
Example of monitoring a canister with Prometheus
- Host: GitHub
- URL: https://github.com/domwoe/canister-monitoring
- Owner: domwoe
- License: apache-2.0
- Created: 2022-05-27T12:35:37.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-06-02T17:40:00.000Z (over 2 years ago)
- Last Synced: 2024-08-02T06:16:04.201Z (3 months ago)
- Topics: dfinity, internet-computer, monitoring, motoko, prometheus
- Language: Motoko
- Homepage:
- Size: 16.6 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-internet-computer - Canister monitoring - Example of using Prometheus to collect metrics from a canister. (Developer Tooling / Monitoring)
README
# Canister Monitoring with Prometheus
This is an example project to show how to monitor a canister written in Motoko using Prometheus.
The canister exposes a `/metrics` HTTP endpoint that encodes important metrics in a text based format Prometheus understands.
You can customize the metrics in the metrics function.The Prometheus configuration can be adapted by changing the configuration files in the `prometheus` folder.
In particular you can change the [alert.yml](./prometheus/alert.yml) to create customized alerts.## Requirements
- [Docker](https://docs.docker.com/get-docker/)
## Usage
```bash
docker compose up
```The Prometheus user interface will be available at `https://localhost:9000`.
If you make changes run `docker compose build` before `docker compose up`.
### Authorization
This example uses an API key to control access to the metrics endpoint.## Troubleshooting
If you're running this on a M1 Mac you might need to run `DOCKER_DEFAULT_PLATFORM=linux/amd64 docker-compose up`.