Feature request: API/intake for setting client.geo.location
- Dominant language
- Gherkin
- Stars
- 427
- Forks
- 125
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
Services may know the geolocation of their clients, and that could be useful for map visualisations and aggregations. e.g. https://discuss.elastic.co/t/how-to-adjust-apm-client-setlabel-index-field-type-to-geo-point/226994 describes a use case for indexing the geolocation of IoT devices communicating with an IoT API/service.
**Describe the solution you'd like**
1. Extend the intake protocol with a new transaction/error context field: `context.client.geo.location`. The value may be one of:
1. `"context.client.geo.location": {"lat": -31.95, "lon": 115.86}`
1. `"context.client.geo.location": "qd66hrw"` ([geohash](https://en.wikipedia.org/wiki/Geohash))
2. Extend agents' APIs to enable users to record the geolocation of the client of a request. e.g. `apm.setClientGeoLocation({"lat": -31.95, "lon": 115.86})` or `apm.setClientGeoLocation("qd66hrw")`.
3. APM Server would record this new context in the ECS [`client.geo.location`](https://www.elastic.co/guide/en/ecs/current/ecs-geo.html) field. The value sent by the agent would be stored as-is; the field type is [`geo_point`](https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-point.html), which supports both of the above formats and more.
**Describe alternatives you've considered**
Add the location as a [geohash](https://en.wikipedia.org/wiki/Geohash)-formatted string label, and either create a specific mapping for that label with the "geo_point" field type, or add an ingest node processor which renames the label to "client.geo.location".
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.