Open
Description
The purpose and use-cases of the new component
New processor to map from geoname.id
into geo location attributes.
- Similar to https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/geoipprocessor
- The generate geo attributes will follow semantic convention https://opentelemetry.io/docs/specs/semconv/attributes-registry/geo/
The geoname data can be accessible from http://www.geonames.org using two approaches:
-
Store all the geoname data in memory extracted from a file. More info about the file
-
Call API to get the geo location info of a
geonameID
- Public Rest API
http://api.geonames.org/getJSON?geonameId=<GeoNameID>&username=<username>
- Example result:
"geonameId": 5128581, "name": "New York", "lat": "40.71427", "lng": "-74.00597", "countryName": "United States", "countryCode": "US", "population": 8175133, "adminName1": "New York", "adminCode1": "NY", "adminName2": "New York County", "timezone": { "timeZoneId": "America/New_York", "gmtOffset": -5, "dstOffset": -4 }, "fcode": "PPL", "fcl": "P", "continentCode": "NA", "elevation": null, "bBox": { "east": -73.7002721, "north": 40.9152555, "south": 40.496044, "west": -74.2557349
- Require to cache geo location data
- Public Rest API
Example configuration for the component
processors:
geonameprocessor:
providers:
file:
geonames: /tmp/mygeodb
api:
geonames:
username: user1
ttl: 1d
context: record
attributes: [geoname.id]
providers
: GeoNames location information providers. It can be configured byfile
orapi
file
: Access the data from a filegeonames
: file with the GeoNames table. More info https://download.geonames.org/export/dump/readme.txt
api
: Access the data from a APIgeonames
: Using the GeoNames API http://www.geonames.org//username
: Require username to make request.http://api.geonames.org/getJSON?geonameId=<GeoNameID>&username=<username>
ttl
: expiration times for data
context
(default: resource): Allows specifying the underlying telemetry context the processor will work with. Available values:resource
: Resource attributes.record
: Attributes within a data point, log record or a span.
attributes
: An array of attribute names, which contains the geoname.id value.
Telemetry data types supported
metrics, traces, logs
Code Owner(s)
No response
Sponsor (optional)
No response
Additional context
No response