Git Product home page Git Product logo

hg612-exporter's People

Contributors

dnwe avatar jakekeeys avatar thomasdstewart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hg612-exporter's Issues

The `dsl_status` gauge latches any status it finds to 1

It looks like in the collect() loop the dsl_status gauge is latched to 1 with the current status label set

c.status.WithLabelValues(
    c.host, c.identifier, status.DSLCfg.Status, status.DSLCfg.Modulation, status.DSLCfg.DataPath).Set(1)

However, this means that all historically seen statuses are latched to 1 and never reset:

# HELP dsl_status
# TYPE dsl_status gauge
dsl_status{dataPath="",host="192.168.2.1",identifier="BT",modulation="",status="EstablishingLink"} 1
dsl_status{dataPath="",host="192.168.2.1",identifier="BT",modulation="",status="Initializing"} 1
dsl_status{dataPath="",host="192.168.2.1",identifier="BT",modulation="",status="NoSignal"} 1

Ideally in the collect() loop it would loop over all known status values and set them to 0 for the ongoing publishes. Alternatively I think you could call .Reset() on the gauge before you call your .Set(1) and that would stop publishing the metric for the old statuses

Breaks on Arm 32bit

Hi,

When running this on a Raspberry Pi running armhf, eg arm 32bit it breaks, with errors such as:

time="2022-10-24T23:50:51Z" level=error msg="error collecting dsl metrics: error getting dsl status: error converting numeric dsl stats value: strconv.Atoi: parsing "4294967290": value out of range"

It seems that strconv.Atoi returns an int, which is a platform dependent type, eg int32 on 32bit platforms and int64 on 64bit platforms. My modem has quite a few Upstream HEC errors (which I hope are from it's previous owner's setup or it could just be the odd webui: https://forum.kitz.co.uk/index.php?topic=16562.0):

WANDSLInterfaceConfig.Stats.Showtime","154","4294967290"

In my case 4,294,967,290 (but int32 maxes out at: 2,147,483,647), hence it can't store the value.

Hacking the code use int64 types seems to get it working.

Kind Regards
Tom

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.