# Dynatrace Metrics V2 API - Help with Deprecated Call

**URL:** <https://community.dynatrace.com/t/dynatrace-metrics-v2-api-help-with-deprecated-call/31686>\
**Category:** Dynatrace API\
**Tags:** dynatrace-managed, dynatrace-api\
**Created:** [June 2, 2021, 12:52pm UTC](https://community.dynatrace.com/t/dynatrace-metrics-v2-api-help-with-deprecated-call/31686 "2021-06-02T12:52:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![louis\_gallo](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@louis\_gallo](https://community.dynatrace.com/u/louis_gallo)\
**Post date:** [June 2, 2021, 12:52pm UTC](https://community.dynatrace.com/t/dynatrace-metrics-v2-api-help-with-deprecated-call/31686/1 "2021-06-02T12:52:47Z")

</div>

I am using the V2 metrics API to retrieve common system metrics, in this case swap availability and usage.

type(HOST),tag(MyApplication:MyTag)

builtin:host.mem.swap.(used,avail):names:merge(1)

I need the common "“dt.entity.host.name” name and not the cryptic one. It works fine, but if I peek in the warnings, I see this:

warnings": [  
“Usage of index \“1\” is deprecated, please consider converting the query to use the dimension key \“dt.entity.host\” instead”

How do I change my metrics selector to the newer format?

Any help is greatly appreciated.

Lou

---

<div class="post-metadata">

**Author:** ![louis\_gallo](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@louis\_gallo](https://community.dynatrace.com/u/louis_gallo)\
**Post date:** [June 2, 2021, 1:02pm UTC](https://community.dynatrace.com/t/dynatrace-metrics-v2-api-help-with-deprecated-call/31686/2 "2021-06-02T13:02:04Z")

</div>

Wait, I think I see it. It is as easy as this? I guess I really should have read the error.

builtin:host.cpu.usage:names:merge(dt.entity.host)

Thanks,

Lou
