Skip to main content

Inventory Metric Log

Endpoints Summary

Method Path Swagger GET /inventory_metric_log/ Swagger ↗ GET /inventory_metric_log/{id}/ Swagger ↗

The Inventoryinventory Metricmetric Log APIlog endpoints provide access to historical metric data collected from devicesmonitored ininventory your inventory.devices. These endpoints allow you to retrieve andtime-series data for device parameters, filter metricby logstime toranges and device characteristics, and analyze deviceperformance performance,trends monitoracross trends,your and generate reports based on collected measurement data.infrastructure.

Base URL: https://control.zequenze.com/api/v1

Authentication: All endpoints require a Bearer token:

Authorization: Bearer <your-api-token>

Overview

The Inventoryinventory Metricmetric Loglog API category providesenables comprehensiveyou to access toand analyze historical metricperformance and status data collected from your inventorymonitored devices. These endpoints are essential for monitoring device performance, analyzing trends, and generating detailed reports based on collected measurement data.

Key Concepts:for:

  • MetricPerformance LogsMonitoring: HistoricalTrack recordsdevice ofmetrics measurementsover takentime fromto devices,identify includingtrends, values, timestamps,bottlenecks, and metadataanomalies
  • DeviceHistorical AssociationAnalysis: EachRetrieve past metric isdata linkedfor toreporting, acompliance, specificand devicecapacity in your inventoryplanning
  • Parameter TrackingTroubleshooting: MetricsCorrelate aredevice organized by parameters (what is being measured)issues with supportspecific fortime multipleperiods namingand conventionsparameter changes
  • OriginData TrackingIntegration: EachExport metric data for external analytics platforms or custom dashboards

The metric logs capture data from various sources (automatic monitoring, manual entry, scripts, APIs) and provide a comprehensive audit trail of device performance. Each log entry recordsincludes howthe original value, processed result, timestamp, and origin information to ensure data integrity and traceability.

