zehome / MLVPN

Multi-link VPN (ADSL/SDSL/xDSL/Network aggregation / bonding)
http://www.mlvpn.fr/
BSD 2-Clause "Simplified" License
518 stars 127 forks source link

Add a /metrics end point for https://prometheus.io #81

Closed stapelberg closed 4 years ago

stapelberg commented 8 years ago

For details on the text format expected by Prometheus, see https://prometheus.io/docs/instrumenting/exposition_formats/#text-format-details

stapelberg commented 8 years ago

This is how the resulting data could look like when graphed using http://grafana.org/:

2016-07-28-220854_2481x573_scrot

markfoodyburton commented 8 years ago

I'd LOVE to see this feature, I've yet to work out a way of providing exactly this information. However, if it is going to be in the code, it would be really helpful if you could add some documentation and/or an example?

Cheers Mark.

stapelberg commented 8 years ago

@markfoodyburton It sounds like you haven’t used Prometheus and/or Grafana before. Please read up on their respective docs and get a target monitored (e.g. Prometheus’s node_exporter). There are also numerous tutorials available on how to use either of the two.

Afterwards, all you need to do is point Prometheus at mlvpn’s /metrics endpoint on the control port (similar to the existing /status endpoint) and configure the metrics you’d like to see in a Grafana dashboard.

Does that help?

markfoodyburton commented 8 years ago

Probably :-)))

zehome commented 8 years ago

Thank you for your patch, i've seen it but on holidays, I'm going to work on it as soon as possible.

zehome commented 8 years ago

Can you mention rename /metrics to /prometheus and mention it in the documentation ?

stapelberg commented 8 years ago

The /metrics path is the default as per https://prometheus.io/docs/operating/configuration/#:

# The HTTP resource path on which to fetch metrics from targets.
[ metrics_path: <path> | default = /metrics ]

Hence, it’d be more idiomatic to keep it at /metrics. Of course, you have the final say — should we keep it idiomatic or should I rename it?