VMware Cloud Community
jtataGP
Contributor
Contributor

Any way to collect non-numeric values as metric?

I've created a SQL Query plugin to try and pull some information out of certain of our database servers. Most of the metrics seem to be working as intended, but one of the more important ones is returns an error NullPointerException: null when testing the plugin.

I think the issues is that this particular query is trying to pull a field containing text data, where everything else is just returning a numeric value.

Is this the case?
0 Kudos
2 Replies
admin
Immortal
Immortal

Hi,

Without seeing the plugin I can't be 100% certain that the non-numeric data is the cause of the NullPointerException. However, metric values must be numeric.

You can record non-numeric data via the event log.
0 Kudos
jtataGP
Contributor
Contributor

OK, I'll look into using a log plugin or something else. I can't really post the plugin code without 'sanitizing' it because its an internal app and that would probably land me in hot water for breaking NDA, but I've gone ahead and tested it further. I can pull ANY value from the DB except for two particular strings which happen to contain non-numeric data (one is the last date the DB was refreshed, the other is a unique string tying that DB to a particular license).

Since it flips on those two and only those two I"m pretty sure that's the case, thanks. 🙂
0 Kudos