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

Session.id semantic convention #215

Merged
merged 30 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3073cad
first pass at client sessions semconv
bryce-b Jul 26, 2023
6fd49af
Update docs/client/README.md
bryce-b Jul 27, 2023
bbdbaa4
Update docs/client/session.md
bryce-b Jul 27, 2023
5d031e8
Update docs/client/README.md
bryce-b Jul 27, 2023
45be3f2
added session model and PR feedback changes
bryce-b Aug 1, 2023
f99f97d
fixed lint errors
bryce-b Aug 1, 2023
2574f89
fixing lint errors
bryce-b Aug 1, 2023
1434ecf
added doc status to session.md
bryce-b Aug 1, 2023
7f6291f
added doc status to session.md
bryce-b Aug 1, 2023
034db4a
updated session definitions per feedback
bryce-b Aug 7, 2023
51b4a60
applied changes per conversation with Santosh
bryce-b Aug 16, 2023
7ee3642
regenerated session-id table
bryce-b Aug 17, 2023
cbbe82e
changed guid to uuid
bryce-b Aug 22, 2023
64599e2
Merge branch 'main' into client-sessions
bryce-b Aug 22, 2023
1b04df6
updated session id description
bryce-b Aug 22, 2023
f32f8d2
cleaning up lint issues
bryce-b Aug 22, 2023
9d975e1
removed newline
bryce-b Aug 22, 2023
739b0be
removed whitespace
bryce-b Aug 22, 2023
98ad47d
new line on yaml file
bryce-b Aug 22, 2023
9da5dcb
Merge branch 'main' into client-sessions
bryce-b Aug 22, 2023
751dff4
Update session.yaml
bryce-b Aug 30, 2023
a7329ca
Update session.yaml
bryce-b Aug 30, 2023
d1b4bc2
regenerated table
bryce-b Aug 30, 2023
36b4a68
Merge branch 'main' into client-sessions
bryce-b Aug 31, 2023
c34edb8
Merge branch 'main' into client-sessions
bryce-b Sep 7, 2023
c10c6d4
Merge branch 'main' into client-sessions
bryce-b Sep 12, 2023
070a10f
updated changelog.md
bryce-b Sep 18, 2023
49e8728
removed trailing space
bryce-b Sep 18, 2023
2cbfda9
Merge branch 'main' into client-sessions
bryce-b Sep 19, 2023
c7c417d
Merge branch 'main' into client-sessions
AlexanderWert Sep 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Semantic Conventions For Client SDKs

**Status**: [Experimental][DocumentStatus]

This document defines general semantic conventions for client-side applications.
The most common types of client applications are web applications (that run in a web browser)
and mobile apps (that run on a phone or tablet).
bryce-b marked this conversation as resolved.
Show resolved Hide resolved
Client applications are differentiated from server applications in that they service a user rather than requests.
bryce-b marked this conversation as resolved.
Show resolved Hide resolved
This adds unique requirements and needs to client-side semantic conventions.

The following semantic conventions exist for client:

* [Session](session.md): Semantic Conventions for client session.

[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/document-status.md
33 changes: 33 additions & 0 deletions docs/client/session.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Semantic conventions for session

**Status**: [Experimental][DocumentStatus]

This document defines semantic conventions to apply to client-side applications when tracking sessions.
bryce-b marked this conversation as resolved.
Show resolved Hide resolved

Session is defined as the period of time encompassing all activities performed by the application and the actions
executed by the end user. The period of time is defined by the initial activity and concluded after a period of
inactivity, or explicitly ended after a maximum duration is reached.

Consequently, a Session is represented as a collection of Logs, Events, and Spans emitted by the Client Application
throughout the Session's duration. Each Session is assigned a unique identifier, which is included as an attribute in
the Logs, Events, and Spans generated during the Session's lifecycle.

## Attributes

<!-- semconv client-session-id -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `client.session_id` | string | A GUID. | `00112233-4455-6677-8899-aabbccddeeff` | Opt-In |
bryce-b marked this conversation as resolved.
Show resolved Hide resolved
<!-- endsemconv -->

## How a session operates

After a period of timeout, `client.session_id` MUST be refreshed.
The timeout period MUST be restarted when any Logs, Events, or Spans are recorded.
The session timeout period CAN be customized.
Default session timeout SHOULD be 30 minutes. Session timeout period SHOULD be established when the instrumentation is
first configured and MUST NOT be updated in the middle of a session.

Maximum session length SHOULD NOT exceed 4 hours.

[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/document-status.md
13 changes: 13 additions & 0 deletions model/client/session.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
groups:
- id: client-session-id
prefix: client
type: attribute_group
brief: >
This attribute can be applied to all signals generate. It may be omitted from metrics, due to the
aggregated nature of metrics, and the high cardinality of this attribute.
attributes:
- id: session_id
type: string
brief: "A GUID."
examples: "00112233-4455-6677-8899-aabbccddeeff"
requirement_level: opt_in

Check failure on line 13 in model/client/session.yaml

View workflow job for this annotation

GitHub Actions / yamllint

[new-line-at-end-of-file] no new line character at the end of file
Loading