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

Filtering results based on hosts or process. Which query param can be used for filtering?

manjunathcr22
Participant

https://AAA12345.live.dynatrace.com/api/v2/metrics/query?metricSelector=builtin:host.cpu.gcpu.usage:names&from=1652853660000&to=1652940060000&resolution=60m 

For this query I am getting two hosts as result. Is it possible two specify hostname  XYZ or ABCD and get result of single host? Which query param can be used for filtering?

{
"totalCount": 2,
"nextPageKey": null,
"resolution": "1h",
"result": [
{
"metricId": "builtin:host.cpu.gcpu.usage:names",
"dataPointCountRatio": 1.2E-4,
"dimensionCountRatio": 0.001,
"data": [
{
"dimensions": [
"XYZ",
"HOST-ABCDEF"
],
"dimensionMap": {
"dt.entity.host.name": "XYZ",
"dt.entity.host": "HOST-ABCDEF"
},
"timestamps": [
1652857200000,
1652860800000,
1652864400000,
1652868000000,
1652871600000,
1652875200000,
1652878800000,
1652882400000,
1652886000000,
1652889600000,
1652893200000,
1652896800000,
1652900400000,
1652904000000,
1652907600000,
1652911200000,
1652914800000,
1652918400000,
1652922000000,
1652925600000,
1652929200000,
1652932800000,
1652936400000,
1652940000000,
1652943600000
],
"values": [
4.322033898305085,
4.083333333333333,
5.15,
23.258333333333333,
8.075,
4.35,
6.016666666666667,
3.0833333333333335,
3.558333333333333,
7.308333333333334,
9.321739130434782,
2.9916666666666667,
6.433333333333334,
3.6333333333333333,
3.216666666666667,
3.475,
4.225,
3.8333333333333335,
2.525,
3.933333333333333,
3.6333333333333333,
6.283333333333333,
4.45,
6.875,
4.308333333333334
]
},
{
"dimensions": [
"ABCD",
"HOST-XYZ"
],
"dimensionMap": {
"dt.entity.host.name": "ABCD",
"dt.entity.host": "HOST-XYZ"
},
"timestamps": [
1652857200000,
1652860800000,
1652864400000,
1652868000000,
1652871600000,
1652875200000,
1652878800000,
1652882400000,
1652886000000,
1652889600000,
1652893200000,
1652896800000,
1652900400000,
1652904000000,
1652907600000,
1652911200000,
1652914800000,
1652918400000,
1652922000000,
1652925600000,
1652929200000,
1652932800000,
1652936400000,
1652940000000,
1652943600000
],
"values": [
53.11666666666667,
59.675,
63.36666666666667,
56.88333333333333,
57.36666666666667,
57.05833333333333,
58.708333333333336,
59.641666666666666,
54.916666666666664,
56.61666666666667,
55.59322033898305,
55.833333333333336,
56.56666666666667,
56.74166666666667,
55.38333333333333,
56.4,
54.53333333333333,
55.425,
61.55,
62.65,
60.666666666666664,
66.475,
73.225,
73.09166666666667,
53.708333333333336
]
}]
}
]
}

1 REPLY 1

Julius_Loman
DynaMight Legend
DynaMight Legend

You can use either the entitySelector parameter or the Metrics v2 get-data-points API  you are using. Also, it's possible to use the entitySelector directly in the metricSelector argument by using the :filter transformation.

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

Featured Posts