We're using the latest version of your exported and we've encountered a weird behavior when we observe values with an ObservableGauge.
Basically, we sent by mistake a string representation of an integer to the observe method and found out that we can't see it in Dynatrace.
There was no indication that the value is in a wrong format and did not see any error, that's why it took us time to figure this out.
After debugging the code, it seems that the export method logic doesn't process strings correctly, and it just parsed the value to '0 0', which caused dynatrace to probably ignore this value.
Example of the code we used:
const meter = MetricsAPI.getInstance().getMeter(name);
meter.createObservableGauge(name, options, (observerResult) => {
const count = getCount() // returns "3" and not 3
observerResult.observe(count, {/*label*/});
})
This observation was converted to this body: <metric-name>,<dimensions> gauge,0 0 instead of <metric-name>,<dimensions> gauge,3
I understand that the observe method should accept only integers, but it could be helpful if you could possibly:
Show an error/warning if the value is in a wrong format
Be able to parse string representations of integers correctly
Hello,
We're using the latest version of your exported and we've encountered a weird behavior when we observe values with an ObservableGauge. Basically, we sent by mistake a string representation of an integer to the observe method and found out that we can't see it in Dynatrace. There was no indication that the value is in a wrong format and did not see any error, that's why it took us time to figure this out. After debugging the code, it seems that the
export
method logic doesn't process strings correctly, and it just parsed the value to '0 0', which caused dynatrace to probably ignore this value.Example of the code we used:
This observation was converted to this body:
<metric-name>,<dimensions> gauge,0 0
instead of<metric-name>,<dimensions> gauge,3
I understand that the observe method should accept only integers, but it could be helpful if you could possibly:
Thanks a lot!