Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API endpoint for Peer Monitor metrics #449

Closed
2 of 4 tasks
hsanjuan opened this issue Jun 1, 2018 · 0 comments
Closed
2 of 4 tasks

API endpoint for Peer Monitor metrics #449

hsanjuan opened this issue Jun 1, 2018 · 0 comments
Assignees
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P2 Medium: Good to have, but can wait until someone steps up

Comments

@hsanjuan
Copy link
Collaborator

hsanjuan commented Jun 1, 2018

Basic information

  • Type (mark as appropiate):
    • Bug
    • Feature request
    • Enhancement

Description

The Peer Monitor collects metrics and stores them by type and by peer.

type PeerMonitor interface {
        Component
        // LogMetric stores a metric. It can be used to manually inject
        // a metric to a monitor.
        LogMetric(api.Metric) error
        // PublishMetric sends a metric to the rest of the peers.
        // How to send it, and to who, is to be decided by the implementation.
        PublishMetric(api.Metric) error
        // LatestMetrics returns a map with the latest metrics of matching name
        // for the current cluster peers.
        LatestMetrics(name string) []api.Metric
        // Alerts delivers alerts generated when this peer monitor detects
        // a problem (i.e. metrics not arriving as expected). Alerts can be used
        // to trigger self-healing measures or re-pinnings of content.
        Alerts() <-chan api.Alert
}

The information from LatestMetrics() should be inspectable by the user through the rest api.

This implies:

  • Coming up with the right restful endpoint (GET /health/metrics/<name>)
  • Implement it in the api/rest component (the metrics can be requested via RPC request to PeerMonitorLatestMetrics)
  • Support the new endpoint in rest/api/client
  • Support the new method in ipfs-cluster-ctl. i.e. ipfs-cluster-ctl health metrics <name> would show the peers and the last list of metrics logged for each as returned by the Peer Monitor, in a friendly way.
@hsanjuan hsanjuan added help wanted Seeking public contribution on this issue exp/novice Someone with a little familiarity can pick up status/ready Ready to be worked P2 Medium: Good to have, but can wait until someone steps up kind/enhancement A net-new feature or improvement to an existing feature labels Jun 1, 2018
kishansagathiya added a commit to kishansagathiya/ipfs-cluster that referenced this issue Oct 7, 2018
Opened new endpoint `GET /health/metrics/<name>` which would respond
with metrics of type <name>

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
@ghost ghost assigned kishansagathiya Oct 7, 2018
@ghost ghost added status/in-progress In progress and removed status/ready Ready to be worked labels Oct 7, 2018
kishansagathiya added a commit to kishansagathiya/ipfs-cluster that referenced this issue Oct 7, 2018
Support the new endpoint for later metrics in `rest/api/client`

Support the new method created in `rest/api/client` in
ipfs-cluster-ctl. i.e. `ipfs-cluster-ctl health metrics <name>` would
show the peers and the last list of metrics logged for each as returned
by the Peer Monitor, in a friendly way.

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
kishansagathiya added a commit to kishansagathiya/ipfs-cluster that referenced this issue Oct 21, 2018
Rename method PeerMonitorLatestMetrics to Metrics
Addressing first round of comment as in
ipfs-cluster#572 (review)

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
kishansagathiya added a commit to kishansagathiya/ipfs-cluster that referenced this issue Oct 21, 2018
Opened new endpoint `GET /health/metrics/<name>` which would respond
with metrics of type <name>

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
kishansagathiya added a commit to kishansagathiya/ipfs-cluster that referenced this issue Oct 21, 2018
Support the new endpoint for later metrics in `rest/api/client`

Support the new method created in `rest/api/client` in
ipfs-cluster-ctl. i.e. `ipfs-cluster-ctl health metrics <name>` would
show the peers and the last list of metrics logged for each as returned
by the Peer Monitor, in a friendly way.

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
kishansagathiya added a commit to kishansagathiya/ipfs-cluster that referenced this issue Oct 21, 2018
Rename method PeerMonitorLatestMetrics to Metrics
Addressing first round of comment as in
ipfs-cluster#572 (review)

License: MIT
Signed-off-by: Kishan Mohanbhai Sagathiya <kishansagathiya@gmail.com>
@hsanjuan hsanjuan mentioned this issue Oct 22, 2018
hsanjuan added a commit that referenced this issue Oct 22, 2018
Issue #449 API endpoint for Peer Monitor metrics
@ghost ghost removed the status/in-progress In progress label Oct 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P2 Medium: Good to have, but can wait until someone steps up
Projects
None yet
Development

No branches or pull requests

2 participants