Giter VIP home page Giter VIP logo

Comments (3)

SuperQ avatar SuperQ commented on June 16, 2024 1

I think it's something we could do in code, but it would need to be generic enough to work with other MIBs.

I don't have time to implement this, but PRs would be welcome.

from snmp_exporter.

SuperQ avatar SuperQ commented on June 16, 2024

We just recently added a scale configuration option to the code. In theory, we could have an override that looks up the scale factor from another OID.

from snmp_exporter.

lukeyeager avatar lukeyeager commented on June 16, 2024

My workaround is not too bad. The downsides are that it moves some logic into prometheus' recording rules and that it adds a little too much data to the database that I don't really want.

generator.yml

modules:
  entity-physical-sensors:
    walk:
      - entPhysicalIndex
      - entPhysicalDescr
      - entPhySensorScale
      - entPhySensorPrecision
      - entPhySensorValue
    lookups:
      - source_indexes: [entPhysicalIndex]
        lookup: entPhysicalDescr
    overrides:
      entPhysicalIndex: {ignore: true}
      entPhysicalDescr: {ignore: true}

prometheus/rules-recording.yml

groups:
  - name: snmp-exporter
    rules:
      - record: entPhySensorValueScaled
        expr: entPhySensorValue * 10 ^ (3 * (entPhySensorScale - 9) - entPhySensorPrecision)

@SuperQ yes, I noticed that new static field. But I would need something to handle the formula valueScaled = value * 10 ^ (3 * (scale - 9) - precision). You do a static scale, but I would need to be able to compose add, subtract, multiply, and pow. Which is a lot of new functionality. That, or add a special case for entPhySensorTable.

I'm content with a "no, that's out of scope." But I thought I'd ask just in case.

from snmp_exporter.

Related Issues (20)

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.