Giter VIP home page Giter VIP logo

Comments (14)

dmitry-ee avatar dmitry-ee commented on August 24, 2024 2

@stephan2012 just released version 0.0.5.
Also tested the new version against versions 2.2.1, 3.1, 4.1 of chrony.
New _sourcestats_ block is present across all of them

from time_exporter.

stephan2012 avatar stephan2012 commented on August 24, 2024 1

Hi @dmitry-ee,
not at all! 😉 Please go ahead and close this issue.

The modified exporter works flawlessly so far and helped already to find some weired NTP server behavior.

Thanks again for your help!

from time_exporter.

dmitry-ee avatar dmitry-ee commented on August 24, 2024

Hi @stephan2012!
Thanks for submitting the issue, i'll take a look on this once have a time.
I'm going to upgrade underlying library for chrony communication.

This is what you can get if you run exporter with --collector.chrony.log-response-json --log.level=debug flags:

"0":{
"Configured":true,
"AuthPossible":false,
"Authentic":false,
"Reachable":false,
"Broadcast":false,
"Selection":3,
"Condition":"outlier",
"SRCAdr":"2001:67c:1560:8003::c7",
"SRCPort":0,
"DSTAdr":"",
"DSTPort":0,
"Leap":0,
"Stratum":2,
"Precision":0,
"RootDelay":0,
"RootDisp":0,
"RefID":"",
"RefTime":"",
"Reach":223,
"Unreach":0,
"HMode":0,
"PMode":0,
"HPoll":7,
"PPoll":7,
"Headway":0,
"Flash":0,
"Flashers":[],
"Offset":1.9691239576786757,
"Delay":0,
"Dispersion":0,
"Jitter":0,
"Xleave":0,
"Rec":"",
"FiltDelay":"",
"FiltOffset":"",
"FiltDisp":""
},

(note that only Offset metric has a float value).
This data is mapping directly into chrony_sources_* metrics on as-is basis.
That can explain why you are not seeing error in the output.

from time_exporter.

stephan2012 avatar stephan2012 commented on August 24, 2024

Thanks for your feedback, @dmitry-ee. Looks like either chronyd or the library do not deliver the data:

{
  "Peers": {
    "0": {
      "Configured": true,
      "AuthPossible": false,
      "Authentic": false,
      "Reachable": true,
      "Broadcast": false,
      "Selection": 6,
      "Condition": "sync",
      "SRCAdr": "80.72.67.48",
      "SRCPort": 0,
      "DSTAdr": "",
      "DSTPort": 0,
      "Leap": 0,
      "Stratum": 0,
      "Precision": 0,
      "RootDelay": 0,
      "RootDisp": 0,
      "RefID": "",
      "RefTime": "",
      "Reach": 255,
      "Unreach": 0,
      "HMode": 0,
      "PMode": 0,
      "HPoll": 2,
      "PPoll": 2,
      "Headway": 0,
      "Flash": 0,
      "Flashers": [
        "pkt_bogus",
        "pkt_invalid",
        "pkt_stratum",
        "pkt_dup",
        "pkt_header",
        "tst_max_delay",
        "tst_delay_ratio",
        "tst_delay_dev_ration",
        "tst_sync_loop",
        "pkt_auth"
      ],
      "Offset": 8.45454095621534e-07,
      "Delay": 0,
      "Dispersion": 0,
      "Jitter": 0,
      "Xleave": 0,
      "Rec": "",
      "FiltDelay": "",
      "FiltOffset": "",
      "FiltDisp": ""
    }
  },
  "ServerStats": null,
  "Incomplete": true
}

The Incomplete key with value true is a bit irritating.

from time_exporter.

stephan2012 avatar stephan2012 commented on August 24, 2024

I have tested a bit more. No additional data for Chrony 3.2 (Ubuntu 18.04.6 LTS), Chrony 4.0 (Debian 10 backport), Chrony 4.1 (Debian 11). Also, with all tested versions, timeout when using the Unix socket. In all cases, chronyc works with both, the Unix and UDP socket.

So maybe it is really the underlying library?

from time_exporter.

dmitry-ee avatar dmitry-ee commented on August 24, 2024

Just checked the connection via socket, and indeed, it's not working at all.
Trying to identify the issue cause

from time_exporter.

dmitry-ee avatar dmitry-ee commented on August 24, 2024

@stephan2012 i'm still struggling with fixing the connectivity via socket, but i had a time to look on the original issue (missing peer stats).
It revealed that such stats are available through the socket only (ironic!), that's why you are getting Incomplete: true
But anyway, i've found that chrony introduced sourcestats command since some version and i decided to implement it to work out the topic issue.

Cmd response

