Uploaded image for project: 'Red Hat 3scale API Management'
  1. Red Hat 3scale API Management
  2. THREESCALE-8719

The default metric should be a Product's metric

XMLWordPrintable

    • False
    • None
    • False
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Hide
      1. Create a backend first.
      2. Next, create a product.
      3. Set the backend to the product.
      4. Go to Analytics > Traffic page of the product.

      Actual Result: The default metric is the backend's hits metric.
      Expected Result: The default metric is the product's hits metric.

      Show
      Create a backend first. Next, create a product. Set the backend to the product. Go to Analytics > Traffic page of the product. Actual Result: The default metric is the backend's hits metric. Expected Result: The default metric is the product's hits metric.

      StatsMetricsSelector selects the first metric in a response by default.

      this.selectMetric(metrics[0])
      

      However, the first one can be a Backend's metric.

      e.g.

      {
        "metrics": [
          {
            "metric": {
              "id": 7,
              "system_name": "hits.2",
              "description": "Number of API hits",
              "unit": "hit",
              "created_at": "2022-08-10T08:52:12Z",
              "updated_at": "2022-08-10T08:52:12Z",
              "service_id": null,
              "friendly_name": "Hits",
              "parent_id": null,
              "tenant_id": null,
              "owner_id": 2,
              "owner_type": "BackendApi"
            }
          },
          {
            "metric": {
              "id": 14,
              "system_name": "hits",
              "description": "Number of API hits",
              "unit": "hit",
              "created_at": "2022-09-06T05:05:50Z",
              "updated_at": "2022-09-06T05:05:50Z",
              "service_id": 8,
              "friendly_name": "Hits",
              "parent_id": null,
              "tenant_id": 2,
              "owner_id": 8,
              "owner_type": "Service"
            }
          },
          {
            "metric": {
              "id": 15,
              "system_name": "hits.4",
              "description": "Number of API hits",
              "unit": "hit",
              "created_at": "2022-09-07T01:23:54Z",
              "updated_at": "2022-09-07T01:23:54Z",
              "service_id": null,
              "friendly_name": "Hits",
              "parent_id": null,
              "tenant_id": null,
              "owner_id": 4,
              "owner_type": "BackendApi"
            }
          }
        ],
        "methods": []
      }
      

      Please select a metric that owner_type is Service.

              Unassigned Unassigned
              rhn-support-tkonishi Takayuki Konishi
              Dominik Hlavac Duran Dominik Hlavac Duran
              Nidhi Soni Nidhi Soni (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: