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

ping_loss_ratio averaging concern/question. #93

Open
Randommmm opened this issue Nov 6, 2023 · 2 comments
Open

ping_loss_ratio averaging concern/question. #93

Randommmm opened this issue Nov 6, 2023 · 2 comments

Comments

@Randommmm
Copy link

Randommmm commented Nov 6, 2023

Hi all,

I'm running a configuration which uses ping_exporter to query a range of services (primarily devices within our network and VoIP phone provider) for packet loss via the ping_loss_ratio metric.

We've had packet loss issues for a while now, although the data I am getting into Prometheus (and then Grafana) seems to be slightly incorrect.

I notice the packet loss numbers seems very simalir, for example, I only seem to be getting data values of 2.38%, 4.76% 7.14%, 9.52%, etc. These numbers are NOT random, they seem to be averaged somehow. For example, 2.38 * 2 = 4.76, 4.76 * 2 = 9.52, they seem to be multiples somehow. This data is represented within both Grafana and Promethues.

Screenshot 2023-11-06 at 9 59 43 AM Screenshot 2023-11-06 at 10 00 09 AM

I use the following settings within the prometheus.yml file.

- job_name: ping_exporter
  honor_timestamps: true
  scrape_interval: 1s
  scrape_timeout: 1s
  metrics_path: /metrics
  scheme: http
  follow_redirects: true
  enable_http2: true
  static_configs:
  - targets:
    - 10.20.60.11:9427

What could I be doing wrong to get somewhat malformed data?

Cheers,
Randommmm,

@rnyrnyrny
Copy link

rnyrnyrny commented Dec 29, 2023

I was also confused about this. In my case the loss value is always 3.33%, 6.66% etc. Then I took a look at the code and found out it's related to history-size. Basically the loss value is calculated via lost packets / history size. I set history-size to 30 so when a packet is lost the loss ratio becomes 3.33%. Check the code here: https://github.com/digineo/go-ping/blob/bc50d4a3e1022217d5fb9b0c9399efed5b4b2261/monitor/history.go#L67C24-L67C24

@evevseev
Copy link

evevseev commented Jun 7, 2024

Does not seem to be in issue, as this values indeed should correlate with history-size.

@czerwonk, I guess this issues should be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants