Coder Social home page Coder Social logo

Comments (3)

toni-moreno avatar toni-moreno commented on June 6, 2024

We can Add a metric type STRINGPARSER, this new type will need 2 extra data.

  1. A Regex with capturing groups
  2. A capturing group MAP with declaration of data type per group

Example:

We can extract data from this string

FAN 1: 8725 RPM

with this regex

^([^:*]*)*: *([0-9]*)* *RPM

And we will get 2 values

a) FAN 1
b) 8725

Now we need to map these to values as fields or tags , by example

TAG["fan_number"];FIELD["GAUGE"]

from snmpcollector.

toni-moreno avatar toni-moreno commented on June 6, 2024

In the above case there is not a really need to add a new tag , in that case the measurement will be..

Measurement: Temp => Fields [ "cpu","sys" ]
Measurement: RPMFan => Fields ["fan1","fan2","fan3","fan4" ,"fan5"]

Both cases has no sense add fan_number as TAG, also each tag will be added to complete measurement. So adding tags at metric("field") level is dangerous.

Taking all these considerations I will remove the TAG option per metric.

In the same way I have doubts about needs of more than one Fields defined in each metric, since a snmpcollector metric is indeed a single field.

Finally the STRINGPARSER metric will have 2 options

1.- REGEXP with only one capturing group for the final value
2.- VALUE TYPE

by example in the above examples

a) for FAN X

REGEXP = ".*: *([0-9]*)* *RPM"
VALUE=INTEGER

b) for TEMP

REGEXP = "[^+]*\+([.0-9]*).*"
VALUE=FLOAT

from snmpcollector.

toni-moreno avatar toni-moreno commented on June 6, 2024

Thinking a littler more.

Snmpcollector always send numeric data as Floating point numbers. so It is not need to configure the type. We will assume it will be or INTEGER or FLOAT and both will be automatically converted to float.

The only configuration parameter needed is REGEXP !!!

from snmpcollector.

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.