-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: active orders observability TODOs (#469)
* fix: active orders overflow bug * chore: active orders observability TODOs * updates * lint * chore: active orders observability TODOs Introduce Prometheus error counters --------- Co-authored-by: Deividas Petraitis <[email protected]> (cherry picked from commit 4f5b8b8)
- Loading branch information
1 parent
0583181
commit bf78411
Showing
4 changed files
with
82 additions
and
7 deletions.
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,56 @@ | ||
package telemetry | ||
|
||
import "github.com/prometheus/client_golang/prometheus" | ||
|
||
var ( | ||
// sqs_orderbook_usecase_get_active_orders_error_total | ||
// | ||
// counter that measures the number of errors that occur during getting active orders in orderbook usecase | ||
// | ||
// Has the following labels: | ||
// * contract - the address of the orderbook contract | ||
// * address - address of the user wallet | ||
// * err - the error message occurred | ||
GetActiveOrdersErrorMetricName = "sqs_orderbook_usecase_get_active_orders_error_total" | ||
|
||
// sqs_orderbook_usecase_get_tick_by_id_not_found_total | ||
// | ||
// counter that measures the number of times a tick is not found by id in orderbook usecase | ||
GetTickByIDNotFoundMetricName = "sqs_orderbook_usecase_get_tick_by_id_not_found_total" | ||
|
||
// sqs_orderbook_usecase_create_limit_order_error_total | ||
// | ||
// counter that measures the number of errors that occur during creating limit order in orderbook | ||
// | ||
// Has the following labels: | ||
// * order - the order from orderbook that was attempted to be created as a limit order | ||
// * err - the error message occurred | ||
CreateLimitOrderErrorMetricName = "sqs_orderbook_usecase_create_limit_order_error_total" | ||
|
||
GetActiveOrdersErrorCounter = prometheus.NewCounter( | ||
prometheus.CounterOpts{ | ||
Name: GetActiveOrdersErrorMetricName, | ||
Help: "counter that measures the number of errors that occur during retrieving active orders from orderbook contract", | ||
}, | ||
) | ||
|
||
GetTickByIDNotFoundCounter = prometheus.NewCounter( | ||
prometheus.CounterOpts{ | ||
Name: GetTickByIDNotFoundMetricName, | ||
Help: "counter that measures the number of not found ticks by ID that occur during retrieving active orders from orderbook contract", | ||
}, | ||
) | ||
|
||
CreateLimitOrderErrorCounter = prometheus.NewCounter( | ||
prometheus.CounterOpts{ | ||
Name: CreateLimitOrderErrorMetricName, | ||
Help: "counter that measures the number errors that occur during creating a limit order orderbook from orderbook order", | ||
}, | ||
) | ||
) | ||
|
||
func init() { | ||
prometheus.MustRegister(GetActiveOrdersErrorCounter) | ||
prometheus.MustRegister(GetTickByIDNotFoundCounter) | ||
prometheus.MustRegister(CreateLimitOrderErrorCounter) | ||
} |
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