forked from hyperledger-cacti/cacti
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(fabric): prometheus exporter metrics naming
Primary Change -------------- 1. Change the cactus_fabric_total_tx_count metric name to be fetched from a variable 2. Update the same in the test cases Signed-off-by: Jagpreet Singh Sasan <jagpreet.singh.sasan@accenture.com>
- Loading branch information
1 parent
932d5a4
commit a28edcf
Showing
5 changed files
with
30 additions
and
13 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
...us-plugin-ledger-connector-fabric/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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { Transactions } from "./response.type"; | ||
|
||
import { totalTxCount } from "./metrics"; | ||
import { totalTxCount, K_CACTUS_FABRIC_TOTAL_TX_COUNT } from "./metrics"; | ||
|
||
export async function collectMetrics(transactions: Transactions) { | ||
totalTxCount.labels("cactus_fabric_total_tx_count").set(transactions.counter); | ||
totalTxCount.labels(K_CACTUS_FABRIC_TOTAL_TX_COUNT).set(transactions.counter); | ||
} |
4 changes: 3 additions & 1 deletion
4
.../cactus-plugin-ledger-connector-fabric/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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import { Gauge } from "prom-client"; | ||
|
||
export const K_CACTUS_FABRIC_TOTAL_TX_COUNT = "cactus_fabric_total_tx_count"; | ||
|
||
export const totalTxCount = new Gauge({ | ||
name: "cactus_fabric_total_tx_count", | ||
name: K_CACTUS_FABRIC_TOTAL_TX_COUNT, | ||
help: "Total transactions executed", | ||
labelNames: ["type"], | ||
}); |
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