Document Result Endpoint * testing * cleantesting * progress * query * lint * readme * dockerclient * api * passtest * tests * test
1.2 KiB
Prometheus docs
All instructions assume you are already in the devbox shell
To run various services and inspect prometheus metrics first run the
task compose:up:test to start the db and prometheus services.
Then you can run your service that exposed the metrics.
Testing the API service
Start the API server on the host like
PGPORT=5430 go run ./cmd/queryAPI
Once started you will be able to see the raw metrics at http://localhost:8080/metrics
The prometheus console will be running at http://localhost:9090/
The docs to the api server will be available at http://localhost:8080/swagger/index.html
For example to run the query endpoint (to see query related metrics generated) go to http://localhost:8080/query
Sample prometheus queries for the console
Duration of the /query api call (from Echo metrics)
echo_request_duration_seconds_sum{code="200", host="localhost:8080", instance="host.docker.internal:8080", job="api", method="GET", url="/query"}
Memory allocation rate (from Go metrics)
rate(go_memstats_alloc_bytes_total[5m])
Time since last GC
time() - go_memstats_last_gc_time_seconds
Gc overhead
rate(go_gc_duration_seconds_sum[5m])
More examples TBD.