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.
- mentioned on