Inventory Metric Log
The Inventory Metric Log API
providesendpoints provide access totime-serieshistorical metric data collected from devices in your inventory. These endpoints allow you toqueryretrieve andretrievefilterhistoricalmetricmetrics, measurements, and sensor data with flexible filtering options. Use these endpointslogs tobuild dashboards, generate reports, oranalyze deviceperformanceperformance,overmonitortime.trends, and generate reports based on collected measurement data.
Base URL: https://control.zequenze.com/api/v1
Authentication: All endpoints require a Bearer token:
Authorization: Bearer <your-api-token>
Overview
The Inventory Metric Log API iscategory designedprovides forcomprehensive accessingaccess andto analyzinghistorical time-seriesmetric data collected from various devices in your infrastructure.inventory Thisdevices. APIThese categoryendpoints focusesare essential for monitoring device performance, analyzing trends, and generating detailed reports based on retrievingcollected metricmeasurement logs that contain measurements, sensor readings, and other quantitative data points captured over time.data.
Key Concepts:
-
MetricsMetric Logs:QuantitativeHistoricalmeasurements collected from devices (CPU usage, temperature, bandwidth, etc.)
Common Use Cases:
BuildingPerformance monitoring and trend analysis
The API supports flexiblepowerful filtering by device, metric type, parameter names, and time ranges, making it easycapabilities to help you retrieve exactly the data you needneed, with pagination for yourhandling specificlarge usedatasets case.efficiently.
Endpoints
GET /inventory_metric_log/
Description: Retrieves a paginated list of inventory metric logs with comprehensive filtering options. This endpoint is ideal for fetchingquerying historical metric data across multiple metric records across different devices, time periods,devices and metricparameters, types. Usemaking it toperfect buildfor dashboards,dashboard generatecreation, reports,trend oranalysis, performand bulk data analysis.exports.
Use Cases:
Fetch all temperature readings from a specific device over the last 24 hours
Full URL Example:
https://control.zequenze.com/api/v1/inventory_metric_log/?datetime__gte=2024-01-01&device__name=server-01&metric_name=cpu_usage&datetime__gte=2024-01-15T00:00:00Z&limit=10050
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| datetime__gte | string | query | No | Filter |
| datetime__lte | string | query | No | Filter |
| device__name | string | query | No | Filter metrics by |
| metric__name | string | query | No | Filter by |
| parameter__name | string | query | No | Filter by |
| parameter__short_name | string | query | No | Filter by |
| parameter__variable_name | string | query | No | Filter by |
| cursor | string | query | No | Pagination cursor for retrieving |
| limit | integer | query | No | Number of results |
| metric_name | string | query | No | Alternative |
| parameter_name | string | query | No | Alternative |
cURL Example:
curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/?datetime__gte=2024-01-01T00:00:00Z&device__name=web-server-01&metric_name=memory_usage&datetime__gte=2024-01-15T00:00:00Zparameter__name=cpu_usage&limit=50"100" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Example Response:
{
"count": 1247,
"next": "https://control.zequenze.com/api/v1/inventory_metric_log/?cursor=eyJpZCI6MTAwfQ%3D%3D&limit=50"eyJkYXRldGltZSI6IjIwMjQtMDEtMTVUMTA6MzA6MDBaIiwiaWQiOjEwMH0%3D",
"previous": null,
"results": [
{
"id": 15234,1245,
"datetime": "2024-01-15T14:15T10:30:00Z",
"device": {
"id": 42,
"name"device_name": "web-server-01",
"type"parameter_name": "server"CPU Usage",
"location"metric_name": "datacenter-east"
}cpu_usage",
"metric": {
"id": 7,
"name"origin": "memory_usage",
"unit": "percentage"
},
"parameter": {
"name": "Memory Utilization",
"short_name": "MEM",
"variable_name": "memory_percent",
"unit": "%"
}au",
"value": 67.8,85.7,
"status"result": 85.7,
"original_value": "normal",
85.7%"created_at": "2024-01-15T14:30:15Z"
},
{
"id": 15235,1244,
"datetime": "2024-01-15T14:15T10:25:00Z",
"device": {
"id": 42,
"name"device_name": "web-server-01",
"type"parameter_name": "server"Memory Usage",
"location"metric_name": "datacenter-east"memory_usage",
"origin": "au",
"value": 72.3,
"result": 72.3,
"original_value": "72.3%"
},
"metric":
{
"id": 7,1243,
"name"datetime": "memory_usage"2024-01-15T10:20:00Z",
"unit"device_name": "percentage"
}web-server-01",
"parameter": {
"name"parameter_name": "MemoryDisk Utilization"Usage",
"short_name"metric_name": "MEM"disk_usage",
"variable_name"origin": "memory_percent",
"unit": "%"
}sc",
"value": 65.2,45.8,
"status"result": 45.8,
"original_value": "normal",45.8 "created_at": "2024-01-15T14:25:15Z"GB"
}
]
}
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Returns paginated |
GET /inventory_metric_log/{id}/
Description: Retrieves a specific inventory metric log recordentry by its unique ID. This endpoint provides detailed information about a single metric entry,measurement, including all associated device, metric,metadata and parameterfiltering data.capabilities Usefor this when you need complete details about a specific measurement or when following up on a particular data point identified in listrelated queries.
Use Cases:
GetInvestigating specific metric anomalies or alerts
Full URL Example:
https://control.zequenze.com/api/v1/inventory_metric_log/15234/1245/
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| id | integer | path | Yes | Unique identifier of the metric log entry |
| datetime__gte | string | query | No | Additional filter |
| datetime__lte | string | query | No | Additional filter |
| device__name | string | query | No | Additional filter by device name |
| metric_name | string | query | No | Additional filter by |
| parameter_name | string | query | No | Additional filter by parameter name |
| parameter__variable_name | string | query | No | Additional filter by parameter variable name |
cURL Example:
curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/15234/1245/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Example Response:
{
"id": 15234,1245,
"datetime": "2024-01-15T14:15T10:30:00Z",
"device": {
"id": 42,
"name"device_name": "web-server-01",
"type"parameter_name": "server"CPU Usage",
"model"metric_name": "Dell PowerEdge R740"cpu_usage",
"serial_number"origin": "ABC123XYZ789",
"location": "datacenter-east",
"rack": "R15-U24",
"organization": "Production Web Services",
"status": "active",
"last_seen": "2024-01-15T14:30:00Z"
},
"metric": {
"id": 7,
"name": "memory_usage",
"description": "System memory utilization percentage",
"unit": "percentage",
"collection_interval": 300,
"retention_days": 90
},
"parameter": {
"id": 23,
"name": "Memory Utilization",
"short_name": "MEM",
"variable_name": "memory_percent",
"description": "Percentage of total system memory currently in use",
"unit": "%",
"min_value": 0,
"max_value": 100,
"warning_threshold": 80,
"critical_threshold": 95
}au",
"value": 67.8,85.7,
"raw_value"result": 85.7,
"original_value": "67.84329",
85.7%"status": "normal",
"quality": "good",
"collection_method": "snmp",
"created_at": "2024-01-15T14:30:15Z",
"updated_at": "2024-01-15T14:30:15Z"
}
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Returns the specific metric log entry |
| 401 | Unauthorized - Invalid or missing |
Common Use Cases
Use Case 1: BuildingPerformance a Device PerformanceMonitoring Dashboard
Retrieve recent CPU and memory metrics for multipleall parametersweb from a specific deviceservers to display current statussystem health status.
Approach: Use the list endpoint with device name filtering and short-termdatetime trends.
#to Getget last 24 hours of CPU, memory, and diskrecent metrics foracross amultiple server
curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/?device__name=web-server-01&datetime__gte=2024-01-15T00:00:00Z&limit=500" \
-H "Authorization: Bearer YOUR_API_TOKEN"
parameters.
Use Case 2: Historical Trend Analysis
FetchGenerate monthly performance reports by querying metric data overfor a longerspecific time periodperiods and parameters.
Approach: Use datetime filtering with parameter-specific queries to analyzecollect performancedata trendsfor trend analysis and identify patterns or seasonal variations.reporting.
# Get temperature readings for the past month
curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/?parameter__variable_name=temperature&datetime__gte=2023-12-15T00:00:00Z&datetime__lte=2024-01-15T00:00:00Z" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Use Case 3: Multi-DeviceAnomaly MonitoringInvestigation
MonitorInvestigate specific performance incidents by examining detailed metric logs around the sametime metric across multiple devices by filtering on parameter name without specifying a device.
# Get CPU usage from all devices in the last hour
curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/?metric_name=cpu_usage&datetime__gte=2024-01-15T13:00:00Z&limit=1000" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Use Case 4: Investigating Specific Incidents
When you identifyof an anomalousalert.
Approach: in your monitoring system, useUse the detail endpoint to getexamine completespecific contextmetric aboutentries, combined with datetime filtering to see surrounding data points.
Use Case 4: Automated Alerting System
Build monitoring systems that specificcheck measurement.
# Get full details about a specific concerningrecent metric readingvalues curlagainst -Xthresholds GETand "https://control.zequenze.com/api/v1/inventory_metric_log/15234/"trigger \alerts.
-HApproach: "Authorization:Regularly Bearerpoll YOUR_API_TOKEN"the
Use Case 5: DataCompliance Export for External AnalysisReporting
RetrieveGenerate largeaudit datasetsreports forshowing importmetric intocollection externalhistory analyticsand toolsdata orsources for compliance reporting.purposes.
#Approach: ExportQuery allmetric metricslogs with origin filtering to show how data was collected (automatic vs manual) for aaudit specific device over a quarter
curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/?device__name=critical-server-01&datetime__gte=2024-01-01T00:00:00Z&datetime__lte=2024-03-31T23:59:59Z&limit=10000" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Best Practices
Pagination Management:
- Use reasonable limit values (50-100) to balance performance and data volume
UseEfficient DateFiltering:
datetime__gteto limit query scope and datetime__lteError Handling:
Performance Optimization:
Origin Code Reference:
au = Automatic (sensor/system generated)
Implement Pagination: For large datasets, use the limitmaparameter= and pagination cursors to retrieve data in manageable chunks. Start with reasonable limitsManual (100-500human records) and adjust based on your needs.
Cachegu Frequently= AccessedGUI Data:(web If building dashboards or reports that refresh frequently, consider caching metric data client-side for short periods to reduce API calls and improve user experience.
Combinecl Filters= Effectively: Use multiple filter parameters togetherCLI (devicecommand name + metric type + date range) to precisely target the data you need rather than filtering large result sets client-side.
Handlesc Rate= Limits:Script Implement(automated exponential backoff retry logic in your applications to handle potential rate limiting gracefully, especially when making bulk data requests.
Monitorap = API Usage:(external Track your API usage patterns to optimize query efficiency and avoid hitting rate limits during peak monitoring periods.
Validate Date Formats: Ensure datetime parameters are properly formatted in ISO 8601 format. Include timezone information when precision is important for your use case.
Use Appropriate Error Handling: Implement robust error handling for common scenarios like missing devices, invalid date ranges, and network timeouts, especially in automated monitoring systems.