Uploaded image for project: 'Hawkular Metrics'
  1. Hawkular Metrics
  2. HWKMETRICS-393

There needs to be endpoints for fetching raw data for multiple metrics

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 0.17.0
    • Component/s: REST
    • Labels:

      Description

      Matt Wringe pointed out an inconsistency in our REST API. We have endpoints for fetching raw data from a single metric. We have endpoints for fetching stats from a single metric. We have endpoints for fetching stats from multiple metrics. We lack endpoints for fetching raw data from multiple metrics.

      Given the endpoint changes done for HWKMETRICS-24, I propose the following new endpoints:

      GET /hawkular/metrics/gauges/raw
      
      GET /hawkular/metrics/counters/raw
      
      GET /hawkular/metrics/availability/raw
      

      And because the memory concerns that I raised in HWKMETRICS-392, I propose that we return in the response a list of what I will call named data point which would look like:

      [
        {
            "id": "gauge-1",
            "timestamp": 123456,
            "value": 3.14
        },
        {
            "id": "gauge-2",
            "timestamp": 123456,
            "value": 3.14
        },
        {
            "id": "gauge-1",
            "timestamp": 12345679,
            "value": 3.14
        },
        {
            "id": "gauge-3",
            "timestamp": 123456,
            "value": 3.14
        }
      ]
      

      Each data point object in the list contains an id property which more precisely corresponds to the name portion of a metric id.

      I think it makes sense to also include a new endpoint for mixed data.

      GET /hawkular/metrics/metrics/raw
      

      The response could return a list of what I will call typed data points which would look like:

      [
        {
            "id": "gauge-1",
            "type": "gauge",
            "timestamp": 123456,
            "value": 3.14
        },
        {
            "id": "counter-1",
            "type": "counter",
            "timestamp": 123456,
            "value": 31
        },
        {
            "id": "gauge-1",
            "type:" "gauge",
            "timestamp": 12345679,
            "value": 3.14
        },
        {
            "id": "availability-1",
            "type": "availability",
            "timestamp": 123456,
            "value": "up"
        }
      ]
      

      Each data point includes an additional type field. This format makes it very easy to stream the data back to the client when we are executing multiple queries in parallel.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  john.sanda John Sanda
                  Reporter:
                  john.sanda John Sanda
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: