问题
We have new relic’s agent to our configuration to get exposure and understand the configuration and capture of JMX metrics. Our CorDapp new shows up under our new relic account. However, the only metrics being captured and displayed are general and related to the JVM.
The only source file including the @MXBean annotation is HibernateStatistics.
I see under master that there is more details around metrics and monitoring.
I assume that the additional metric capture did not happen until after V3.1.
I am just looking to confirm that we are not overlooking something and metrics should actually for flows and transactions.
回答1:
In Corda 3.1, the only Corda-specific metrics exposed are:
- The number of attachments (
net.corda:name=Attachments
) - The flow checkpointing rate (
net.corda:type=Flows,name=Checkpointing Rate
) - The number of started flows (
net.corda:type=Flows,name=Started
) - The number of in-flight flows (
net.corda:type=Flows,name=InFlight
) - The number of finished flows (
net.corda:type=Flows,name=Finished
)
Apache Artemis metrics are also exposed. The list of exposed metrics can be found here: https://docs.corda.net/node-administration.html#monitoring-your-node. As you note, future versions of Corda will expand this list of metrics.
The flow metrics are registered when the node's StateMachineManager
is instantiated in StateMachineManagerImpl.kt, as follows:
// Monitoring support.
private val metrics = serviceHub.monitoringService.metrics
init {
metrics.register("Flows.InFlight", Gauge<Int> { mutex.content.stateMachines.size })
}
private val checkpointingMeter = metrics.meter("Flows.Checkpointing Rate")
private val totalStartedFlows = metrics.counter("Flows.Started")
private val totalFinishedFlows = metrics.counter("Flows.Finished")
来源:https://stackoverflow.com/questions/51087910/jmx-metrics-and-new-relic