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

V2 Query API - Can I filter by column in a custom metric?


I have a multi-dimension custom metric that returns three dimensions. I would like to just filter and get one particular dimension:


custom.mymetric,Foobar,cpulmt,,Linux,HOST-A1FE2C339700D559,2022-08-30 19:47:00,18.200000762939453
custom.mymetricFoobar,cpupct,,Linux,HOST-A1FE2C339700D559,2022-08-30 19:48:00,81.7
custom.mymetrixFoobar,iops,,Linux,HOST-A1FE2C339700D559,2022-08-30 19:49:00,2023


What would I add to my V2 API query to just get "cpulmt" column records?


Any help appreciated.




Dynatrace Champion
Dynatrace Champion

A few pointers:
1) Please read this page to understand the syntax and options.
2) Why are you pushing infra metrics on something with a host ID? You get that already with the OneAgent?
2) The time field won't work as you expect. As per above page it should be timestamp in UTC millis.
3) Those lines don't work as they are listed above.

Finally, it looks like you're trying to add metrics where a OneAgent is already available on that host? If so, why not use dynatrace_ingest utility instead. Topology relationships happen "automatically".

If you do actually want to push metrics from outside (via the API) then I'd either suggest 3 separate metrics:


custom.mymetric.cpulmt,hostname="",os="Linux","HOST-A1FE2C339700D559" 18.200000762939453
custom.mymetric.cpupct,hostname="",os="Linux","HOST-A1FE2C339700D559" 81.7
custom.mymetric.iops,hostname="",os="Linux","HOST-A1FE2C339700D559" 2023



OR push a single metric with a new dimension (split & filter):


custom.mymetric,type="cpulmt",hostname="",os="Linux","HOST-A1FE2C339700D559" 18.200000762939453
custom.mymetric,type="cpupct",hostname="",os="Linux","HOST-A1FE2C339700D559" 81.7
custom.mymetric,type="iops",hostname="",os="Linux","HOST-A1FE2C339700D559" 2023



Perhaps you could elaborate on the actual usecase and I can advise the "correct" solution?

Community Team
Community Team

Hi @louis_gallo., was the below reply helpful? If not, please share more details so the Community members could help you fully 😉

The only constant is change. Finding ways for great things to happen!

Featured Posts