Key concepts:

    Parameters: The specific metrics being measured (CPU usage, memory, temperature, etc.) Origins: How the data was collected (automatic, manual, API,GUI, etc.)CLI, script, API)

    CommonDevice UseContext: Cases:

    Links
      metrics to specific inventory devices for proper attribution Performance monitoringTime andSeries trendData: All entries are timestamped for chronological analysis Historical data retrieval for reporting Device health assessments Compliance auditing and data validation Integration with monitoring dashboards and alerting systems

      The API supports powerful filtering capabilities to help you retrieve exactly the data you need, with pagination for handling large datasets efficiently.


      Endpoints

      GET /inventory_metric_log/

      Description: Retrieves a paginated list of inventory metric logslog entries with comprehensive filtering options.capabilities. This endpoint is idealyour primary tool for querying historical device performance data, allowing you to filter by time ranges, device names, parameter types, and metric names to extract exactly the data acrossyou multiple devices and parameters, making it perfectneed for dashboard creation, trend analysis, and bulk data exports.analysis.

      Use Cases:

      • BuildingMonitor monitoring dashboards with historical data
      Generatingdevice performance reportstrends forover specific time periods AnalyzingGenerate devicereports trendson parameter values across multiple parametersdevices ExportingTroubleshoot issues by examining metric data around incident times Export data for external analysis toolsor Creatinglong-term alerts based on historical patternsstorage

      Full URL Example:

      https://control.zequenze.com/api/v1/inventory_metric_log/?datetime__gte=2024-01-01&device__name=server-01&parameter__variable_name=cpu_usage&limit=50
      

      Parameters:

      Parameter Type In Required Description
      datetime__gte string query No Filter for metrics fromrecorded on or after this date/time onwards. Supports (ISO format: 2000-01-01, 2000-01-01 00:01:00, 2000-01-01 00:01:00+00:0000)
      datetime__lte string query No Filter for metrics uprecorded toon or before this date/time.time Supports (ISO format: 2000-01-01, 2000-01-01 00:01:00, 2000-01-01 00:01:00+00:0000)
      device__name string query No Filter metricsby bythe exact device name to get metrics from specific devices
      metric__name string query No Filter by metric name to focus on specific measurement types
      parameter__name string query No Filter by parameter name to get specific types of measurements
      parameter__short_name string query No Filter byusing the abbreviated parameter short name
      parameter__variable_name string query No Filter by parameterthe technical variable name used in the system
      cursor string query No Pagination cursor for retrievingnavigating nextthrough pagelarge ofresult resultssets
      limit integer query No Number of results per page (recommended:default varies, recommend 50-100 for optimal performance)
      metric_name string query No Alternative filter for metricmetric's parameter name field
      parameter_name string query No Alternative filter for metricmetric's parameter name field

      cURL Example:

      curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/?datetime__gte=2024-01-01T00:00:00Z01&device__name=web-server-01&parameter__name=cpu_usageparameter__variable_name=memory_usage&limit=100" \
        -H "Authorization: Bearer YOUR_API_TOKEN" \
        -H "Content-Type: application/json"
      

      Example Response:

      {
        "next": "https://control.zequenze.com/api/v1/inventory_metric_log/?cursor=eyJkYXRldGltZSI6IjIwMjQtMDEtMTVUMTA6MzA6MDBaIiwiaWQiOjEwMH0%eyJpZCI6MTAwfQ%3D%3D",
        "previous": null,
        "results": [
          {
            "id": 1245,1547,
            "datetime": "2024-01-15T10:15T14:30:00Z"00.123456Z",
            "device_name": "web-server-01",
            "parameter_name": "Memory Usage",
            "metric_name": "System Memory",
            "origin": "au",
            "value": 78.5,
            "result": 78.5,
            "original_value": "78.5%"
          },
          {
            "id": 1546,
            "datetime": "2024-01-15T14:25:00.987654Z",
            "device_name": "web-server-01",
            "parameter_name": "Memory Usage",
            "metric_name": "System Memory",
            "origin": "au",
            "value": 76.2,
            "result": 76.2,
            "original_value": "76.2%"
          },
          {
            "id": 1545,
            "datetime": "2024-01-15T14:20:00.555123Z",
            "device_name": "web-server-01",
            "parameter_name": "CPU Usage",
            "metric_name": "cpu_usage",System "origin": "au",
            "value": 85.7,
            "result": 85.7,
            "original_value": "85.7%"
          },
          {
            "id": 1244,
            "datetime": "2024-01-15T10:25:00Z",
            "device_name": "web-server-01",
            "parameter_name": "Memory Usage",
            "metric_name": "memory_usage",
            "origin": "au",
            "value": 72.3,
            "result": 72.3,
            "original_value": "72.3%"
          },
          {
            "id": 1243,
            "datetime": "2024-01-15T10:20:00Z",
            "device_name": "web-server-01",
            "parameter_name": "Disk Usage",
            "metric_name": "disk_usage"CPU",
            "origin": "sc",
            "value": 45.8,
            "result": 45.8,
            "original_value": "45.8 GB"8"
          }
        ]
      }
      

      Response Codes:

      Status Description
      200 Success - Returns paginated metric log data
      401 Unauthorized - Invalid or missing APIauthentication token
      400 Bad Request - Invalid queryfilter parameters or date format
      429 Too Many Requests - Rate limit exceeded

      GET /inventory_metric_log/{id}/

      Description: Retrieves detailed information for a specific inventory metric log entry by its unique ID. This endpoint provides detailedthe information about a single metric measurement, including all metadata andsame filtering capabilities foras relatedthe queries.list endpoint but returns only the single record that matches both the ID and any additional filter criteria you specify.

      Use Cases:

      • InvestigatingGet complete details for a specific metric anomalieslog entry
      Verify data integrity for a particular measurement Retrieve context around a specific data point identified in reports Validate metric data during troubleshooting or alerts Retrieving detailed information for audit trails Accessing specific measurements for debugging purposes Building drill-down interfaces from summary viewsaudits

      Full URL Example:

      https://control.zequenze.com/api/v1/inventory_metric_log/1245/1547/?device__name=web-server-01
      

      Parameters:

      Parameter Type In Required Description
      id integer path Yes UniqueThe unique identifier of the metric log entry to retrieve
      datetime__gte string query No Additional filterfilter: byentry datetime (greatermust thanbe on or equal)after this date
      datetime__lte string query No Additional filterfilter: byentry datetime (lessmust thanbe on or equal)before this date
      device__name string query No Additional filterfilter: byverify the entry belongs to this device name
      metric_name string query No Additional filterfilter: byverify parameterthe entry has this metric name
      parameter_name string query No Additional filterfilter: byverify the entry has this parameter name
      parameter__variable_name string query No Additional filterfilter: byverify parameterthe entry has this variable name

      cURL Example:

      curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/1245/1547/" \
        -H "Authorization: Bearer YOUR_API_TOKEN" \
        -H "Content-Type: application/json"
      

      Example Response:

      {
        "id": 1245,1547,
        "datetime": "2024-01-15T10:15T14:30:00Z"00.123456Z",
        "device_name": "web-server-01",
        "parameter_name": "CPUMemory Usage",
        "metric_name": "cpu_usage"System Memory",
        "origin": "au",
        "value": 85.7,78.5,
        "result": 85.7,78.5,
        "original_value": "85.7%78.5%"
      }
      

      Response Codes:

      Status Description
      200 Success - Returns the specificrequested metric log entry
      401 Unauthorized - Invalid or missing APIauthentication token
      404 Not Found - Metric log entry with specified ID does notdoesn't exist or doesn't match filters
      403400 ForbiddenBad Request - AccessInvalid deniedfilter to this metric log entryparameters

      Common Use Cases

      Use Case 1: Performance MonitoringTrend DashboardAnalysis

      Retrieve recentMonitor CPU and memory usage trends for critical servers over the past week to identify performance patterns and potential capacity issues.

      # Get CPU metrics for all web servers to display current system health status.
      

      Approach: Use the listlast endpoint7 withdays devicecurl name-X filteringGET and"https://control.zequenze.com/api/v1/inventory_metric_log/?datetime__gte=2024-01-08&datetime__lte=2024-01-15&device__name=prod-server-01&parameter__variable_name=cpu_usage&limit=200" datetime\ range-H to"Authorization: getBearer recentYOUR_API_TOKEN" metrics across multiple parameters.

      Use Case 2: HistoricalIncident Trend AnalysisInvestigation

      GenerateExamine monthly performance reports by queryingall metric data forfrom a specific timedevice periodsduring anda parameters.

      known

      Approach:incident Usetimeframe datetimeto filteringcorrelate performance issues with parameter-specificsystem queriesproblems.

      to
      # collectGet dataall formetrics trendduring analysisincident andwindow
      reporting.curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/?datetime__gte=2024-01-15T02:00:00&datetime__lte=2024-01-15T04:00:00&device__name=database-server-03" \
        -H "Authorization: Bearer YOUR_API_TOKEN"
      

      Use Case 3: AnomalyAutomated InvestigationData Collection Verification

      InvestigateVerify that automatic monitoring systems are properly collecting data by filtering for specific performanceorigins incidentsand by examining detailed metric logs around the time of an alert.

      Approach: Use the detail endpoint to examine specific metric entries, combined with datetime filtering to see surroundingchecking data points.continuity.

      # Check recent automatic measurements
      curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/?datetime__gte=2024-01-15&origin=au&limit=50" \
        -H "Authorization: Bearer YOUR_API_TOKEN"
      

      Use Case 4: AutomatedCustom AlertingDashboard SystemData Export

      BuildExport specific metric data for integration with external monitoring systemsdashboards thator checkbusiness recentintelligence metric values against thresholds and trigger alerts.tools.

      Approach:

      # RegularlyExport polltemperature thedata listfor endpointenvironmental withmonitoring
      recentcurl datetime-X filtersGET and"https://control.zequenze.com/api/v1/inventory_metric_log/?parameter__variable_name=temperature&datetime__gte=2024-01-01&limit=1000" parameter-specific\
        queries-H to"Authorization: monitorBearer criticalYOUR_API_TOKEN"
      metrics.

      Use Case 5: Compliance Reporting

      Generate audithistorical reports showing metric collection history and data sources for compliance purposes.

      audits

      Approach:by Queryretrieving metric logsdata with proper origin filteringtracking toand showtimestamps.

      how
      # dataGet wasmanual collected (automatic vs manual)entries for audit trails.trail
      curl -X GET "https://control.zequenze.com/api/v1/inventory_metric_log/?origin=ma&datetime__gte=2024-01-01&datetime__lte=2024-01-31" \
        -H "Authorization: Bearer YOUR_API_TOKEN"
      

      Best Practices

      Pagination Management:

      • Use reasonableTime limitRange valuesFilters: (50-100)Always tospecify balance performancedatetime__gte and data volume

      Implement cursor-based pagination for consistent results when data changes frequently Store cursor values for resuming interrupted data collection processes

      Efficient Filtering:

        Always use datetime filtersdatetime__lte to limit queryresult scopesets and improve performancequery performance, especially for large datasets. Combine device

        Implement Pagination: For large data sets, use the limit parameter (recommended: 50-100 records per request) and parameterfollow filtersthe next cursor for subsequent pages to reduceavoid unnecessarytimeouts.

        Cache Frequently Accessed Data: If you're building dashboards or reports, cache metric data transfer

        locally Useand specificrefresh parameter namesperiodically rather than broadmaking queriesreal-time whenAPI possiblecalls for every display update.

        Monitor Origin Types: Pay attention to the origin field to distinguish between automatic monitoring data (au) and manual entries (ma, gu, cl) for data quality analysis.

        Handle Time Zones Properly: Use ISO 8601 format with timezone information in datetime filters. The API returns all timestamps in UTC, so convert to local time zones as needed in your application.

        Filter by Device Groups: When monitoring multiple similar devices, make separate API calls for each device rather than retrieving all data and filtering client-side for better performance.

        Validate Data Integrity: Compare value, result, and original_value fields to understand any data processing or conversion that occurred during metric collection.

        Error Handling:Handling

        :
          Implement retry logic for ratetransient limitingnetwork (429)errors and gracefully handle 404 responses Handlewhen missingspecific metric log entries (404)may gracefullyhave inbeen monitoringarchived systemsor Validate datetime formats before making API calls to avoid 400 errors

          Performance Optimization:deleted.

            Cache frequently accessed metric data locally when appropriate Use batch processing for large historical data exports Consider the trade-off between real-time queries and scheduled data collection

            Origin Code Reference:

              au = Automatic (sensor/system generated) ma = Manual (human entered) gu = GUI (web interface) cl = CLI (command line) sc = Script (automated script) ap = API (external system)