Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add geo fields into attribute registry #1116

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
22 changes: 22 additions & 0 deletions .chloggen/geo_fields.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use this changelog template to create an entry for release notes.
#
# If your change doesn't affect end users you should instead start
# your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement
trisch-me marked this conversation as resolved.
Show resolved Hide resolved

# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
component: geo

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add geo fields to attribute registry.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
# The values here must be integers.
issues: [1033]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ body:
- area:file
- area:gcp
- area:gen-ai
- area:geo
- area:go
- area:graphql
- area:heroku
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/change_proposal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ body:
- area:file
- area:gcp
- area:gen-ai
- area:geo
- area:go
- area:graphql
- area:heroku
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/new-conventions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ body:
- area:file
- area:gcp
- area:gen-ai
- area:geo
- area:go
- area:graphql
- area:heroku
Expand Down
1 change: 1 addition & 0 deletions docs/attributes-registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Currently, the following namespaces exist:
- [File](file.md)
- [GCP](gcp.md)
- [Gen AI](gen-ai.md)
- [Geo](geo.md)
- [Go](go.md)
- [GraphQL](graphql.md)
- [Heroku](heroku.md)
Expand Down
40 changes: 40 additions & 0 deletions docs/attributes-registry/geo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!--- Hugo front matter used to generate the website version of this page:
--->

<!-- NOTE: THIS FILE IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/attribute_namespace.md.j2 -->

# Geo

## Geo Attributes

Geo fields can carry data about a specific location related to an event. This geolocation information can be derived from techniques such as Geo IP, or be user-supplied.
gregkalapos marked this conversation as resolved.
Show resolved Hide resolved

| Attribute | Type | Description | Examples | Stability |
| ---------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ---------------------------------------------------------------- |
| `geo.city_name` | string | City name. | `Montreal`; `Berlin` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `geo.continent_code` | string | Two-letter code representing continent’s name. | `AF`; `AN`; `AS` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `geo.continent_name` | string | Name of the continent. | `North America`; `Europe` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `geo.country_iso_code` | string | Two-letter ISO Country Code ([ISO 3166-1 alpha2](https://en.wikipedia.org/wiki/ISO_3166-1#Codes)). | `CA` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `geo.country_name` | string | Country name. | `Canada` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `geo.location.lat` | double | Latitude of the geo location in [WGS84](https://en.wikipedia.org/wiki/World_Geodetic_System#WGS84). | `45.505918` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `geo.location.lon` | double | Longitude of the geo location in [WGS84](https://en.wikipedia.org/wiki/World_Geodetic_System#WGS84). | `-73.61483` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `geo.name` | string | User-defined description of a location. [1] | `boston-dc` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `geo.postal_code` | string | Postal code associated with the location. Values appropriate for this field may also be known as a postcode or ZIP code and will vary widely from country to country. | `94040` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `geo.region_iso_code` | string | Region ISO code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). | `CA-QC` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `geo.region_name` | string | Region name. | `Quebec` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `geo.timezone` | string | The time zone of the location, such as [IANA time zone name](https://nodatime.org/TimeZones). | `America/Argentina/Buenos_Aires` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

**[1]:** User-defined description of a location, at the level of granularity they care about. Could be the name of their data centers, the floor number, if this describes a local physical entity, city names. Not typically used in automated geolocation.

`geo.continent_code` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
| ----- | ------------- | ---------------------------------------------------------------- |
| `AF` | Africa | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `AN` | Antarctica | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `AS` | Asia | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `EU` | Europe | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `NA` | North America | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `OC` | Oceania | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `SA` | South America | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
114 changes: 114 additions & 0 deletions model/registry/geo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
groups:
- id: registry.geo
type: attribute_group
prefix: geo
brief: >
Geo fields can carry data about a specific location related to an event.
This geolocation information can be derived from techniques such as Geo IP, or be user-supplied.
attributes:
- id: city_name
stability: experimental
type: string
brief: >
City name.
examples: [ 'Montreal', 'Berlin' ]
- id: continent_code
AlexanderWert marked this conversation as resolved.
Show resolved Hide resolved
stability: experimental
brief: >
Two-letter code representing continent’s name.
type:
allow_custom_values: false
trisch-me marked this conversation as resolved.
Show resolved Hide resolved
members:
- id: 'af'
stability: experimental
value: 'AF'
brief: 'Africa'
- id: 'an'
stability: experimental
value: 'AN'
brief: 'Antarctica'
- id: 'as'
stability: experimental
value: 'AS'
brief: 'Asia'
- id: 'eu'
stability: experimental
value: 'EU'
brief: 'Europe'
- id: 'na'
stability: experimental
value: 'NA'
brief: 'North America'
- id: 'oc'
stability: experimental
value: 'OC'
brief: 'Oceania'
- id: 'sa'
stability: experimental
value: 'SA'
brief: 'South America'
- id: continent_name
stability: experimental
type: string
trisch-me marked this conversation as resolved.
Show resolved Hide resolved
brief: >
Name of the continent.
examples: [ 'North America', 'Europe' ]
- id: country_iso_code
AlexanderWert marked this conversation as resolved.
Show resolved Hide resolved
stability: experimental
type: string
brief: >
Two-letter ISO Country Code ([ISO 3166-1 alpha2](https://en.wikipedia.org/wiki/ISO_3166-1#Codes)).
examples: [ 'CA' ]
- id: country_name
AlexanderWert marked this conversation as resolved.
Show resolved Hide resolved
stability: experimental
type: string
brief: >
Country name.
examples: [ 'Canada' ]
- id: location.lon
stability: experimental
type: double
brief: >
Longitude of the geo location in [WGS84](https://en.wikipedia.org/wiki/World_Geodetic_System#WGS84).
examples: [ -73.614830 ]
- id: location.lat
stability: experimental
type: double
brief: >
Latitude of the geo location in [WGS84](https://en.wikipedia.org/wiki/World_Geodetic_System#WGS84).
examples: [ 45.505918 ]
AlexanderWert marked this conversation as resolved.
Show resolved Hide resolved
- id: name
lmolkova marked this conversation as resolved.
Show resolved Hide resolved
stability: experimental
type: string
brief: >
User-defined description of a location.
note: >
User-defined description of a location, at the level of granularity they care about.
Could be the name of their data centers, the floor number, if this describes a local physical entity, city names.
lmolkova marked this conversation as resolved.
Show resolved Hide resolved
Not typically used in automated geolocation.
examples: [ 'boston-dc' ]
- id: postal_code
stability: experimental
type: string
brief: >
Postal code associated with the location.
Values appropriate for this field may also be known as a postcode or ZIP code and will vary widely from country to country.
examples: [ '94040' ]
- id: region_iso_code
AlexanderWert marked this conversation as resolved.
Show resolved Hide resolved
stability: experimental
type: string
brief: >
Region ISO code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)).
examples: [ 'CA-QC' ]
- id: region_name
AlexanderWert marked this conversation as resolved.
Show resolved Hide resolved
stability: experimental
type: string
brief: >
Region name.
examples: [ 'Quebec' ]
- id: timezone
lmolkova marked this conversation as resolved.
Show resolved Hide resolved
stability: experimental
type: string
brief: >
The time zone of the location, such as [IANA time zone name](https://nodatime.org/TimeZones).
lmolkova marked this conversation as resolved.
Show resolved Hide resolved
examples: [ 'America/Argentina/Buenos_Aires' ]
Loading