-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(iroha-connector): add prometheus exporter to the plugin
Primary Changes ---------------- 1. Added Prometheus Exporter to Iroha ledger plugin 2. Added Prometheus Metrics tracker to relevant iroha tests. Fixes #1260 Signed-off-by: ashnashahgrover <[email protected]>
- Loading branch information
1 parent
fdce6b3
commit 44b7c44
Showing
15 changed files
with
392 additions
and
3 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
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
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
10 changes: 10 additions & 0 deletions
10
...us-plugin-ledger-connector-iroha2/src/main/typescript/prometheus-exporter/data-fetcher.ts
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,10 @@ | ||
import { Transactions } from "./response.type"; | ||
|
||
import { totalTxCount, K_CACTUS_IROHA2_TOTAL_TX_COUNT } from "./metrics"; | ||
|
||
export async function collectMetrics( | ||
transactions: Transactions, | ||
): Promise<void> { | ||
transactions.counter++; | ||
totalTxCount.labels(K_CACTUS_IROHA2_TOTAL_TX_COUNT).set(transactions.counter); | ||
} |
10 changes: 10 additions & 0 deletions
10
.../cactus-plugin-ledger-connector-iroha2/src/main/typescript/prometheus-exporter/metrics.ts
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,10 @@ | ||
import { Gauge } from "prom-client"; | ||
|
||
export const K_CACTUS_IROHA2_TOTAL_TX_COUNT = "cactus_iroha2_total_tx_count"; | ||
|
||
export const totalTxCount = new Gauge({ | ||
registers: [], | ||
name: "cactus_iroha2_total_tx_count", | ||
help: "Total transactions executed", | ||
labelNames: ["type"], | ||
}); |
Oops, something went wrong.