A migration guide for refactoring your application code from libp2p v0.40.x to v0.41.0.
libp2p no longer ships a built-in metrics object, allowing the user to configure an implemnetation of their choice or not at all.
Currently an implementation exists for Prometheus/Graphana, others may follow.
Before
import { createLibp2p } from 'libp2p'
const node = await createLibp2p({
metrics: {
enabled: true,
// ... other options
}
})
After
import { createLibp2p } from 'libp2p'
import { prometheusMetrics } from '@libp2p/prometheus-metrics'
const node = await createLibp2p({
metrics: prometheusMetrics()
})