# Migrating to libp2p@41 <!-- omit in toc -->

A migration guide for refactoring your application code from libp2p v0.40.x to v0.41.0.

## Table of Contents <!-- omit in toc -->

- [Metrics](#metrics)

## Metrics

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](https://www.npmjs.com/package/@libp2p/prometheus-metrics) exists for [Prometheus](https://prometheus.io/)/[Graphana](https://grafana.com/), others may follow.

**Before**

```js
import { createLibp2p } from 'libp2p'

const node = await createLibp2p({
  metrics: {
    enabled: true,
    // ... other options
  }
})
```

**After**

```js
import { createLibp2p } from 'libp2p'
import { prometheusMetrics } from '@libp2p/prometheus-metrics'

const node = await createLibp2p({
  metrics: prometheusMetrics()
})
```
