Releases: trustwallet/go-libs
Releases · trustwallet/go-libs
metrics: Enhance the http metrics middleware
This pull request includes changes to the middleware/metrics.go and middleware/metrics_test.go files to enhance the metrics middleware by adding status code tracking and updating the corresponding tests. The most important changes include adding status code labels, updating the metrics middleware to record status codes, and modifying the tests to validate the new status code metrics.
Enhancements to metrics middleware:
middleware/metrics.go: Added a new labellabelStatusto track HTTP status codes and updated theMetricsMiddlewarefunction to include this label in the metrics.middleware/metrics.go: Modified theMetricsMiddlewarefunction to record the status code of each request and include it in the label values.
Updates to tests:
middleware/metrics_test.go: Added a new route/404to simulate a 404 error and updated the test cases to include this new route.middleware/metrics_test.go: Updated the expected metrics to include new keys for client and server errors, and modified the assertions to check for the new status code label.
v0.8.8
v0.8.7
v0.8.6
v0.8.5
v0.8.4
Scan method in Redis wrapper
v0.8.3 scan method (#229)