Seeing some non-integer values for custom metrics that should return integers.
HenryT
Posts: 6 New member
Playing with the new restAPI and I am looking at results for the "Number of unused indexes"
and seeing data like this, the query should (and I suspect is) return integer values. Why am I getting this?
and seeing data like this, the query should (and I suspect is) return integer values. Why am I getting this?
{ "dateTime": "2024-05-21T17:26:51.8380771Z", "value": 0.00718123376274544 }, { "dateTime": "2024-05-21T17:36:51.8238908Z", "value": 0.0010450247083899555 }, {
Tagged:
Answers
To confirm, is it this custom metric https://sqlmonitormetrics.red-gate.com/number-of-unused-indexes/?
Have you accidentally changed it to record the rate of change (is this box checked)?
If you go to the Analysis page and select that custom metric do you see integers or decimals?
Also, what specific API request did you use (just to check it's looking at the metric you believe it is)?
Kind regards,
Alex
Have you visited our Help Center?
The configuration of the metric, it is out of the box.
Here is the obfuscated call.
http://xxx-xxxxx:8080/api/v1/metrics?metricTypeId=[Cluster].[SqlServer].[Database].[CustomMetric].%5xxxx-xxxx.xx.xxx.com:2]
Chatting to the team, specific support for Custom metrics wasn't included in the release. What is the bit obfuscated at the end of the call - an entity name or the base monitor name or something else?
Do you have more than one custom metric added?
Kind regards,
Alex
Have you visited our Help Center?
I've mentioned that they exist to the developers. Looking at the information for what is returned for me, it looks like the last part is the Base Monitor name and then the custom metric ID from settings.customMetrics separated by a colon:
And if I then look to get that information from the API it shows the correct info (19):
which is the same as what I see on the Analysis page for the metric:
With that all said, are you looking at the correct custom metric endpoint (you showed custom metric ID=2 in the URL you linked before)? Does the data on the Analysis graph correlate wtih what the metric is returning?
Kind regards,
Alex
Have you visited our Help Center?
The metric looks fine in analysis.
I have three monitors in three locations, but this custom alert is only defined in one location—it is not the primary location.
I get data back only for my primary monitoring instance (which does not have this metric defined), so I suspect it is not using the server name specified in the MetricTypeID value. These may
I suspect I have reached the level of opening a support call.
Just to update here as well, as mentioned before specific support for Custom metrics wasn't included in the release. It does seem to work if you only have one Base Monitor, but if you try to access Custom Metric data for a second Base Monitor, it will return the data from the custom metric with that Id on the Primary BM.
The team have made an item to investigate this when they revisit the Rest API to see if it will fit into that work, but there are no specific plans at this point to implement it at this time should it not fit into that work.
Kind regards,
Alex
Have you visited our Help Center?