Name/IP Address            NP  NR  Span  Frequency  Freq Skew  Offset  Std Dev
==============================================================================
rnis-app.rnis66.ru          6   3   323   +227.667   1633.529    +21ms    56ms
time100.stupi.se            6   3   322   +344.400   1776.344    +32ms    49ms
tock.ntp.infomaniak.ch      6   3   325   +294.565   1687.531    +17ms    51ms
120.25.115.20               6   3   455    +33.635   1261.744    -28ms    47ms

Exporter output

time_chrony_sourcestats_estimate_offset{addr="120.25.115.20"} -2.847197465598583e-05
time_chrony_sourcestats_estimate_offset{addr="185.68.101.10"} 2.0045215263962744e-05
time_chrony_sourcestats_estimate_offset{addr="192.36.143.130"} 3.113795630633831e-05
time_chrony_sourcestats_estimate_offset{addr="84.16.67.12"} 1.6098424792289734e-05
time_chrony_sourcestats_estimate_offset_error{addr="120.25.115.20"} 0.00023137173056602477
time_chrony_sourcestats_estimate_offset_error{addr="185.68.101.10"} 0.00016080985963344574
time_chrony_sourcestats_estimate_offset_error{addr="192.36.143.130"} 0.00012096861749887466
time_chrony_sourcestats_estimate_offset_error{addr="84.16.67.12"} 0.00013551415503025054
time_chrony_sourcestats_nruns{addr="120.25.115.20"} 3
time_chrony_sourcestats_nruns{addr="185.68.101.10"} 3
time_chrony_sourcestats_nruns{addr="192.36.143.130"} 3
time_chrony_sourcestats_nruns{addr="84.16.67.12"} 3
time_chrony_sourcestats_nsamples{addr="120.25.115.20"} 6
time_chrony_sourcestats_nsamples{addr="185.68.101.10"} 6
time_chrony_sourcestats_nsamples{addr="192.36.143.130"} 6
time_chrony_sourcestats_nsamples{addr="84.16.67.12"} 6
time_chrony_sourcestats_residential_freq{addr="120.25.115.20"} 33.63453674316406
time_chrony_sourcestats_residential_freq{addr="185.68.101.10"} 227.6665802001953
time_chrony_sourcestats_residential_freq{addr="192.36.143.130"} 344.4002990722656
time_chrony_sourcestats_residential_freq{addr="84.16.67.12"} 294.56451416015625
time_chrony_sourcestats_skew_freq{addr="120.25.115.20"} 1261.744140625
time_chrony_sourcestats_skew_freq{addr="185.68.101.10"} 1633.52880859375
time_chrony_sourcestats_skew_freq{addr="192.36.143.130"} 1776.344482421875
time_chrony_sourcestats_skew_freq{addr="84.16.67.12"} 1687.531005859375
time_chrony_sourcestats_span_seconds{addr="120.25.115.20"} 455
time_chrony_sourcestats_span_seconds{addr="185.68.101.10"} 323
time_chrony_sourcestats_span_seconds{addr="192.36.143.130"} 322
time_chrony_sourcestats_span_seconds{addr="84.16.67.12"} 325
time_chrony_sourcestats_std_dev{addr="120.25.115.20"} 4.6780869364738465e-05
time_chrony_sourcestats_std_dev{addr="185.68.101.10"} 5.559420585632324e-05
time_chrony_sourcestats_std_dev{addr="192.36.143.130"} 4.904985800385475e-05
time_chrony_sourcestats_std_dev{addr="84.16.67.12"} 5.123323202133179e-05

I think that's the values you are looking for

from time_exporter.

stephan2012 avatar stephan2012 commented on August 24, 2024

Sounds good! I am happy to test a new version. :-)

from time_exporter.

stephan2012 avatar stephan2012 commented on August 24, 2024

Thanks @dmitry-ee! Will check soon and provide feedback.

from time_exporter.

stephan2012 avatar stephan2012 commented on August 24, 2024

Not really absolutely sure, but maybe time_chrony_sourcestats_est_offset_error_seconds is off by factor 1000?

The chrony json reports

"EstOffsetError": 4.632525474335125e-08

but Time Exporter reports metric

time_chrony_sourcestats_est_offset_error_seconds{addr="80.72.67.48"} 4.112834517400188e-11

from time_exporter.

dmitry-ee avatar dmitry-ee commented on August 24, 2024

@stephan2012 you are absolutely right, thanks for noting!
Other than _sourcestats_ metrics are converting to ms, see here compared to sourcestats reply parsing

Reuploaded the version 0.0.5, please check

from time_exporter.

stephan2012 avatar stephan2012 commented on August 24, 2024

Thank you, @dmitry-ee! On the first glance, it looks like the numbers are good now.

from time_exporter.

dmitry-ee avatar dmitry-ee commented on August 24, 2024

Hi @stephan2012 !
Do you mind if i close this issue?

from time_exporter.

dmitry-ee avatar dmitry-ee commented on August 24, 2024

@stephan2012 good to hear that!
I'll return to your PR after the holidays

from time_exporter.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.