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

Semantic conventions for browser navigation/resource events #1

Closed
wants to merge 4 commits into from

Conversation

martinkuba
Copy link
Owner

This is a draft of semantic conventions for browser navigation and resource events. It proposed a template for defining semantic conventions for events.

In summary:

  • introduce events subfolder under /logs/semantic_conventions
  • introduce events.* attributes, which are required to be present for any event
  • conventions for a specific domain are within a subfolder, for example /logs/semantic_conventions/events/browser for all browser-related events
  • each event type is described in a separate document
  • semantic conventions for every event must define the value for the event.name and event.domain attributes
  • any additional attributes specific to a particular event are defined the same way as regular semantic conventions for trace/metrics/logs, with the exception that they do not need to be namespaced

@github-actions
Copy link

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jul 21, 2022

Additional attributes are mapped from the [Navigation Timing API](https://www.w3.org/TR/navigation-timing-2/#sec-PerformanceNavigationTiming).

This list is not exhaustive and is listed as an example. All numeric and string values thar are provided by the Navigation Timing API SHOULD be included.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should call out that this should be included the event.data attribute.


Additional attributes are mapped from the [Resource Timing API](https://www.w3.org/TR/resource-timing-2/#sec-performanceresourcetiming).

This list is not exhaustive and is listed as an example. All numeric and string values thar are provided by the Resource Timing API SHOULD be included.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should call out that this should be included the event.data attribute.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should all events always add their attributes in event.data? If yes, then I think we should add it to the spec for the event.* attributes, which is currently proposed in open-telemetry#2676.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thoughts are yes, they should always be added.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its also a case that as part of the "Nested Attribute" support I included wording about effectively exporters needing to use a strategy to handle when they receive nested attributes, which includes the default (already mentioned as an option) using JSON.stringify()

|---|---|---|---|---|
| `event.name` | string | The event name that uniquely identifies the type of the event within the domain. | `exception`; `interaction` | Required |
| `event.domain` | string | Identifies the group of related events. Each event within a domain MUST have a unique value for the event.name attribute. | `browser`; `mobile` | Recommended |
| `event.data` | any | It is recommended that event attributes are sent as a nested object value in this attribute. [1] | Recommended |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of the way that JSON will support nested attributes (causing an explosion), perhaps we should also support having this as a JSON encoded string?? As this could then also be used for a span.event as it's looking VERY likely that it will be a loooong time (if ever) before we could update span events to support nesting (at least at this point)

But lets leave the JSON string out for now -- just calling this out as a fallback position.

@github-actions
Copy link

github-actions bot commented Aug 4, 2022

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Aug 4, 2022
@martinkuba martinkuba reopened this Aug 4, 2022
@github-actions
Copy link

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions
Copy link

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Aug 24, 2022
@martinkuba martinkuba reopened this Aug 24, 2022
@github-actions
Copy link

github-actions bot commented Sep 1, 2022

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants