-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from mixbytes/feature_prometheus_metrics
Added prometheus metrics, New watchdog timer based on alarm signal.
- Loading branch information
Showing
11 changed files
with
319 additions
and
188 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 4 |
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,7 @@ | ||
# Handle line endings automatically for files detected as text | ||
# and leave all files detected as binary untouched. | ||
* text=auto | ||
|
||
# Never modify line endings of our bash scripts | ||
*.sh text eol=lf | ||
*.py text eof=lf |
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 |
---|---|---|
|
@@ -6,3 +6,7 @@ tests/__pycache__ | |
oracleservice/__pycache__ | ||
|
||
*.swp | ||
|
||
prompt.py | ||
*.cmd | ||
*.json |
Large diffs are not rendered by default.
Oops, something went wrong.
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,27 @@ | ||
from dataclasses import dataclass | ||
from prometheus_client import Counter, Gauge, Histogram, Info | ||
|
||
|
||
@dataclass | ||
class MetricsExporter: | ||
"""Prometheus metrics that the Oracle collects""" | ||
agent = Info('agent', 'the address of the connected relay chain node') | ||
|
||
is_recovery_mode_active = Gauge('is_recovery_mode_active', '1, if the recovery mode, otherwise - the default mode') | ||
|
||
active_era_id = Gauge('active_era_id', 'active era index') | ||
last_era_reported = Gauge('last_era_reported', 'the last era that the Oracle has reported') | ||
previous_era_change_block_number = Gauge('previous_era_change_block_number', 'block number of the previous era change') | ||
time_elapsed_until_last_report = Gauge('time_elapsed_until_last_report', | ||
'the time elapsed until the last report from the unix epoch in seconds') | ||
|
||
total_stashes_free_balance = Gauge('total_stashes_free_balance', 'total free balance of all stash accounts') | ||
|
||
tx_revert = Histogram('tx_revert', 'reverted transactions') | ||
tx_success = Histogram('tx_success', 'successful transactions') | ||
|
||
para_exceptions_count = Counter('para_exceptions_count', 'parachain exceptions count') | ||
relay_exceptions_count = Counter('relay_exceptions_count', 'relay chain exceptions count') | ||
|
||
|
||
metrics_exporter = MetricsExporter() |
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
Oops, something went wrong.