Skip to content

Commit

Permalink
fix: update libp2p config and collect libp2p metrics (#68)
Browse files Browse the repository at this point in the history
Updates the default custom libp2p config to enable missing transports,
configure the DHT correctly and to collect prometheus metrics along
with the default fastify ones.
  • Loading branch information
achingbrain authored Mar 14, 2024
1 parent 6503b62 commit 6dfa99f
Show file tree
Hide file tree
Showing 4 changed files with 4,120 additions and 7,940 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,19 @@ $ npm run test:e2e-doctor # Run the dev server with clinicjs doctor, execute e2e
$ npm run test:e2e-flame # Run the dev server with clinicjs flame, execute e2e tests, and generate a report.
```

## Metrics

Running with `METRICS=true` will enable collecting Fastify/libp2p metrics and
will expose a prometheus collection endpoint at http://localhost:8080/metrics

### prom-client version

To collect both Fastify and libp2p metrics, the same version of [prom-client](https://www.npmjs.com/package/prom-client)
must be used by both systems. At the time of writing `fastify-metrics` uses
`prom-client` 14.x and `@libp2p/prometheus-metrics` uses 15.x so it's necessary
to add a `overrides` section to `package.json` here to ensure they use the same
version.

## Author

- [whizzzkid](https://github.com/whizzzkid)
Loading

0 comments on commit 6dfa99f

Please sign in to comment.