2025-02-13 15:44:08 +00:00
|
|
|
# Api related artifacts
|
|
|
|
|
|
|
|
|
|
## Prometheus metrics
|
|
|
|
|
|
2025-03-17 18:14:15 +00:00
|
|
|
Prometheus metrics are exposed for all api endpoints automatically at the standard `/metrics` endpoint. (`http://localhost:8080/metrics`)
|
|
|
|
|
|
|
|
|
|
## Swagger API documentation
|
|
|
|
|
|
|
|
|
|
Automatic API docs are generated and exposed for all routes at `http://localhost:8080/swagger/index.html` when the api server is running.
|
|
|
|
|
|
|
|
|
|
## Logging
|
2025-02-13 15:44:08 +00:00
|
|
|
|
|
|
|
|
Structured logging is built into all API routes automatically.
|
|
|
|
|
|
2025-03-17 18:14:15 +00:00
|
|
|
So for example here is a what a few API hits on queryAPI look like in the logs when using text (as opposed to json)
|
2025-02-13 15:44:08 +00:00
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
____ __
|
|
|
|
|
/ __/___/ / ___
|
|
|
|
|
/ _// __/ _ \/ _ \
|
|
|
|
|
/___/\__/_//_/\___/ v4.13.3
|
|
|
|
|
High performance, minimalist Go web framework
|
|
|
|
|
https://echo.labstack.com
|
|
|
|
|
____________________________________O/_______
|
|
|
|
|
O\
|
|
|
|
|
⇨ http server started on [::]:8080
|
|
|
|
|
time=2025-02-05T13:38:32.484-08:00 level=INFO msg="HTTP request" method=GET uri=/metrics status=200 latency=2.713792ms error=<nil> remote_ip=::1
|
|
|
|
|
time=2025-02-05T13:38:39.792-08:00 level=INFO msg="HTTP request" method=GET uri=/swagger/index.html status=200 latency=490.625µs error=<nil> remote_ip=::1
|
|
|
|
|
time=2025-02-05T13:38:39.803-08:00 level=INFO msg="HTTP request" method=GET uri=/swagger/swagger-ui.css status=200 latency=738.083µs error=<nil> remote_ip=::1
|
|
|
|
|
time=2025-02-05T13:38:39.805-08:00 level=INFO msg="HTTP request" method=GET uri=/swagger/swagger-ui-standalone-preset.js status=200 latency=887.875µs error=<nil> remote_ip=::1
|
|
|
|
|
time=2025-02-05T13:38:39.807-08:00 level=INFO msg="HTTP request" method=GET uri=/swagger/swagger-ui-bundle.js status=200 latency=3.854042ms error=<nil> remote_ip=::1
|
|
|
|
|
time=2025-02-05T13:38:39.871-08:00 level=INFO msg="HTTP request" method=GET uri=/swagger/doc.json status=200 latency=1.163167ms error=<nil> remote_ip=::1
|
|
|
|
|
time=2025-02-05T13:38:39.871-08:00 level=INFO msg="HTTP request" method=GET uri=/swagger/favicon-32x32.png status=200 latency=60.875µs error=<nil> remote_ip=::1
|
|
|
|
|
|
2025-03-17 18:14:15 +00:00
|
|
|
```
|