Skip to content

Commit

Permalink
feat(besu): add prometheus exporter
Browse files Browse the repository at this point in the history
	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#533

Signed-off-by: Jagpreet Singh Sasan <jagpreet.singh.sasan@accenture.com>
  • Loading branch information
jagpreetsinghsasan committed Mar 10, 2021
1 parent 274817d commit 0a5b843
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ export class PrometheusExporter {
}

public startMetricsCollection(): void {
promClient.collectDefaultMetrics();
const Registry = promClient.Registry;
const register = new Registry();
promClient.collectDefaultMetrics({ register });
}
}

0 comments on commit 0a5b843

Please sign in to comment.