Inventory Metric Log
RetrieveThe Inventory Metric Log API provides access to time-series metric data collected from devices in your inventory. These endpoints allow you to query andfilterretrieveinventoryhistoricalmetricmetrics,logmeasurements, and sensor data withdatetime range and device/parameterflexible filteringcapabilities.options. Use these endpoints to build dashboards, generate reports, or analyze device performance over time.
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 is designed for accessing and analyzing time-series data collected from various devices in your infrastructure. This API category focuses on retrieving metric logs that contain measurements, sensor readings, and other quantitative data points captured over time.
Key Concepts:
Common Use Cases:
The API supports flexible filtering by device, metric type, parameter names, and time ranges, making it easy to retrieve exactly the data you need for your specific use case.
Endpoints
GET /inventory_metric_log/
RetrieveDescription: Retrieves a paginated list of inventory metric logs with advancedcomprehensive filtering optionsoptions. This endpoint is ideal for datetimefetching ranges,multiple metric records across different devices, time periods, and parameters.metric types. Use it to build dashboards, generate reports, or perform bulk data analysis.
Use Cases:
Full URL Example:
https://control.zequenze.com/api/v1/inventory_metric_log/?device__name=server-01&metric_name=cpu_usage&datetime__gte=2024-01-15T00:00:00Z&limit=100
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| datetime__gte | string | query | No | Filter records from this datetime |
| datetime__lte | string | query | No | Filter records |
| device__name | string | query | No | Filter metrics by exact device name |
| metric__name | string | query | No | Filter by the internal metric name identifier |
| 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 |
| limit | integer | query | No | Number of results to return per page (default |
| metric_name | string | query | No | Alternative parameter to filter |
| parameter_name | string | query | No | Alternative parameter to filter |
ExamplecURL Request:Example:
curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/?device__name=web-server-01&metric_name=memory_usage&datetime__gte=2024-01-01&device__name=sensor-0115T00:00:00Z&limit=5050" \
-H "Authorization: Bearer <your-api-token>YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Example Response:
{
"count": 1250,1247,
"next": "https://control.zequenze.com/api/v1/inventory_metric_log/?cursor=eyJkYXRldGltZSI6IjIwMjQtMDEtMDIifQ"eyJpZCI6MTAwfQ%3D%3D&limit=50",
"previous": null,
"results": [
{
"id": 12345,15234,
"datetime": "2024-01-02T10:15T14:30:00Z",
"device": {
"id": 42,
"name": "sensor-web-server-01",
"id"type": 101"server",
"location": "datacenter-east"
},
"metric": {
"id": 7,
"name": "temperature_reading"memory_usage",
"id"unit": 501"percentage"
},
"parameter": {
"name": "Temperature"Memory Utilization",
"short_name": "temp"MEM",
"variable_name": "temp_celsius"memory_percent",
"id"unit": 301"%"
},
"value": 23.5,67.8,
"unit"status": "°C"normal",
"created_at": "2024-01-02T10:15T14:30:15Z"
},
{
"id": 12346,15235,
"datetime": "2024-01-02T10:35:15T14:25:00Z",
"device": {
"id": 42,
"name": "sensor-web-server-01",
"id"type": 101"server",
"location": "datacenter-east"
},
"metric": {
"id": 7,
"name": "humidity_reading"memory_usage",
"id"unit": 502"percentage"
},
"parameter": {
"name": "Humidity"Memory Utilization",
"short_name": "humid"MEM",
"variable_name": "humidity_percent"memory_percent",
"id"unit": 302"%"
},
"value": 65.2,
"unit"status": "%"normal",
"created_at": "2024-01-02T10:35:12Z"15T14:25:15Z"
}
]
}
Response Codes:
| Status | Description |
|---|---|
| 200 |
GET /inventory_metric_log/{id}/
RetrieveDescription: Retrieves a specific inventory metric log entryrecord by its unique identifier.ID. This endpoint provides detailed information about a single metric entry, including all associated device, metric, and parameter data. Use this when you need complete details about a specific measurement or when following up on a particular data point identified in list queries.
Use Cases:
Full URL Example:
https://control.zequenze.com/api/v1/inventory_metric_log/15234/
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| id | integer | path | Yes | Unique identifier of the metric log entry to retrieve |
| datetime__gte | string | query | No | |
| datetime__lte | string | query | No | |
| device__name | string | query | No | |
| metric_name | string | query | No | |
| parameter_name | string | query | No | |
| parameter__variable_name | string | query | No |
ExamplecURL Request:Example:
curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/12345/15234/" \
-H "Authorization: Bearer <your-api-token>YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Example Response:
{
"id": 12345,15234,
"datetime": "2024-01-02T10:15T14:30:00Z",
"device": {
"id": 42,
"name": "sensor-web-server-01",
"id": 101,
"location": "Building A - Floor 2",
"type": "temperature_sensor"server",
"model": "Dell PowerEdge R740",
"serial_number": "ABC123XYZ789",
"location": "datacenter-east",
"rack": "R15-U24",
"organization": "Production Web Services",
"status": "active",
"last_seen": "2024-01-15T14:30:00Z"
},
"metric": {
"id": 7,
"name": "temperature_reading"memory_usage",
"id": 501,
"description": "AmbientSystem temperaturememory measurement"utilization percentage",
"frequency"unit": "5_minutes"percentage",
"collection_interval": 300,
"retention_days": 90
},
"parameter": {
"id": 23,
"name": "Temperature"Memory Utilization",
"short_name": "temp"MEM",
"variable_name": "temp_celsius"memory_percent",
"id"description": 301,"Percentage of total system memory currently in use",
"unit": "°C"%",
"data_type"min_value": 0,
"float"max_value": 100,
"warning_threshold": 80,
"critical_threshold": 95
},
"value": 23.5,67.8,
"unit"raw_value": "°C"67.84329",
"status": "normal",
"quality": "good",
"status"collection_method": "active"snmp",
"created_at": "2024-01-02T10:15T14:30:15Z",
"updated_at": "2024-01-02T10:15T14:30:15Z"
}
Response Codes:
| Status | Description |
|---|---|
| 200 | |
| 401 | Unauthorized - Invalid or missing |
Common Use Cases
Use Case 1: Building a Device Performance Dashboard
Retrieve recent metrics for multiple parameters from a specific device to display current status and short-term trends.
# Get last 24 hours of CPU, memory, and disk metrics for a server
curl -X InvalidGET ID"https://control.zequenze.com/api/v1/inventory_metric_log/?device__name=web-server-01&datetime__gte=2024-01-15T00:00:00Z&limit=500" format\
-H "Authorization: Bearer YOUR_API_TOKEN"
Use Case 2: Historical Trend Analysis
Fetch metric data over a longer time period to analyze performance trends and identify patterns or queryseasonal parameters
# 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-Device Monitoring
Monitor the same 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 identify an anomalous reading in your monitoring system, use the detail endpoint to get complete context about that specific measurement.
# Get full details about a specific concerning metric reading
curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/15234/" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Use Case 5: Data Export for External Analysis
Retrieve large datasets for import into external analytics tools or for compliance reporting.
# Export all metrics for a 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
-
DateTimeUseFilteringDate Range Filters: Always specify datetime filters (datetime__gteanddatetime__lte) to avoid retrieving excessive historical data and improve response times.
Implement Pagination: For large datasets, use the limit parameter and pagination cursors to retrieve data in manageable chunks. Start with reasonable limits (100-500 records) and adjust based on your needs.
Cache Frequently Accessed Data: 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.
Combine Filters Effectively: Use ISOmultiple 8601filter formatparameters for datetime parameters. Supports date-onlytogether (2024-01-01),device datetimename (2024-01-01+ 10:30:00),metric andtype timezone-aware+ formatsdate (2024-01-01range) 10:30:00+00:00)
cursordata PerformanceHandle Rate Limits: CombineImplement filtersexponential backoff retry logic in your applications to reducehandle responsepotential sizerate andlimiting improve query performance,gracefully, especially when dealingmaking withbulk largedata timerequests.
RateMonitor LimitingAPI Usage: ImplementTrack appropriateyour delaysAPI betweenusage requests when processing large datasetspatterns to optimize query efficiency and avoid hitting API rate limits during peak monitoring periods.
CachingValidate Date Formats: ConsiderEnsure cachingdatetime responsesparameters are properly formatted in ISO 8601 format. Include timezone information when precision is important for frequentlyyour accesseduse metriccase.
Use Appropriate Error Handling: AlwaysImplement checkrobust responseerror statushandling codesfor common scenarios like missing devices, invalid date ranges, and implementnetwork retrytimeouts, logicespecially forin transientautomated failuresmonitoring systems.