-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(corda): prometheus exporter metrics integration
Primary Change --- 1. The corda ledger connector plugin now includes the prometheus metrics exporter integration 2. OpenAPI spec now has api endpoint for getting the prometheus metrics Refactorings that were also necessary to incorporate 1) and 2) ------ 3. GetPrometheusMetricsV1 class is created to handle the corresponding api endpoint 4. IPluginLedgerConnectorCordaOptions interface in PluginLedgerConnectorCorda class now has a prometheusExporter object optional field 5. The PluginLedgerConnectorCorda class has relevant functions to incorporate prometheus exporter 6. Updated Readme.md about the prometheus exporter 7. Updated the test case located at packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/deploy-cordapp-jars-to-nodes.test.ts 8. Updated the OpenAPI spec file to have run-transaction endpoint which currently returns NOT_IMPLEMENTED with 501 code. Resolve #535 Signed-off-by: Jagpreet Singh Sasan <[email protected]>
- Loading branch information
1 parent
ada532e
commit 9f37755
Showing
15 changed files
with
551 additions
and
2 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-corda/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
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
...tus-plugin-ledger-connector-corda/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, K_CACTUS_CORDA_TOTAL_TX_COUNT } from "./metrics"; | ||
|
||
export async function collectMetrics(transactions: Transactions) { | ||
totalTxCount.labels(K_CACTUS_CORDA_TOTAL_TX_COUNT).set(transactions.counter); | ||
} |
9 changes: 9 additions & 0 deletions
9
...s/cactus-plugin-ledger-connector-corda/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,9 @@ | ||
import { Gauge } from "prom-client"; | ||
|
||
export const K_CACTUS_CORDA_TOTAL_TX_COUNT = "cactus_corda_total_tx_count"; | ||
|
||
export const totalTxCount = new Gauge({ | ||
name: K_CACTUS_CORDA_TOTAL_TX_COUNT, | ||
help: "Total transactions executed", | ||
labelNames: ["type"], | ||
}); |
Oops, something went wrong.