forked from hyperledger-cacti/cacti
-
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.
Primary Change -------------- 1. The besu ledger connector plugin now includes the prometheus metrics exporter integration 2. OpenAPI spec now has api endpoint for the getting the prometheus metrics Refactorings that were also necessary to accomodate 1) and 2) ------------------------------------------------------------ 3. GetPrometheusMetricsV1 class is created to handle the corresponding api endpoint 4. IPluginLedgerConnectorBesuOptions interface in PluginLedgerConnectorBesu class now has a prometheusExporter optional field 5. The PluginLedgerConnectorBesu class has relevant functions and codes to incorporate prometheus exporter 6. deploy-contract-from-json.test.ts is changed to incorporate the prometheus exporter 7. Added Readme.md on the prometheus exporter usage Fixes hyperledger-cacti#533 Signed-off-by: Jagpreet Singh Sasan <jagpreet.singh.sasan@accenture.com>
- Loading branch information
1 parent
aa070ad
commit 274817d
Showing
15 changed files
with
397 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
21 changes: 21 additions & 0 deletions
21
packages/cactus-plugin-ledger-connector-besu/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
7 changes: 7 additions & 0 deletions
7
...ctus-plugin-ledger-connector-besu/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,7 @@ | ||
import { Transactions } from "./response.type"; | ||
|
||
import { totalTxCount } from "./metrics"; | ||
|
||
export async function collectMetrics(transactions: Transactions) { | ||
totalTxCount.labels("cactus_besu_total_tx_count").set(transactions.counter); | ||
} |
7 changes: 7 additions & 0 deletions
7
...es/cactus-plugin-ledger-connector-besu/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,7 @@ | ||
import { Gauge } from "prom-client"; | ||
|
||
export const totalTxCount = new Gauge({ | ||
name: "cactus_besu_total_tx_count", | ||
help: "Total transactions executed", | ||
labelNames: ["type"], | ||
}); |
Oops, something went wrong.