Get Metrics

Get Metrics

pre-requisite
To fetch metric types and metric names details refer Catalog API
To fetch entity name, entity type, device type, and device name refer to Topology API


API to fetch raw metrics for given metric type,entity name, and time range.
Request
URI
GET
https://{api_host}/tcsa.host.com/tcsa/api/metrics-management/v1/metric-type/{metric-type}
COPY
Path Parameters
string
metric-type
Required

Metric type defined in catalog

metric-type example
memory
Query Parameters
string
entity_names
Required

Entity on which metrics are collected.
Supports regex. (minimum 3 letters required if you want to use .* )
Supports multiple entity names up to 10 by giving comma(,)

entity_names example
MEM-AMPMNEWUS102000_PS_Switch_10/1
number
start_timestamp
Optional

Must be in EPOCH seconds.
Defaults to last one day

start_timestamp example
1654041600
number
end_timestamp
Optional

Must be in EPOCH seconds.
Defaults to current time

end_timestamp example
1654041600
string
device_type
Optional

Device type

device_type example
Switch
string
device_name
Optional

Device instance name on which metrics collected

device_name example
AMPMNEWUS102000_PS_Switch_10
string
include_metric_names
Optional

Provide metric names to be included in the response, multiple metric names separated by comma(,) .
Default to all metric names that exist for metric type

include_metric_names example
FreeMemory,FreeMemoryPct
string
entity_type
Optional

Entity type

entity_type example
Memory
string
data_source
Optional

Collector which collects this metric

data_source example
AMPMNEWUS102000
string
tags.customer
Optional

Here customer is tag enriched in metrics.
Can replace customer with any other enriched tag like city

tags.customer example
Airtel
number
size
Optional

The size parameter allows you to configure the maximum no of records to be returned.

size example
1000
number
from
Optional

The from parameter defines the offset from the first result user wants to fetch. The default is 0.

from example
10
string
sort_field
Optional

Sorting field. defaults to timestamp asc. Field value must match with param existing in response.

sort_field example
timestamp
string
sort_order
Optional

Sorting order asc,desc

sort_order example
asc

Authentication
This operation uses the following authentication methods.
Responses
200

OK

Returns MetricResponse of type(s) application/json
{
    "COUNT": 1,
    "Result": [
        {
            "deviceType": "Switch",
            "instance": "SMARTS-PM-METRICS",
            "entityType": "Memory",
            "processedTimestamp": 1657544634825,
            "type": "smarts-metrics",
            "deviceName": "AMPMNEWUS102000_PS_Switch_10",
            "FreeMemory": 9295,
            "tags": {
                "IsManaged": true,
                "priority": "NONE",
                "dcName": "_core"
            },
            "metricType": "memory",
            "@timestamp": "2022-07-11T12:56:26.000Z",
            "entityName": "MEM-AMPMNEWUS102000_PS_Switch_10/1",
            "@version": "1",
            "elementUUID": "AMPMNEWUS102000_PS_Switch_10$Switch$",
            "dataSource": "AMPMNEWUS102000",
            "timestamp": 1657544186000
        }
    ]
}
number
total
Optional

Total number of objects

result
Optional

Response object containing array of metrics for given filter


400

Invalid Request sent by the user

Operation doesn't return any data structure

401

User authentication failed

Operation doesn't return any data structure

403

Access to the requested resource/operation is forbidden

Operation doesn't return any data structure

404

Cannot find requested resource

Operation doesn't return any data structure

500

Internal server error

Operation doesn't return any data structure