How to programmatically query for metrics and topology information? What are the REST API available to query for this information?
DX Platform 2x
You have the below 2 options:
b) /atc/metric/queryMetric : https://techdocs.broadcom.com/us/en/ca-enterprise-software/it-operations-management/application-performance-management/23-3/api-reference/apm-rest-api/Metric-Query-REST-API.html
Two options available:
a) From APM: Go to Security > Create a new Token
b) From Cluster Management > Tenant> Create a Tenant Token
1. Syntax:
POST http(s)://<apmservices-gateway.endpoint>/atc/metric/queryMetric
Authorization: Bearer Token <tenant token>
2. Examples:
{
"querySpecifier": {
"op": "SPEC",
"sourceNameSpecifier": {
"op": "REGEX",
"pattern": "(.*)UIM(.*)"
},
"attributeNameSpecifier": {
"op": "ALL"
}
},
"queryRange": {
"endTime": 0,
"rangeSize": 3600,
"frequency": 120
},
"clampSize": 1000
}
OR
{
"size": 10000,
"specifier": {
"op": "SPEC",
"sourceNameSpecifier": {
"op": "REGEX",
"pattern": "(.*)UIM(.*)"
},
"attributeNameSpecifier": {
"op": "ALL"
}
}
}
{
"querySpecifier": {
"op": "SPEC",
"sourceNameSpecifier": {
"op": "REGEX",
"pattern": "(.*)UIM(.*)"
},
"attributeNameSpecifier": {
"op": "REGEX",
"pattern": ".*Total Device Count"
}
},
"queryRange": {
"endTime": 0,
"rangeSize": 3600,
"frequency": 120
},
"clampSize": 1000
}
{
"querySpecifier": {
"op": "SPEC",
"sourceNameSpecifier": {
"op": "REGEX",
"pattern": "(.*)UIM(.*)"
},
"attributeNameSpecifier": {
"op": "REGEX",
"pattern": ".*Aggregate CPU Usage pct.*"
}
},
"queryRange": {
"endTime": 0,
"rangeSize": 3600,
"frequency": 600
},
"clampSize": 1000
}
Result #2: Validation that values reported by REST API matches those reported by DX OI UI:
NOTES:
1) About Range section:
"queryRange": {
"endTime": 0,
"rangeSize": 3600,
"frequency": 120
},
- Range is width of range you want to query. Day is 86400.
- End time is Unix timestamp of right edge of such a range. Zero is special value for current time to make last N minutes query easy. Otherwise just use absolute time.
- Frequency is required aggregation per sample (that interval selection in our metric browser). 120 is two minute interval.
2) About how to read the Metric Values
For example:
[
1633686000, => Timestamp
600, => Interval size
2.73, => Value Min across all data points in the interval
3.1708, => Value Max across all data points in the interval
2.9504, => Value in the interval (depends on aggregation type, but in this case average)
2 => Count is number of samples in interval. It is required to have more precise aggregation.
For example, average response time is used to calculate weight average.
If you had 1000 requests in your app in 15 seconds then the count will be 1000.
Two options available:
a) From APM: Go to Security > Create a new Token
b) From Cluster Management > Tenant> Create a Tenant Token
1. Syntax:
POST http(s)://<APMServices Gateway Host>/tas/graph/query
Authorization: Bearer Token <tenant token>
2. Examples:
{
"filter": {
"op": "JOIN",
"input": {
"op": "AND",
"input": [
{
"op": "ATTRIBUTE",
"expressions": [
{
"name": "Product",
"values": [
"UIM"
]
}
]
}
]
}
},
"universe": null,
"version": null,
"time": 0,
"stitchingEnabled": true,
"includeStatus": true
}
{
"size": 10000,
"specifier": {
"op": "SPEC",
"sourceNameSpecifier": {
"op": "REGEX",
"pattern": "(.*)NetOps\\|CAPM(.*)|(.*)NetOps\\|ADA(.*)|(.*)NetOps\\|NFA(.*)"
},
"attributeNameSpecifier": {
"op": "ALL"
}
}
}
{
"size": 10000,
"specifier": {
"op": "SPEC",
"sourceNameSpecifier": {
"op": "REGEX",
"pattern": "(.*)APM(.*)"
},
"attributeNameSpecifier": {
"op": "ALL"
}
}
}