Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Metrics #128

Merged
merged 2 commits into from
Jul 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "compound-open-oracle",
"version": "1.1.0",
"version": "1.1.1",
"description": "The Compound Open Oracle",
"main": "index.js",
"repository": "https://github.com/compound-finance/open-oracle",
Expand Down
2 changes: 1 addition & 1 deletion poster/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "open-oracle-poster",
"version": "1.1.0",
"version": "1.1.1",
"description": "A Customizable Poster for the Compound Open Price Feed",
"main": ".tsbuilt/poster.js",
"bin": ".tsbuilt/index.js",
Expand Down
39 changes: 32 additions & 7 deletions poster/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,37 @@ async function run() {
web3.eth.transactionConfirmationBlocks = 10;
}

try {
await main(sources, poster_key, view_address, view_function, gas_limit, gas_price, price_delta, assets, mocked_world, pairs, web3);
console.log('Poster run completed successfully');
} catch (e) {
console.error(`Poster failed to run`, e);
}
await main(sources, poster_key, view_address, view_function, gas_limit, gas_price, price_delta, assets, mocked_world, pairs, web3);

let success_log = {
message: "Price Feed Poster run completed successfully",
metric_name: 'PriceFeed-PosterHealth',
labels: {
price_feed_poster_healthy: 1
}
};

process.stderr.write(JSON.stringify(success_log) + "\n", () => {
process.exit(0);
});
}

run();
run().catch((e) => {
console.error(`Error encountered: ${e}`);
console.error(e);
console.log(e.stack)
console.log

let error_log = {
message: "Price run failed",
metric_name: 'PriceFeed-PosterHealth',
labels: {
price_feed_poster_healthy: 0,
error: e.toString()
}
};

process.stderr.write(JSON.stringify(error_log) + "\n", () => {
process.exit(1);
})
});