Open kpatticha opened 7 months ago
Pinging @elastic/apm-ui (Team:APM)
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)
@kpatticha Since the query only returns one document, I think that could be the problem where no value is returned. I tried querying my edge cluster data and was able to get documents that have no values:
GET /metrics-apm*,apm-*,logs-apm*/_search
{
"size": 10,
"query": {
"bool": {
"must_not": [
{
"exists": {
"field": "cloud.provider"
}
}
],
"filter": [
{
"term": {
"service.name": "heartbeat"
}
},
{
"range": {
"@timestamp": {
"gte": "now-15m/m",
"lte": "now"
}
}
}
]
}
},
"aggs": {
"by_environment": {
"terms": {
"field": "service.environment",
"size": 10
},
"aggs": {
"missing_cloud_provider_count": {
"missing": {
"field": "cloud.provider"
}
}
}
}
}
}
It seems like it could be possible that no value is returned for cloud.provider if it falls out of the time range or the highest ranked document doesn't include this field because it includes the other fields.
We didn't consider the case where each environment could use different cloud provider or platform.
https://github.com/elastic/kibana/blob/beff74e19e94c7d3c609a2be0cb1d4b2f28da043/x-pack/plugins/apm/server/routes/services/route.ts#L282-L311