04 Feb 2021 09:49 AM
Hello,
I use the names transformation feature with endpoint "/metrics/query" to get the datapoint with the entity name on the response.
I use the metric selector : builtin:host.cpu.usage:names:merge(1)
And It works good :
{
"totalCount": 4,
"nextPageKey": null,
"result": [
{
"metricId": "builtin:host.cpu.usage:names:merge(1)",
"data": [
{
"dimensions": [
"RD501D37E80E-HOST"
],
"dimensionMap": {
"dt.entity.host.name": "RD501D37E80E-HOST"
},
"timestamps": [
1611230400000,
1611241200000,
But the key "dt.entity.host.name": RD501D37E80E-HOST" is generated exception on my integration because the key name contains the char and this char is not allowed with the mongodb driver https://docs.mongodb.com/manual/core/document/ :
Until support is added in the query language, the use of $
and .
in field names is not recommended and is not supported by the official MongoDB drivers.
Is there a way to mask the "dimensionMap" on response by changing the query parameters ?
Thank you.
Regards, Aurélien
Solved! Go to Solution.
04 Feb 2021 01:31 PM
I don't think it is possible without extra script. Maybe you should use python script for example which will collect payloads in regular basis and then modify it on the fly before putting it into mongo?
Sebastian
05 Nov 2021 08:25 PM
Just for someone that might see this in the future, the use of merge(1) ahs been deprecated, and should use the dimension key name.
Please check out: https://www.dynatrace.com/support/help/shortlink/api-metrics-v2-selector#merge-transformation