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

Add support for parsing/transforming string metrics #372

Open
HontoNoRoger opened this issue Aug 26, 2021 · 0 comments
Open

Add support for parsing/transforming string metrics #372

HontoNoRoger opened this issue Aug 26, 2021 · 0 comments

Comments

@HontoNoRoger
Copy link

I'm monitoring Solr via JMX and want to get the metric attribute total_size of the fieldCache solr:dom1=core,dom2=myawesomecore,category=CACHE,scope=core,name=fieldCache into Datadog.

Unfortunately this metric is pushed as java.lang.String in the form of 4.5 MB.
Currently, JMXFetch is unable to transform that in a numeric value, which I could use to set the unit to "MB" if it would at least be able to get the "4.5" part.

According to the tests, JMXFetch can be set to take predefined values for String fields, such as:

values:
  ShouldBe0: 0
  ShouldBe5: 5

but that is not sufficient in this case unfortunately as the values the metric can take are possibly limitless.

It would be great if one could specify arbitrary parsings/transformations to the fetcher before sending the end result to Datadog.
One option might be to transform "4.5 MB" to 4718592 (a Byte value based on IEC Mebibytes), 4500000 (a Byte value based on SI units) or only 4.5 which one can use in conjunction with choosing the correct unit.
The last option however is dangerous, as the metric might push something "1.2 GB" or "553 KB" in theory.

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

No branches or pull requests

2 participants