Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 31 additions & 0 deletions .chloggen/sqlserver-session-attributes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. receiver/filelog)
component: receiver/sqlserver

# A brief description of the change. Surround your text with quotes (") if it needs to start with a backtick (`).
note: Add session attributes to `db.server.query_sample` event.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [48346]

# (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: |
The `db.server.query_sample` log records now include:

- `sqlserver.client.app.name`: Name of the client application that initiated the session.
- `sqlserver.session.started`: ISO 8601 timestamp of when the session was established.
- `sqlserver.session.duration`: Total elapsed time in seconds the session has been actively executing requests.
# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
3 changes: 3 additions & 0 deletions receiver/sqlserverreceiver/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ query sample
| network.peer.port | TCP port used by the peer client. | Any Int | - |
| sqlserver.blocking_session_id | Session ID that is blocking the current session. 0 if none. | Any Int | - |
| sqlserver.blocking.start_time | Timestamp of when the current blocking wait began (ISO 8601 format). | Any Str | - |
| sqlserver.client.app.name | Name of the client application that initiated the session. | Any Str | - |
| sqlserver.context_info | Context information for the session, represented as a hexadecimal string. | Any Str | - |
| sqlserver.command | SQL command type being executed. | Any Str | - |
| sqlserver.cpu_time | CPU time consumed by the query, in seconds. | Any Double | - |
Expand All @@ -599,6 +600,8 @@ query sample
| sqlserver.wait.resource.id | SQL Server identifier for the locked or waited-on resource, if available. | Any Str | - |
| sqlserver.wait.resource.type | SQL Server type of the locked or waited-on resource, if available. | Any Str | - |
| sqlserver.row_count | Number of rows affected or returned by the query. | Any Int | - |
| sqlserver.session.duration | Total elapsed time in seconds the session has been actively executing requests. | Any Double | - |
| sqlserver.session.started | Timestamp when the session was established (ISO 8601 format). | Any Str | - |
| sqlserver.session_id | ID of the SQL Server session. | Any Int | - |
| sqlserver.session_status | Status of the session (e.g., running, sleeping). | Any Str | - |
| sqlserver.total_elapsed_time | Total elapsed time for completed executions of this plan, reported in delta seconds. | Any Double | - |
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions receiver/sqlserverreceiver/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ attributes:
description: Session ID that is blocking the current session. 0 if none.
type: int
requirement_level: recommended
sqlserver.client.app.name:
description: Name of the client application that initiated the session.
type: string
requirement_level: recommended
sqlserver.command:
description: SQL command type being executed.
type: string
Expand Down Expand Up @@ -214,6 +218,14 @@ attributes:
description: Number of rows affected or returned by the query.
type: int
requirement_level: recommended
sqlserver.session.duration:
description: Total elapsed time in seconds the session has been actively executing requests.
type: double
requirement_level: recommended
sqlserver.session.started:
description: Timestamp when the session was established (ISO 8601 format).
type: string
requirement_level: recommended
sqlserver.session_id:
description: ID of the SQL Server session.
type: int
Expand Down Expand Up @@ -327,6 +339,7 @@ events:
- network.peer.port
- sqlserver.blocking_session_id
- sqlserver.blocking.start_time
- sqlserver.client.app.name
- sqlserver.context_info
- sqlserver.command
- sqlserver.cpu_time
Expand All @@ -344,6 +357,9 @@ events:
- sqlserver.wait.resource.id
- sqlserver.wait.resource.type
- sqlserver.row_count
- sqlserver.session.duration

- sqlserver.session.started
- sqlserver.session_id
- sqlserver.session_status
- sqlserver.total_elapsed_time
Expand Down
Loading
Loading