cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API V2 /metrics/query with names transformation : How to mask the json "dimensionMap" on response ?

agravier
Newcomer

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

1 REPLY 1

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