Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Daemon monitoring + Dockerfile #913

Merged
merged 11 commits into from
Aug 31, 2017
Merged

Daemon monitoring + Dockerfile #913

merged 11 commits into from
Aug 31, 2017

Conversation

victorb
Copy link
Member

@victorb victorb commented Jul 17, 2017

Sets up collectors which exposes metrics at $API/debug/metrics/prometheus (as in go-ipfs) that can be consumed by Prometheus.

Ref: #804

@victorb victorb requested a review from daviddias July 17, 2017 16:25
@victorb victorb added the status/in-progress In progress label Jul 17, 2017
const api = server.select('API')
const gauge = new client.Gauge({ name: 'number_of_peers', help: 'the_number_of_currently_connected_peers' })

setInterval(() => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this approach. Guess we have two options, 1) (which is implemented here) is to once every X seconds, check the number of peers and save it or 2) when a request happens at /debug/metrics/prometheus, then check the number of peers and respond.

@diasdavid what you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's calculate per request

@victorb
Copy link
Member Author

victorb commented Jul 17, 2017

Missing:

  • Use webrtc-star by installing it globally
  • Information about the endpoint in the documentation somewhere

// Setup debug metrics collection
const collectDefaultMetrics = prometheusClient.collectDefaultMetrics
collectDefaultMetrics({ timeout: 5000 })
prometheusGcStats(prometheusClient.register)()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that every js-ipfs node will "phone home"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diasdavid "phone home" as in send the data somewhere? No, it'll only be in the local node, available to collect when hitting the endpoint. The data is not sent somewhere.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it. Still, we should not add stuff that is not necessary by default. Can these be in a separate file that doesn't get loaded unless a env var is set?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that makes sense, although it makes the usage different from go-ipfs who exposes it by default. But that makes sense, I'll move the dependencies to optionalDependencies as well then.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! :)

const api = server.select('API')
const gauge = new client.Gauge({ name: 'number_of_peers', help: 'the_number_of_currently_connected_peers' })

setInterval(() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's calculate per request

@daviddias
Copy link
Member

daviddias commented Aug 26, 2017

@victorbjelkholm how close are we from this? Any update?

@victorb
Copy link
Member Author

victorb commented Aug 30, 2017

@diasdavid just resolved a conflict, once CI is passing, is ready to be merged 👍

@daviddias
Copy link
Member

rebase master onto this branch. it will solve the issues you are seeing.

Copy link
Member

@daviddias daviddias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it deployed? How can I see some metrics already?

@daviddias
Copy link
Member

With the work of @harshjv and @ya7ya, we will have a gateway as well and from what I've discussed with Lars, we will be running some gateways as js-ipfs nodes for testing :)

@daviddias daviddias merged commit 8f0254e into master Aug 31, 2017
@daviddias daviddias deleted the daemon-monitoring branch August 31, 2017 10:51
MicrowaveDev pushed a commit to galtproject/js-ipfs that referenced this pull request May 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants